author | harlekin <harlekin> | 2004-02-03 22:25:41 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-02-03 22:25:41 (UTC) |
commit | 8a796b594669c54a34b2e416ff0d931aaa3cc76d (patch) (unidiff) | |
tree | 9e8465a881932a2c3da9ca9018bb2fcbc346b163 /examples/todayplugin/exampleplugin.cpp | |
parent | ca3580f98de6e68cc595234859691df997b60a98 (diff) | |
download | opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.zip opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.gz opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.bz2 |
today example plugin
Diffstat (limited to 'examples/todayplugin/exampleplugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | examples/todayplugin/exampleplugin.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/examples/todayplugin/exampleplugin.cpp b/examples/todayplugin/exampleplugin.cpp new file mode 100644 index 0000000..e5d75df --- a/dev/null +++ b/examples/todayplugin/exampleplugin.cpp | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * exampleplugin.cpp | ||
3 | * | ||
4 | * copyright : (c) 2002,2003,2004 by Maximilian Reiß | ||
5 | * email : harlekin@handhelds.org | ||
6 | * | ||
7 | */ | ||
8 | /*************************************************************************** | ||
9 | * * | ||
10 | * This program is free software; you can redistribute it and/or modify * | ||
11 | * it under the terms of the GNU General Public License as published by * | ||
12 | * the Free Software Foundation; either version 2 of the License, or * | ||
13 | * (at your option) any later version. * | ||
14 | * * | ||
15 | ***************************************************************************/ | ||
16 | |||
17 | |||
18 | #include "exampleplugin.h" | ||
19 | |||
20 | ExamplePlugin::ExamplePlugin() { | ||
21 | m_widget = 0l; | ||
22 | } | ||
23 | |||
24 | ExamplePlugin::~ExamplePlugin() { | ||
25 | delete (ExamplePluginWidget*)m_widget; | ||
26 | } | ||
27 | |||
28 | QString ExamplePlugin::pluginName() const { | ||
29 | return QObject::tr( "Example plugin" ); | ||
30 | } | ||
31 | |||
32 | double ExamplePlugin::versionNumber() const { | ||
33 | return 0.1; | ||
34 | } | ||
35 | |||
36 | // this sets the image that will be shown on the left side of the plugin | ||
37 | QString ExamplePlugin::pixmapNameWidget() const { | ||
38 | return "Tux"; | ||
39 | } | ||
40 | |||
41 | QWidget* ExamplePlugin::widget( QWidget * wid ) { | ||
42 | if(!m_widget) { | ||
43 | m_widget = new ExamplePluginWidget( wid, "Example" ); | ||
44 | } | ||
45 | return m_widget; | ||
46 | } | ||
47 | |||
48 | |||
49 | // that would be the icon of the config widget in todays config view | ||
50 | QString ExamplePlugin::pixmapNameConfig() const { | ||
51 | return 0l; | ||
52 | } | ||
53 | |||
54 | // No config widget yet, look at the datebook plugin for an example of that | ||
55 | TodayConfigWidget* ExamplePlugin::configWidget( QWidget* ) { | ||
56 | return 0l; | ||
57 | } | ||
58 | |||
59 | // add the binary name of the app to launch here | ||
60 | QString ExamplePlugin::appName() const { | ||
61 | return ""; | ||
62 | } | ||
63 | |||
64 | // if the plugin should be excluded form the refresh cycles that can be set in the today app | ||
65 | bool ExamplePlugin::excludeFromRefresh() const { | ||
66 | return false; | ||
67 | } | ||
68 | |||
69 | void ExamplePlugin::refresh() { | ||
70 | if ( m_widget ) { | ||
71 | m_widget->refresh(); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | void ExamplePlugin::reinitialize() { | ||
76 | } | ||