summaryrefslogtreecommitdiffabout
path: root/kalarmd/simplealarmdaemonapplet.cpp
Side-by-side diff
Diffstat (limited to 'kalarmd/simplealarmdaemonapplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonapplet.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/kalarmd/simplealarmdaemonapplet.cpp b/kalarmd/simplealarmdaemonapplet.cpp
new file mode 100644
index 0000000..bb89606
--- a/dev/null
+++ b/kalarmd/simplealarmdaemonapplet.cpp
@@ -0,0 +1,58 @@
+#include "simplealarmdaemonapplet.h"
+
+#include "simplealarmdaemonimpl.h"
+
+#include <qpe/global.h>
+#include <qcopchannel_qws.h>
+#include <qlabel.h>
+#include <qapp.h>
+#include <qpe/resource.h>
+SimpleAlarmDaemonApplet::SimpleAlarmDaemonApplet()
+ : mApplet( 0 ), ref( 0 )
+{
+
+}
+
+SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet()
+{
+ delete mApplet;
+}
+
+
+QWidget *SimpleAlarmDaemonApplet::applet( QWidget *parent )
+{
+ if ( !mApplet ) {
+ mApplet = new SimpleAlarmDaemonImpl( parent );
+ if ( QApplication::desktop()->width() < 480 )
+ mApplet->setPixmap( Resource::loadPixmap( "ko16" ) );
+ else
+ mApplet->setPixmap( Resource::loadPixmap( "ko24" ) );
+ QCopChannel* c = new QCopChannel("koalarm",mApplet , "channel" ) ;
+ QObject::connect( c, SIGNAL (received ( const QCString &, const QByteArray & )),mApplet, SLOT(recieve( const QCString&, const QByteArray& )));
+ mApplet->show();
+ }
+ return mApplet;
+}
+
+int SimpleAlarmDaemonApplet::position() const
+{
+ return 7;
+}
+
+QRESULT SimpleAlarmDaemonApplet::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( SimpleAlarmDaemonApplet )
+}