Diffstat (limited to 'core/applets/homeapplet/home.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/homeapplet/home.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/core/applets/homeapplet/home.cpp b/core/applets/homeapplet/home.cpp new file mode 100644 index 0000000..2b726ae --- a/dev/null +++ b/core/applets/homeapplet/home.cpp @@ -0,0 +1,74 @@ +#include <qpe/resource.h> +#include <qpe/qcopenvelope_qws.h> + +#include <qiconset.h> +#include <qpopupmenu.h> + +#include "home.h" + + +HomeApplet::HomeApplet ( ) + : QObject ( 0, "HomeApplet" ), ref ( 0 ) +{ +} + +HomeApplet::~HomeApplet ( ) +{ +} + +int HomeApplet::position ( ) const +{ + return 0; +} + +QString HomeApplet::name ( ) const +{ + return tr( "Home shortcut" ); +} + +QString HomeApplet::text ( ) const +{ + return tr( "Home" ); +} + +QIconSet HomeApplet::icon ( ) const +{ + QPixmap pix; + QImage img = Resource::loadImage ( "home" ); + + if ( !img. isNull ( )) + pix. convertFromImage ( img. smoothScale ( 16, 16 )); + return pix; +} + +QPopupMenu *HomeApplet::popup ( QWidget * ) const +{ + return 0; +} + +void HomeApplet::activated ( ) +{ + // to desktop (home) + QCopEnvelope ( "QPE/Desktop", "home()" ); +} + + +QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_MenuApplet ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + return QS_OK; +} + +Q_EXPORT_INTERFACE( ) +{ + Q_CREATE_INSTANCE( HomeApplet ) +} + + |