summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/mail
Unidiff
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 @@
1TEMPLATE = lib
2CONFIG -= moc
3CONFIG += qt debug
4
5# Input
6HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h
7SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp
8
9INCLUDEPATH += $(OPIEDIR)/include \
10 ../ ../library
11DEPENDPATH += $(OPIEDIR)/include \
12 ../ ../library
13
14LIBS+= -lqpe -lopie
15
16DESTDIR = $(OPIEDIR)/plugins/today
17TARGET = 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 @@
1/*
2 * mailplugin.cpp
3 *
4 * copyright : (c) 2002 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 "mailplugin.h"
19#include "mailpluginwidget.h"
20
21
22MailPlugin::MailPlugin() {
23}
24
25MailPlugin::~MailPlugin() {
26}
27
28QString MailPlugin::pluginName() const {
29 return "Mail plugin";
30}
31
32double MailPlugin::versionNumber() const {
33 return 0.1;
34}
35
36QString MailPlugin::pixmapNameWidget() const {
37 return "mail/desktopicon";
38}
39
40QWidget* MailPlugin::widget( QWidget * wid ) {
41 return new MailPluginWidget( wid, "Mail" );
42}
43
44QString MailPlugin::pixmapNameConfig() const {
45 return 0l;
46}
47
48QWidget* MailPlugin::configWidget( QWidget* wid ) {
49 return 0l;
50}
51
52QString MailPlugin::appName() const {
53 return "Mail";
54}
55
56int MailPlugin::minHeight() const {
57 return 10;
58}
59
60int MailPlugin::maxHeight() const {
61 return 10;
62}
63
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 @@
1/*
2 * mailplugin.h
3 *
4 * copyright : (c) 2002 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#ifndef MAIL_PLUGIN_H
19#define MAIL_PLUGIN_H
20
21#include <qstring.h>
22#include <qwidget.h>
23
24#include <opie/tododb.h>
25#include <opie/oclickablelabel.h>
26
27#include "../../todayplugininterface.h"
28
29class MailPlugin : public TodayPluginObject {
30
31public:
32 MailPlugin();
33 ~MailPlugin();
34
35 QString pluginName() const;
36 double versionNumber() const;
37 QString pixmapNameWidget() const;
38 QWidget* widget(QWidget *);
39 QString pixmapNameConfig() const;
40 QWidget* configWidget(QWidget *);
41 QString appName() const;
42 virtual int minHeight() const;
43 virtual int maxHeight() const;
44
45};
46
47#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 @@
1/*
2 * mailpluginimpl.cpp
3 *
4 * copyright : (c) 2002 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
19#include "mailplugin.h"
20#include "mailpluginimpl.h"
21
22MailPluginImpl::MailPluginImpl() {
23 mailPlugin = new MailPlugin();
24}
25
26MailPluginImpl::~MailPluginImpl() {
27}
28
29
30TodayPluginObject* MailPluginImpl::guiPart() {
31 return mailPlugin;
32}
33
34QRESULT MailPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
35 *iface = 0;
36 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
37 *iface = this, (*iface)->addRef();
38 }
39 return QS_OK;
40
41}
42
43Q_EXPORT_INTERFACE() {
44 Q_CREATE_INSTANCE( MailPluginImpl );
45}
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 @@
1/*
2 * mailpluginimpl.h
3 *
4 * copyright : (c) 2002 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#ifndef MAIL_PLUGIN_IMPL_H
18#define MAIL_PLUGIN_IMPL_H
19
20#include "../../todayplugininterface.h"
21
22class MailPlugin;
23
24class MailPluginImpl : public TodayPluginInterface{
25
26public:
27 MailPluginImpl();
28 virtual ~MailPluginImpl();
29
30 QRESULT queryInterface( const QUuid &, QUnknownInterface** );
31 Q_REFCOUNT
32
33 virtual TodayPluginObject *guiPart();
34
35private:
36 MailPlugin *mailPlugin;
37 ulong ref;
38};
39
40#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 @@
1/*
2 * mailpluginwidget.cpp
3 *
4 * copyright : (c) 2002 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 <qvaluelist.h>
19#include <qtl.h>
20#include <qstring.h>
21#include <qobject.h>
22#include <qlayout.h>
23
24#include <qpe/config.h>
25#include <qpe/timestring.h>
26#include <qpe/qcopenvelope_qws.h>
27
28#include "mailpluginwidget.h"
29
30MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name)
31 : QWidget(parent, name ) {
32
33 readConfig();
34 getInfo();
35}
36
37MailPluginWidget::~MailPluginWidget() {
38}
39
40
41void MailPluginWidget::readConfig() {
42 Config cfg( "todaymailplugin" );
43 cfg.setGroup( "config" );
44}
45
46
47void MailPluginWidget::getInfo() {
48
49 QHBoxLayout* layout = new QHBoxLayout( this );
50
51 mailLabel = new OClickableLabel( this );
52 mailLabel->setMaximumHeight( 15 );
53 connect( mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) );
54
55 Config cfg( "opiemail" );
56 cfg.setGroup( "today" );
57
58 int NEW_MAILS = cfg.readNumEntry( "newmails", 0 );
59 int OUTGOING = cfg.readNumEntry( "outgoing", 0 );
60
61 QString output = QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING );
62
63 mailLabel->setText( output );
64 layout->addWidget( mailLabel );
65}
66
67/**
68 * launches datebook
69 */
70void MailPluginWidget::startMail() {
71 QCopEnvelope e("QPE/System", "execute(QString)");
72 e << QString( "mail" );
73}
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 @@
1/*
2 * mailpluginwidget.h
3 *
4 * copyright : (c) 2002 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#ifndef MAIL_PLUGIN_WIDGET_H
19#define MAIL_PLUGIN_WIDGET_H
20
21#include <qstring.h>
22#include <qwidget.h>
23
24#include <opie/tododb.h>
25#include <opie/oclickablelabel.h>
26
27class MailPluginWidget : public QWidget {
28
29 Q_OBJECT
30
31
32public:
33 MailPluginWidget( QWidget *parent, const char *name );
34 ~MailPluginWidget();
35
36protected slots:
37 void startMail();
38
39private:
40 OClickableLabel *mailLabel;
41 void readConfig();
42 void getInfo();
43};
44
45#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 @@
1Files: $OPIEDIR/lib/today/libtodaymailplugin.so*
2Priority: optional
3Section: opie/applications
4Maintainer: Maximilian Reiss <harlekin@handhelds.org>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION
7Depends: qt-embedded (>=$QTE_VERSION)
8Description: Mail plugin for today