summaryrefslogtreecommitdiff
path: root/noncore/applets/autorotateapplet/autorotateimpl.cpp
blob: 305ac5099de8e4e2b86d61a294981684fc3fae1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "autorotate.h"
#include "autorotateimpl.h"


AutoRotateImpl::AutoRotateImpl()
    : autoRotate(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;
    } else
	return QS_FALSE;

    if ( *iface ) {
	(*iface)->addRef();
    }
    return QS_OK;
}

Q_EXPORT_INTERFACE() {
    Q_CREATE_INSTANCE( AutoRotateImpl )
}