summaryrefslogtreecommitdiffabout
path: root/kalarmd/simplealarmdaemonapplet.cpp
blob: 73b1e07b8b9094f87ac45df70e031f7160064e3e (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
50
51
52
53
54
55
56
57
58
#include "simplealarmdaemonapplet.h"

#include "simplealarmdaemonimpl.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;
  mApplet = 0;
}


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;
  }
  return QS_FALSE;
}
Q_EXPORT_INTERFACE()
{
    Q_CREATE_INSTANCE( SimpleAlarmDaemonApplet )
}