summaryrefslogtreecommitdiff
path: root/examples/todayplugin/exampleplugin.cpp
Unidiff
Diffstat (limited to 'examples/todayplugin/exampleplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/todayplugin/exampleplugin.cpp76
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
20ExamplePlugin::ExamplePlugin() {
21 m_widget = 0l;
22}
23
24ExamplePlugin::~ExamplePlugin() {
25 delete (ExamplePluginWidget*)m_widget;
26}
27
28QString ExamplePlugin::pluginName() const {
29 return QObject::tr( "Example plugin" );
30}
31
32double 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
37QString ExamplePlugin::pixmapNameWidget() const {
38 return "Tux";
39}
40
41QWidget* 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
50QString ExamplePlugin::pixmapNameConfig() const {
51 return 0l;
52}
53
54// No config widget yet, look at the datebook plugin for an example of that
55TodayConfigWidget* ExamplePlugin::configWidget( QWidget* ) {
56 return 0l;
57}
58
59// add the binary name of the app to launch here
60QString 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
65bool ExamplePlugin::excludeFromRefresh() const {
66 return false;
67}
68
69void ExamplePlugin::refresh() {
70 if ( m_widget ) {
71 m_widget->refresh();
72 }
73}
74
75void ExamplePlugin::reinitialize() {
76}