summaryrefslogtreecommitdiff
path: root/examples/todayplugin/examplepluginwidget.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/examplepluginwidget.cpp
parentca3580f98de6e68cc595234859691df997b60a98 (diff)
downloadopie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.zip
opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.gz
opie-8a796b594669c54a34b2e416ff0d931aaa3cc76d.tar.bz2
today example plugin
Diffstat (limited to 'examples/todayplugin/examplepluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/todayplugin/examplepluginwidget.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/examples/todayplugin/examplepluginwidget.cpp b/examples/todayplugin/examplepluginwidget.cpp
new file mode 100644
index 0000000..14f1020
--- a/dev/null
+++ b/examples/todayplugin/examplepluginwidget.cpp
@@ -0,0 +1,71 @@
+/*
+ * examplepluginwidget.cpp
+ *
+ * copyright : (c) 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 <qpe/config.h>
+#include <qpe/qcopenvelope_qws.h>
+
+#include "examplepluginwidget.h"
+
+ExamplePluginWidget::ExamplePluginWidget( QWidget *parent, const char* name)
+ : QWidget(parent, name ) {
+
+ m_exampleLabel = 0l;
+ m_layout = 0l;
+
+ if ( m_exampleLabel ) {
+ delete m_exampleLabel;
+ }
+
+ // since here a OClickableLabel is used, the plugin part will be clickable, and the actions
+ // that should be triggered when clicked are defined in slotClicked()
+ // of course also normal widgets can be used.
+ m_exampleLabel = new OClickableLabel( this );
+ connect( m_exampleLabel, SIGNAL( clicked() ), this, SLOT( slotClicked() ) );
+
+ if ( m_layout ) {
+ delete m_layout;
+ }
+ m_layout = new QHBoxLayout( this );
+ m_layout->setAutoAdd( true );
+
+ readConfig();
+ getInfo();
+}
+
+
+ExamplePluginWidget::~ExamplePluginWidget() {
+ delete m_exampleLabel;
+ delete m_layout;
+}
+
+
+void ExamplePluginWidget::readConfig() {
+// we dont have any config entries in this plugin
+// normally this method is used after today config was used
+}
+
+
+void ExamplePluginWidget::refresh() {
+
+}
+
+void ExamplePluginWidget::getInfo() {
+ m_exampleLabel->setText( "Example text" );
+}
+
+void ExamplePluginWidget::slotClicked() {
+ getInfo();
+}