summaryrefslogtreecommitdiff
path: root/libopie2/opieui/otaskbarapplet.h
Unidiff
Diffstat (limited to 'libopie2/opieui/otaskbarapplet.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/otaskbarapplet.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h
index 074367f..0c85ee7 100644
--- a/libopie2/opieui/otaskbarapplet.h
+++ b/libopie2/opieui/otaskbarapplet.h
@@ -33,11 +33,20 @@
33#define OTASKBARAPPLET_H 33#define OTASKBARAPPLET_H
34 34
35#include <qpe/taskbarappletinterface.h> 35#include <qpe/taskbarappletinterface.h>
36#include <qpe/qcom.h>
36 37
38#include <qwidget.h>
39
40class QMouseEvent;
41
42namespace Opie {
43namespace Ui {
44namespace Private {
37/*====================================================================================== 45/*======================================================================================
38 * OTaskbarAppletWrapper 46 * OTaskbarAppletWrapper
39 *======================================================================================*/ 47 *======================================================================================*/
40 48
49class OTaskbarAppletWrapperPrivate;
41template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface 50template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface
42{ 51{
43 public: 52 public:
@@ -80,14 +89,10 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface
80 89
81 private: 90 private:
82 T* _applet; 91 T* _applet;
92 OTaskbarAppletWrapperPrivate *d;
83}; 93};
84 94
85#include <qframe.h> 95}
86#include <qwidget.h>
87#include <qpe/qpeapplication.h>
88
89class QMouseEvent;
90
91/*====================================================================================== 96/*======================================================================================
92 * OTaskbarApplet 97 * OTaskbarApplet
93 *======================================================================================*/ 98 *======================================================================================*/
@@ -103,28 +108,22 @@ class QMouseEvent;
103class OTaskbarApplet : public QWidget 108class OTaskbarApplet : public QWidget
104{ 109{
105 public: 110 public:
106 OTaskbarApplet( QWidget* parent, const char* name = 0 ):QWidget( parent, name ) 111 OTaskbarApplet( QWidget* parent, const char* name = 0 );
107 { 112 virtual ~OTaskbarApplet();
108 setFixedHeight( 18 );
109 setFixedWidth( 14 );
110 }
111 113
112 virtual ~OTaskbarApplet() 114 protected:
113 { 115 virtual void popup( QWidget* widget );
116private:
117 class Private;
118 Private *d;
119};
120}
114 } 121 }
115 122
116 protected: 123#define EXPORT_OPIE_APPLET_v1( AppLet ) \
117 virtual void popup( QWidget* widget ) 124 Q_EXPORT_INTERFACE() { \
118 { 125 Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \
119 QPoint curPos = mapToGlobal( QPoint( 0, 0 ) );
120 int w = widget->sizeHint().width();
121 int x = curPos.x() - (w/2 );
122 if ( (x+w) > QPEApplication::desktop()->width() )
123 x = QPEApplication::desktop()->width()-w;
124 widget->move( x, curPos.y()-widget->sizeHint().height() );
125 widget->show();
126 } 126 }
127};
128 127
129#endif 128#endif
130 129