summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/mail
Side-by-side diff
Diffstat (limited to 'core/pim/today/plugins/mail') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/plugins/mail/mail.pro17
-rw-r--r--core/pim/today/plugins/mail/mailplugin.cpp63
-rw-r--r--core/pim/today/plugins/mail/mailplugin.h47
-rw-r--r--core/pim/today/plugins/mail/mailpluginimpl.cpp45
-rw-r--r--core/pim/today/plugins/mail/mailpluginimpl.h40
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.cpp73
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.h45
-rw-r--r--core/pim/today/plugins/mail/opie-today-todolistplugin.control8
8 files changed, 338 insertions, 0 deletions
diff --git a/core/pim/today/plugins/mail/mail.pro b/core/pim/today/plugins/mail/mail.pro
new file mode 100644
index 0000000..58bda54
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mail.pro
@@ -0,0 +1,17 @@
+TEMPLATE = lib
+CONFIG -= moc
+CONFIG += qt debug
+
+# Input
+HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h
+SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp
+
+INCLUDEPATH += $(OPIEDIR)/include \
+ ../ ../library
+DEPENDPATH += $(OPIEDIR)/include \
+ ../ ../library
+
+LIBS+= -lqpe -lopie
+
+DESTDIR = $(OPIEDIR)/plugins/today
+TARGET = todaymailplugin \ No newline at end of file
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp
new file mode 100644
index 0000000..a594361
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailplugin.cpp
@@ -0,0 +1,63 @@
+/*
+ * mailplugin.cpp
+ *
+ * copyright : (c) 2002 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 "mailplugin.h"
+#include "mailpluginwidget.h"
+
+
+MailPlugin::MailPlugin() {
+}
+
+MailPlugin::~MailPlugin() {
+}
+
+QString MailPlugin::pluginName() const {
+ return "Mail plugin";
+}
+
+double MailPlugin::versionNumber() const {
+ return 0.1;
+}
+
+QString MailPlugin::pixmapNameWidget() const {
+ return "mail/desktopicon";
+}
+
+QWidget* MailPlugin::widget( QWidget * wid ) {
+ return new MailPluginWidget( wid, "Mail" );
+}
+
+QString MailPlugin::pixmapNameConfig() const {
+ return 0l;
+}
+
+QWidget* MailPlugin::configWidget( QWidget* wid ) {
+ return 0l;
+}
+
+QString MailPlugin::appName() const {
+ return "Mail";
+}
+
+int MailPlugin::minHeight() const {
+ return 10;
+}
+
+int MailPlugin::maxHeight() const {
+ return 10;
+}
+
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h
new file mode 100644
index 0000000..113102e
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailplugin.h
@@ -0,0 +1,47 @@
+/*
+ * mailplugin.h
+ *
+ * copyright : (c) 2002 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. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef MAIL_PLUGIN_H
+#define MAIL_PLUGIN_H
+
+#include <qstring.h>
+#include <qwidget.h>
+
+#include <opie/tododb.h>
+#include <opie/oclickablelabel.h>
+
+#include "../../todayplugininterface.h"
+
+class MailPlugin : public TodayPluginObject {
+
+public:
+ MailPlugin();
+ ~MailPlugin();
+
+ QString pluginName() const;
+ double versionNumber() const;
+ QString pixmapNameWidget() const;
+ QWidget* widget(QWidget *);
+ QString pixmapNameConfig() const;
+ QWidget* configWidget(QWidget *);
+ QString appName() const;
+ virtual int minHeight() const;
+ virtual int maxHeight() const;
+
+};
+
+#endif
diff --git a/core/pim/today/plugins/mail/mailpluginimpl.cpp b/core/pim/today/plugins/mail/mailpluginimpl.cpp
new file mode 100644
index 0000000..e5a1e05
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailpluginimpl.cpp
@@ -0,0 +1,45 @@
+/*
+ * mailpluginimpl.cpp
+ *
+ * copyright : (c) 2002 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 "mailplugin.h"
+#include "mailpluginimpl.h"
+
+MailPluginImpl::MailPluginImpl() {
+ mailPlugin = new MailPlugin();
+}
+
+MailPluginImpl::~MailPluginImpl() {
+}
+
+
+TodayPluginObject* MailPluginImpl::guiPart() {
+ return mailPlugin;
+}
+
+QRESULT MailPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
+ *iface = 0;
+ if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
+ *iface = this, (*iface)->addRef();
+ }
+ return QS_OK;
+
+}
+
+Q_EXPORT_INTERFACE() {
+ Q_CREATE_INSTANCE( MailPluginImpl );
+}
diff --git a/core/pim/today/plugins/mail/mailpluginimpl.h b/core/pim/today/plugins/mail/mailpluginimpl.h
new file mode 100644
index 0000000..9930e6e
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailpluginimpl.h
@@ -0,0 +1,40 @@
+/*
+ * mailpluginimpl.h
+ *
+ * copyright : (c) 2002 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef MAIL_PLUGIN_IMPL_H
+#define MAIL_PLUGIN_IMPL_H
+
+#include "../../todayplugininterface.h"
+
+class MailPlugin;
+
+class MailPluginImpl : public TodayPluginInterface{
+
+public:
+ MailPluginImpl();
+ virtual ~MailPluginImpl();
+
+ QRESULT queryInterface( const QUuid &, QUnknownInterface** );
+ Q_REFCOUNT
+
+ virtual TodayPluginObject *guiPart();
+
+private:
+ MailPlugin *mailPlugin;
+ ulong ref;
+};
+
+#endif
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp
new file mode 100644
index 0000000..a6f3562
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp
@@ -0,0 +1,73 @@
+/*
+ * mailpluginwidget.cpp
+ *
+ * copyright : (c) 2002 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 <qvaluelist.h>
+#include <qtl.h>
+#include <qstring.h>
+#include <qobject.h>
+#include <qlayout.h>
+
+#include <qpe/config.h>
+#include <qpe/timestring.h>
+#include <qpe/qcopenvelope_qws.h>
+
+#include "mailpluginwidget.h"
+
+MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name)
+ : QWidget(parent, name ) {
+
+ readConfig();
+ getInfo();
+}
+
+MailPluginWidget::~MailPluginWidget() {
+}
+
+
+void MailPluginWidget::readConfig() {
+ Config cfg( "todaymailplugin" );
+ cfg.setGroup( "config" );
+}
+
+
+void MailPluginWidget::getInfo() {
+
+ QHBoxLayout* layout = new QHBoxLayout( this );
+
+ mailLabel = new OClickableLabel( this );
+ mailLabel->setMaximumHeight( 15 );
+ connect( mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) );
+
+ Config cfg( "opiemail" );
+ cfg.setGroup( "today" );
+
+ int NEW_MAILS = cfg.readNumEntry( "newmails", 0 );
+ int OUTGOING = cfg.readNumEntry( "outgoing", 0 );
+
+ QString output = QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING );
+
+ mailLabel->setText( output );
+ layout->addWidget( mailLabel );
+}
+
+/**
+ * launches datebook
+ */
+void MailPluginWidget::startMail() {
+ QCopEnvelope e("QPE/System", "execute(QString)");
+ e << QString( "mail" );
+}
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.h b/core/pim/today/plugins/mail/mailpluginwidget.h
new file mode 100644
index 0000000..2feef80
--- a/dev/null
+++ b/core/pim/today/plugins/mail/mailpluginwidget.h
@@ -0,0 +1,45 @@
+/*
+ * mailpluginwidget.h
+ *
+ * copyright : (c) 2002 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. *
+ * *
+ ***************************************************************************/
+
+
+#ifndef MAIL_PLUGIN_WIDGET_H
+#define MAIL_PLUGIN_WIDGET_H
+
+#include <qstring.h>
+#include <qwidget.h>
+
+#include <opie/tododb.h>
+#include <opie/oclickablelabel.h>
+
+class MailPluginWidget : public QWidget {
+
+ Q_OBJECT
+
+
+public:
+ MailPluginWidget( QWidget *parent, const char *name );
+ ~MailPluginWidget();
+
+protected slots:
+ void startMail();
+
+private:
+ OClickableLabel *mailLabel;
+ void readConfig();
+ void getInfo();
+};
+
+#endif
diff --git a/core/pim/today/plugins/mail/opie-today-todolistplugin.control b/core/pim/today/plugins/mail/opie-today-todolistplugin.control
new file mode 100644
index 0000000..7fb8cbf
--- a/dev/null
+++ b/core/pim/today/plugins/mail/opie-today-todolistplugin.control
@@ -0,0 +1,8 @@
+Files: $OPIEDIR/lib/today/libtodaymailplugin.so*
+Priority: optional
+Section: opie/applications
+Maintainer: Maximilian Reiss <harlekin@handhelds.org>
+Architecture: arm
+Version: $QPE_VERSION-$SUB_VERSION
+Depends: qt-embedded (>=$QTE_VERSION)
+Description: Mail plugin for today