From 1538a521b674d2eff02b926c0d82fa6184dd99db Mon Sep 17 00:00:00 2001 From: treke Date: Tue, 09 Dec 2003 03:23:20 +0000 Subject: Applet for turning on and off automatic rotation --- (limited to 'noncore/applets/autorotateapplet/autorotateimpl.cpp') diff --git a/noncore/applets/autorotateapplet/autorotateimpl.cpp b/noncore/applets/autorotateapplet/autorotateimpl.cpp new file mode 100644 index 0000000..01d8a01 --- a/dev/null +++ b/noncore/applets/autorotateapplet/autorotateimpl.cpp @@ -0,0 +1,41 @@ +#include "autorotate.h" +#include "autorotateimpl.h" + + +AutoRotateImpl::AutoRotateImpl() + : autoRotate(0), ref(0) { + qDebug ("here"); +} + +AutoRotateImpl::~AutoRotateImpl() { + delete autoRotate; +} + +QWidget *AutoRotateImpl::applet( QWidget *parent ) { + if ( !autoRotate ) { + autoRotate = new AutoRotate( parent ); + } + return autoRotate; +} + +int AutoRotateImpl::position() const { + return 7; +} + +QRESULT AutoRotateImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { + *iface = 0; + if ( uuid == IID_QUnknown ) { + *iface = this; + } else if ( uuid == IID_TaskbarApplet ) { + *iface = this; + } + + if ( *iface ) { + (*iface)->addRef(); + } + return QS_OK; +} + +Q_EXPORT_INTERFACE() { + Q_CREATE_INSTANCE( AutoRotateImpl ) +} -- cgit v0.9.0.2