summaryrefslogtreecommitdiff
path: root/noncore/applets/zkbapplet/zkbapplet.cpp
blob: 6c7156876bef931a7729ca60e970d05ca74a8add (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
43
44
45
46
47
48
49
#include <stdio.h>
#include <qlabel.h>
#include <qbutton.h>
#include <qwindowsystem_qws.h>
#include "zkbapplet.h"
#include "zkbwidget.h"


ZkbApplet::ZkbApplet() : app(0){
}

ZkbApplet::~ZkbApplet()
{
    if (app) delete app;
}

QWidget* ZkbApplet::applet(QWidget* parent) {
	if (app == 0) {
		app = new ZkbWidget(parent);
	}

	return app;
}

int ZkbApplet::position() const {
	return 8;
}

QRESULT ZkbApplet::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(ZkbApplet)
}