summaryrefslogtreecommitdiff
path: root/examples/todayplugin/exampleplugin.cpp
authorharlekin <harlekin>2004-02-03 22:25:41 (UTC)
committer harlekin <harlekin>2004-02-03 22:25:41 (UTC)
commit8a796b594669c54a34b2e416ff0d931aaa3cc76d (patch) (side-by-side diff)
tree9e8465a881932a2c3da9ca9018bb2fcbc346b163 /examples/todayplugin/exampleplugin.cpp
parentca3580f98de6e68cc595234859691df997b60a98 (diff)
downloadopie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.zip
opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.gz
opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.bz2
today example plugin
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 @@
+/*
+ * exampleplugin.cpp
+ *
+ * copyright : (c) 2002,2003,2004 by Maximilian Reiß
+ * email : harlekin@handhelds.org
+ *
+ */
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include "exampleplugin.h"
+
+ExamplePlugin::ExamplePlugin() {
+ m_widget = 0l;
+}
+
+ExamplePlugin::~ExamplePlugin() {
+ delete (ExamplePluginWidget*)m_widget;
+}
+
+QString ExamplePlugin::pluginName() const {
+ return QObject::tr( "Example plugin" );
+}
+
+double ExamplePlugin::versionNumber() const {
+ return 0.1;
+}
+
+// this sets the image that will be shown on the left side of the plugin
+QString ExamplePlugin::pixmapNameWidget() const {
+ return "Tux";
+}
+
+QWidget* ExamplePlugin::widget( QWidget * wid ) {
+ if(!m_widget) {
+ m_widget = new ExamplePluginWidget( wid, "Example" );
+ }
+ return m_widget;
+}
+
+
+// that would be the icon of the config widget in todays config view
+QString ExamplePlugin::pixmapNameConfig() const {
+ return 0l;
+}
+
+// No config widget yet, look at the datebook plugin for an example of that
+TodayConfigWidget* ExamplePlugin::configWidget( QWidget* ) {
+ return 0l;
+}
+
+// add the binary name of the app to launch here
+QString ExamplePlugin::appName() const {
+ return "";
+}
+
+// if the plugin should be excluded form the refresh cycles that can be set in the today app
+bool ExamplePlugin::excludeFromRefresh() const {
+ return false;
+}
+
+void ExamplePlugin::refresh() {
+ if ( m_widget ) {
+ m_widget->refresh();
+ }
+}
+
+void ExamplePlugin::reinitialize() {
+}