-rw-r--r-- | core/pim/today/plugins/mail/mail.pro | 17 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.cpp | 63 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.h | 47 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginimpl.cpp | 45 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginimpl.h | 40 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginwidget.cpp | 73 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginwidget.h | 45 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/opie-today-todolistplugin.control | 8 |
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 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG -= moc | ||
3 | CONFIG += qt debug | ||
4 | |||
5 | # Input | ||
6 | HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h | ||
7 | SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp | ||
8 | |||
9 | INCLUDEPATH += $(OPIEDIR)/include \ | ||
10 | ../ ../library | ||
11 | DEPENDPATH += $(OPIEDIR)/include \ | ||
12 | ../ ../library | ||
13 | |||
14 | LIBS+= -lqpe -lopie | ||
15 | |||
16 | DESTDIR = $(OPIEDIR)/plugins/today | ||
17 | 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 @@ | |||
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 | |||
22 | MailPlugin::MailPlugin() { | ||
23 | } | ||
24 | |||
25 | MailPlugin::~MailPlugin() { | ||
26 | } | ||
27 | |||
28 | QString MailPlugin::pluginName() const { | ||
29 | return "Mail plugin"; | ||
30 | } | ||
31 | |||
32 | double MailPlugin::versionNumber() const { | ||
33 | return 0.1; | ||
34 | } | ||
35 | |||
36 | QString MailPlugin::pixmapNameWidget() const { | ||
37 | return "mail/desktopicon"; | ||
38 | } | ||
39 | |||
40 | QWidget* MailPlugin::widget( QWidget * wid ) { | ||
41 | return new MailPluginWidget( wid, "Mail" ); | ||
42 | } | ||
43 | |||
44 | QString MailPlugin::pixmapNameConfig() const { | ||
45 | return 0l; | ||
46 | } | ||
47 | |||
48 | QWidget* MailPlugin::configWidget( QWidget* wid ) { | ||
49 | return 0l; | ||
50 | } | ||
51 | |||
52 | QString MailPlugin::appName() const { | ||
53 | return "Mail"; | ||
54 | } | ||
55 | |||
56 | int MailPlugin::minHeight() const { | ||
57 | return 10; | ||
58 | } | ||
59 | |||
60 | int 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 | |||
29 | class MailPlugin : public TodayPluginObject { | ||
30 | |||
31 | public: | ||
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 | |||
22 | MailPluginImpl::MailPluginImpl() { | ||
23 | mailPlugin = new MailPlugin(); | ||
24 | } | ||
25 | |||
26 | MailPluginImpl::~MailPluginImpl() { | ||
27 | } | ||
28 | |||
29 | |||
30 | TodayPluginObject* MailPluginImpl::guiPart() { | ||
31 | return mailPlugin; | ||
32 | } | ||
33 | |||
34 | QRESULT 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 | |||
43 | Q_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 | |||
22 | class MailPlugin; | ||
23 | |||
24 | class MailPluginImpl : public TodayPluginInterface{ | ||
25 | |||
26 | public: | ||
27 | MailPluginImpl(); | ||
28 | virtual ~MailPluginImpl(); | ||
29 | |||
30 | QRESULT queryInterface( const QUuid &, QUnknownInterface** ); | ||
31 | Q_REFCOUNT | ||
32 | |||
33 | virtual TodayPluginObject *guiPart(); | ||
34 | |||
35 | private: | ||
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 | |||
30 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) | ||
31 | : QWidget(parent, name ) { | ||
32 | |||
33 | readConfig(); | ||
34 | getInfo(); | ||
35 | } | ||
36 | |||
37 | MailPluginWidget::~MailPluginWidget() { | ||
38 | } | ||
39 | |||
40 | |||
41 | void MailPluginWidget::readConfig() { | ||
42 | Config cfg( "todaymailplugin" ); | ||
43 | cfg.setGroup( "config" ); | ||
44 | } | ||
45 | |||
46 | |||
47 | void 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 | */ | ||
70 | void 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 | |||
27 | class MailPluginWidget : public QWidget { | ||
28 | |||
29 | Q_OBJECT | ||
30 | |||
31 | |||
32 | public: | ||
33 | MailPluginWidget( QWidget *parent, const char *name ); | ||
34 | ~MailPluginWidget(); | ||
35 | |||
36 | protected slots: | ||
37 | void startMail(); | ||
38 | |||
39 | private: | ||
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 @@ | |||
1 | Files: $OPIEDIR/lib/today/libtodaymailplugin.so* | ||
2 | Priority: optional | ||
3 | Section: opie/applications | ||
4 | Maintainer: Maximilian Reiss <harlekin@handhelds.org> | ||
5 | Architecture: arm | ||
6 | Version: $QPE_VERSION-$SUB_VERSION | ||
7 | Depends: qt-embedded (>=$QTE_VERSION) | ||
8 | Description: Mail plugin for today | ||