Diffstat (limited to 'libopie2/opiepim/ui/oholidaypluginif.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/ui/oholidaypluginif.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libopie2/opiepim/ui/oholidaypluginif.h b/libopie2/opiepim/ui/oholidaypluginif.h index 825d3ad..618d371 100644 --- a/libopie2/opiepim/ui/oholidaypluginif.h +++ b/libopie2/opiepim/ui/oholidaypluginif.h | |||
@@ -1,44 +1,43 @@ | |||
1 | #ifndef _O_HOLIDAY_PLUGIN_IF_H | 1 | #ifndef _O_HOLIDAY_PLUGIN_IF_H |
2 | #define _O_HOLIDAY_PLUGIN_IF_H | 2 | #define _O_HOLIDAY_PLUGIN_IF_H |
3 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <qpe/qcom.h> | 4 | #include <qpe/qcom.h> |
5 | 5 | ||
6 | #ifndef QT_NO_COMPONENT | 6 | #ifndef QT_NO_COMPONENT |
7 | //017f90d4-34fc-4dc5-aed7-498c6da6571e | 7 | //c0a5f73f-975e-4492-9285-af555284c4ab |
8 | #define IID_HOLIDAY_PLUGIN QUuid(0x017f90d4,0x34fc,0x4dc5,0xae,0xd7,0x49,0x8c,0x6d,0xa6,0x57,0x1e) | 8 | #define IID_HOLIDAY_PLUGIN QUuid(0xc0a5f73f,0x975e,0x4492,0x92,0x85,0xaf,0x55,0x52,0x84,0xc4,0xab) |
9 | #endif | 9 | #endif |
10 | 10 | ||
11 | namespace Opie { | 11 | namespace Opie { |
12 | namespace Datebook { | 12 | namespace Datebook { |
13 | 13 | ||
14 | class HolidayPlugin; | 14 | class HolidayPlugin; |
15 | 15 | ||
16 | class HolidayPluginIf:public QUnknownInterface | 16 | class HolidayPluginIf:public QUnknownInterface |
17 | { | 17 | { |
18 | public: | 18 | public: |
19 | HolidayPluginIf():QUnknownInterface(){} | 19 | HolidayPluginIf():QUnknownInterface(){} |
20 | virtual ~HolidayPluginIf(){} | 20 | virtual ~HolidayPluginIf(){} |
21 | 21 | ||
22 | virtual HolidayPlugin*plugin()=0; | 22 | virtual HolidayPlugin*plugin()=0; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | template<class T> class HolidayPluginWrapper:public HolidayPluginIf | 25 | template<class T> class HolidayPluginWrapper:public HolidayPluginIf |
26 | { | 26 | { |
27 | public: | 27 | public: |
28 | HolidayPluginWrapper():HolidayPluginIf(),_plugin(0){} | 28 | HolidayPluginWrapper():HolidayPluginIf(),_plugin(0){} |
29 | virtual ~HolidayPluginWrapper(){if (_plugin) delete _plugin;} | 29 | virtual ~HolidayPluginWrapper(){if (_plugin) delete _plugin;} |
30 | 30 | ||
31 | QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) { | 31 | QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) { |
32 | odebug << "HolidayPluginWrapper::queryInterface()" << oendl; | ||
33 | *iface = 0; | 32 | *iface = 0; |
34 | if (uuid == IID_HOLIDAY_PLUGIN || uuid == IID_QUnknown) { | 33 | if (uuid == IID_HOLIDAY_PLUGIN || uuid == IID_QUnknown) { |
35 | *iface = this; | 34 | *iface = this; |
36 | } else { | 35 | } else { |
37 | return QS_FALSE; | 36 | return QS_FALSE; |
38 | } | 37 | } |
39 | if (*iface) (*iface)->addRef(); | 38 | if (*iface) (*iface)->addRef(); |
40 | return QS_OK; | 39 | return QS_OK; |
41 | } | 40 | } |
42 | 41 | ||
43 | // from qcom | 42 | // from qcom |
44 | Q_REFCOUNT | 43 | Q_REFCOUNT |
@@ -46,17 +45,16 @@ public: | |||
46 | virtual T*plugin() { | 45 | virtual T*plugin() { |
47 | if (!_plugin) {_plugin = new T();} | 46 | if (!_plugin) {_plugin = new T();} |
48 | return _plugin; | 47 | return _plugin; |
49 | } | 48 | } |
50 | protected: | 49 | protected: |
51 | T*_plugin; | 50 | T*_plugin; |
52 | }; | 51 | }; |
53 | 52 | ||
54 | #define EXPORT_HOLIDAY_PLUGIN( Plugin ) \ | 53 | #define EXPORT_HOLIDAY_PLUGIN( Plugin ) \ |
55 | Q_EXPORT_INTERFACE() { \ | 54 | Q_EXPORT_INTERFACE() { \ |
56 | Q_CREATE_INSTANCE( Opie::Datebook::HolidayPluginWrapper<Plugin> ) \ | 55 | Q_CREATE_INSTANCE( Opie::Datebook::HolidayPluginWrapper<Plugin> ) \ |
57 | } | 56 | } |
58 | |||
59 | } | 57 | } |
60 | } | 58 | } |
61 | #endif | 59 | #endif |
62 | 60 | ||