Diffstat (limited to 'libopie/todayplugininterface.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/todayplugininterface.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/libopie/todayplugininterface.h b/libopie/todayplugininterface.h index 6ee2a06..29a12bc 100644 --- a/libopie/todayplugininterface.h +++ b/libopie/todayplugininterface.h | |||
@@ -5,64 +5,79 @@ | |||
5 | #include <qpe/qcom.h> | 5 | #include <qpe/qcom.h> |
6 | #include "todayconfigwidget.h" | 6 | #include "todayconfigwidget.h" |
7 | 7 | ||
8 | class QString; | 8 | class QString; |
9 | class QWidget; | 9 | class QWidget; |
10 | 10 | ||
11 | #ifndef IID_TodayPluginInterface | 11 | #ifndef IID_TodayPluginInterface |
12 | #define IID_TodayPluginInterface QUuid( 0x70481804, 0x2b50, 0x4fba, 0x80, 0xbb, 0x0b, 0xf8, 0xdc, 0x72, 0x04, 0x14) | 12 | #define IID_TodayPluginInterface QUuid( 0x70481804, 0x2b50, 0x4fba, 0x80, 0xbb, 0x0b, 0xf8, 0xdc, 0x72, 0x04, 0x14) |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | /** | 15 | /** |
16 | * | 16 | * |
17 | * A TodayPluginObject is the base for all Today Plugins. | ||
18 | * A plugin author needs to inherit this class and implement | ||
19 | * the pure virtual methods | ||
17 | * | 20 | * |
21 | * @short base class for today plugins | ||
22 | * @author Maximilian Reiss | ||
18 | * | 23 | * |
19 | */ | 24 | */ |
20 | class TodayPluginObject { | 25 | class TodayPluginObject { |
21 | 26 | ||
22 | public: | 27 | public: |
23 | 28 | ||
24 | virtual ~TodayPluginObject() {}; | 29 | virtual ~TodayPluginObject() {}; |
25 | 30 | ||
26 | /** | 31 | /** |
27 | * The name if the plugin | 32 | * The name if the plugin |
33 | * @return The plugin should return its name here | ||
28 | */ | 34 | */ |
29 | virtual QString pluginName() const = 0; | 35 | virtual QString pluginName() const = 0; |
30 | 36 | ||
31 | /** | 37 | /** |
32 | * Version numbering | 38 | * Version numbering |
39 | * @return The plugin should return the version number | ||
33 | */ | 40 | */ |
34 | virtual double versionNumber() const = 0; | 41 | virtual double versionNumber() const = 0; |
35 | 42 | ||
36 | 43 | ||
44 | /** | ||
45 | * @return the pixmap name widget?! -- FIXME | ||
46 | */ | ||
37 | virtual QString pixmapNameWidget() const = 0; | 47 | virtual QString pixmapNameWidget() const = 0; |
38 | 48 | ||
39 | /** widget for the today view | 49 | /** |
50 | * widget for the today view | ||
40 | * It _needs_ a parent here. | 51 | * It _needs_ a parent here. |
52 | * Plugin authors need to take parent as parent! | ||
41 | */ | 53 | */ |
42 | virtual QWidget* widget( QWidget * ) = 0; | 54 | virtual QWidget* widget( QWidget *parent ) = 0; |
43 | 55 | ||
44 | /** | 56 | /** |
45 | * Pixmap used in the config widget | 57 | * Pixmap used in the config widget |
46 | */ | 58 | */ |
47 | virtual QString pixmapNameConfig() const = 0; | 59 | virtual QString pixmapNameConfig() const = 0; |
48 | 60 | ||
49 | /** | 61 | /** |
50 | * Config plugin widget - optional | 62 | * Config plugin widget - optional |
51 | * If the plugin has a config widget, it _needs_ a parent here. | 63 | * If the plugin has a config widget, it _needs_ a parent here. |
64 | * may return 0 if no config widget is needed | ||
52 | */ | 65 | */ |
53 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; | 66 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; |
54 | 67 | ||
55 | /** | 68 | /** |
56 | * The application that should be assigned to the button (pixmap) | 69 | * The application that should be assigned to the button (pixmap) |
70 | * Today will show the plugin icon. On click it tries to execute the | ||
71 | * plugin related application. | ||
57 | */ | 72 | */ |
58 | virtual QString appName() const = 0; | 73 | virtual QString appName() const = 0; |
59 | 74 | ||
60 | 75 | ||
61 | /** | 76 | /** |
62 | * If the plugin should take part in the periodic refresh | 77 | * If the plugin should take part in the periodic refresh |
63 | */ | 78 | */ |
64 | virtual bool excludeFromRefresh() const = 0; | 79 | virtual bool excludeFromRefresh() const = 0; |
65 | 80 | ||
66 | /** | 81 | /** |
67 | * Refresh that plugins view. For updating the plugins | 82 | * Refresh that plugins view. For updating the plugins |
68 | * | 83 | * |
@@ -72,18 +87,20 @@ public: | |||
72 | /** | 87 | /** |
73 | * minimum height the plugin at least should have | 88 | * minimum height the plugin at least should have |
74 | */ | 89 | */ |
75 | // virtual int minHeight() const = 0; | 90 | // virtual int minHeight() const = 0; |
76 | 91 | ||
77 | /** | 92 | /** |
78 | * maximum height that should be used before starting scrolling | 93 | * maximum height that should be used before starting scrolling |
79 | */ | 94 | */ |
80 | // virtual int maxHeight() const = 0; | 95 | // virtual int maxHeight() const = 0; |
81 | 96 | ||
82 | }; | 97 | }; |
83 | 98 | ||
84 | 99 | /** | |
100 | * This is part of the QCOM works. See example plugins how to do it right | ||
101 | */ | ||
85 | struct TodayPluginInterface : public QUnknownInterface { | 102 | struct TodayPluginInterface : public QUnknownInterface { |
86 | virtual TodayPluginObject *guiPart() = 0; | 103 | virtual TodayPluginObject *guiPart() = 0; |
87 | }; | 104 | }; |
88 | 105 | ||
89 | #endif | 106 | #endif |