summaryrefslogtreecommitdiff
path: root/noncore/applets/zkbapplet/zkbapplet.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/zkbapplet/zkbapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/zkbapplet/zkbapplet.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/noncore/applets/zkbapplet/zkbapplet.cpp b/noncore/applets/zkbapplet/zkbapplet.cpp
new file mode 100644
index 0000000..6c71568
--- a/dev/null
+++ b/noncore/applets/zkbapplet/zkbapplet.cpp
@@ -0,0 +1,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)
+}