-rw-r--r-- | libopie2/opiepim/ui/oholidayplugin.h | 3 | ||||
-rw-r--r-- | libopie2/opiepim/ui/oholidaypluginif.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libopie2/opiepim/ui/oholidayplugin.h b/libopie2/opiepim/ui/oholidayplugin.h index 2e8c09e..52db0eb 100644 --- a/libopie2/opiepim/ui/oholidayplugin.h +++ b/libopie2/opiepim/ui/oholidayplugin.h | |||
@@ -1,26 +1,29 @@ | |||
1 | #ifndef _HOLIDAY_PLUGIN_H | 1 | #ifndef _HOLIDAY_PLUGIN_H |
2 | #define _HOLIDAY_PLUGIN_H | 2 | #define _HOLIDAY_PLUGIN_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qdatetime.h> | 6 | #include <qdatetime.h> |
7 | #include <qmap.h> | 7 | #include <qmap.h> |
8 | 8 | ||
9 | class EffectiveEvent; | ||
10 | |||
9 | namespace Opie { | 11 | namespace Opie { |
10 | namespace Datebook { | 12 | namespace Datebook { |
11 | 13 | ||
12 | class HolidayPlugin | 14 | class HolidayPlugin |
13 | { | 15 | { |
14 | public: | 16 | public: |
15 | HolidayPlugin(){}; | 17 | HolidayPlugin(){}; |
16 | virtual ~HolidayPlugin(){}; | 18 | virtual ~HolidayPlugin(){}; |
17 | virtual QString description()=0; | 19 | virtual QString description()=0; |
18 | virtual QStringList entries(const QDate&)=0; | 20 | virtual QStringList entries(const QDate&)=0; |
19 | virtual QStringList entries(unsigned year, unsigned month, unsigned day)=0; | 21 | virtual QStringList entries(unsigned year, unsigned month, unsigned day)=0; |
20 | virtual QMap<QDate,QStringList> entries(const QDate&,const QDate&)=0; | 22 | virtual QMap<QDate,QStringList> entries(const QDate&,const QDate&)=0; |
23 | virtual QValueList<EffectiveEvent> events(const QDate&,const QDate&)=0; | ||
21 | }; | 24 | }; |
22 | 25 | ||
23 | } | 26 | } |
24 | } | 27 | } |
25 | #endif | 28 | #endif |
26 | 29 | ||
diff --git a/libopie2/opiepim/ui/oholidaypluginif.h b/libopie2/opiepim/ui/oholidaypluginif.h index 99ed563..825d3ad 100644 --- a/libopie2/opiepim/ui/oholidaypluginif.h +++ b/libopie2/opiepim/ui/oholidaypluginif.h | |||
@@ -1,56 +1,56 @@ | |||
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 | //"b981b4e9-6d5d-4ee0-a193-f8d0e443809b" | 7 | //017f90d4-34fc-4dc5-aed7-498c6da6571e |
8 | #define IID_HOLIDAY_PLUGIN QUuid( 0xb981b4e9, 0x6d5d, 0x4ee0, 0xa1, 0x93,0xf8, 0xd0, 0xe4, 0x43, 0x80, 0x9b) | 8 | #define IID_HOLIDAY_PLUGIN QUuid(0x017f90d4,0x34fc,0x4dc5,0xae,0xd7,0x49,0x8c,0x6d,0xa6,0x57,0x1e) |
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; | 32 | odebug << "HolidayPluginWrapper::queryInterface()" << oendl; |
33 | *iface = 0; | 33 | *iface = 0; |
34 | if (uuid == IID_HOLIDAY_PLUGIN || uuid == IID_QUnknown) { | 34 | if (uuid == IID_HOLIDAY_PLUGIN || uuid == IID_QUnknown) { |
35 | *iface = this; | 35 | *iface = this; |
36 | } else { | 36 | } else { |
37 | return QS_FALSE; | 37 | return QS_FALSE; |
38 | } | 38 | } |
39 | if (*iface) (*iface)->addRef(); | 39 | if (*iface) (*iface)->addRef(); |
40 | return QS_OK; | 40 | return QS_OK; |
41 | } | 41 | } |
42 | 42 | ||
43 | // from qcom | 43 | // from qcom |
44 | Q_REFCOUNT | 44 | Q_REFCOUNT |
45 | 45 | ||
46 | virtual T*plugin() { | 46 | virtual T*plugin() { |
47 | if (!_plugin) {_plugin = new T();} | 47 | if (!_plugin) {_plugin = new T();} |
48 | return _plugin; | 48 | return _plugin; |
49 | } | 49 | } |
50 | protected: | 50 | protected: |
51 | T*_plugin; | 51 | T*_plugin; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #define EXPORT_HOLIDAY_PLUGIN( Plugin ) \ | 54 | #define EXPORT_HOLIDAY_PLUGIN( Plugin ) \ |
55 | Q_EXPORT_INTERFACE() { \ | 55 | Q_EXPORT_INTERFACE() { \ |
56 | Q_CREATE_INSTANCE( Opie::Datebook::HolidayPluginWrapper<Plugin> ) \ | 56 | Q_CREATE_INSTANCE( Opie::Datebook::HolidayPluginWrapper<Plugin> ) \ |