author | harlekin <harlekin> | 2002-09-22 22:29:34 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-22 22:29:34 (UTC) |
commit | a26d188b7b91f9bdce1e6a44c40ce874cd50abde (patch) (unidiff) | |
tree | 26a7efeca0a0778d3a96f876cb030dd414a177be /core | |
parent | e49230a12104b718c46a34c81b6c0e608c9d40be (diff) | |
download | opie-a26d188b7b91f9bdce1e6a44c40ce874cd50abde.zip opie-a26d188b7b91f9bdce1e6a44c40ce874cd50abde.tar.gz opie-a26d188b7b91f9bdce1e6a44c40ce874cd50abde.tar.bz2 |
interface updates
-rw-r--r-- | core/pim/today/configwidget.h | 17 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.cpp | 10 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookplugin.h | 4 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginconfig.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginconfig.h | 6 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.cpp | 11 | ||||
-rw-r--r-- | core/pim/today/plugins/mail/mailplugin.h | 7 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 9 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.h | 5 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginconfig.h | 4 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 11 | ||||
-rw-r--r-- | core/pim/today/todayconfigwidget.h | 21 | ||||
-rw-r--r-- | core/pim/today/todayplugininterface.h | 13 |
14 files changed, 49 insertions, 73 deletions
diff --git a/core/pim/today/configwidget.h b/core/pim/today/configwidget.h deleted file mode 100644 index 02ce37a..0000000 --- a/core/pim/today/configwidget.h +++ b/dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | |||
2 | #ifndef CONFIG_WIDGET_H | ||
3 | #define CONFIG_WIDGET_H | ||
4 | |||
5 | |||
6 | class ConfigWidget : public QWidget { | ||
7 | |||
8 | |||
9 | public: | ||
10 | |||
11 | ConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {} ; | ||
12 | virtual ~ConfigWidget() {}; | ||
13 | |||
14 | virtual void writeConfig() = 0; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp index a1721f6..4ebb178 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.cpp +++ b/core/pim/today/plugins/datebook/datebookplugin.cpp | |||
@@ -28,40 +28,32 @@ DatebookPlugin::DatebookPlugin() { | |||
28 | 28 | ||
29 | DatebookPlugin::~DatebookPlugin() { | 29 | DatebookPlugin::~DatebookPlugin() { |
30 | } | 30 | } |
31 | 31 | ||
32 | QString DatebookPlugin::pluginName() const { | 32 | QString DatebookPlugin::pluginName() const { |
33 | return "Datebook plugin"; | 33 | return "Datebook plugin"; |
34 | } | 34 | } |
35 | 35 | ||
36 | double DatebookPlugin::versionNumber() const { | 36 | double DatebookPlugin::versionNumber() const { |
37 | return 1.0; | 37 | return 1.0; |
38 | } | 38 | } |
39 | 39 | ||
40 | QString DatebookPlugin::pixmapNameWidget() const { | 40 | QString DatebookPlugin::pixmapNameWidget() const { |
41 | return "DateBook"; | 41 | return "DateBook"; |
42 | } | 42 | } |
43 | 43 | ||
44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { | 44 | QWidget* DatebookPlugin::widget( QWidget* wid ) { |
45 | return new DatebookPluginWidget( wid, "Datebook" ); | 45 | return new DatebookPluginWidget( wid, "Datebook" ); |
46 | } | 46 | } |
47 | 47 | ||
48 | QString DatebookPlugin::pixmapNameConfig() const { | 48 | QString DatebookPlugin::pixmapNameConfig() const { |
49 | return "DateBook"; | 49 | return "DateBook"; |
50 | } | 50 | } |
51 | 51 | ||
52 | ConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { | 52 | TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) { |
53 | return new DatebookPluginConfig( wid , "Datebook" ); | 53 | return new DatebookPluginConfig( wid , "Datebook" ); |
54 | } | 54 | } |
55 | 55 | ||
56 | QString DatebookPlugin::appName() const { | 56 | QString DatebookPlugin::appName() const { |
57 | return QObject::tr( "Datebook" ); | 57 | return QObject::tr( "Datebook" ); |
58 | } | 58 | } |
59 | 59 | ||
60 | int DatebookPlugin::minHeight() const { | ||
61 | return 10; | ||
62 | } | ||
63 | |||
64 | int DatebookPlugin::maxHeight() const { | ||
65 | return 100; | ||
66 | } | ||
67 | |||
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h index 61dc9f3..625c7cd 100644 --- a/core/pim/today/plugins/datebook/datebookplugin.h +++ b/core/pim/today/plugins/datebook/datebookplugin.h | |||
@@ -14,33 +14,31 @@ | |||
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef DATEBOOK_PLUGIN_H | 17 | #ifndef DATEBOOK_PLUGIN_H |
18 | #define DATEBOOK_PLUGIN_H | 18 | #define DATEBOOK_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | 22 | ||
23 | #include <opie/oclickablelabel.h> | 23 | #include <opie/oclickablelabel.h> |
24 | 24 | ||
25 | #include "../../todayplugininterface.h" | 25 | #include "../../todayplugininterface.h" |
26 | 26 | ||
27 | class DatebookPlugin : public TodayPluginObject { | 27 | class DatebookPlugin : public TodayPluginObject { |
28 | 28 | ||
29 | public: | 29 | public: |
30 | DatebookPlugin(); | 30 | DatebookPlugin(); |
31 | ~DatebookPlugin(); | 31 | ~DatebookPlugin(); |
32 | 32 | ||
33 | QString pluginName() const; | 33 | QString pluginName() const; |
34 | double versionNumber() const; | 34 | double versionNumber() const; |
35 | QString pixmapNameWidget() const; | 35 | QString pixmapNameWidget() const; |
36 | QWidget* widget( QWidget *); | 36 | QWidget* widget( QWidget *); |
37 | QString pixmapNameConfig() const; | 37 | QString pixmapNameConfig() const; |
38 | ConfigWidget* configWidget( QWidget *); | 38 | TodayConfigWidget* configWidget( QWidget *); |
39 | QString appName() const; | 39 | QString appName() const; |
40 | virtual int minHeight() const; | ||
41 | virtual int maxHeight() const; | ||
42 | 40 | ||
43 | }; | 41 | }; |
44 | 42 | ||
45 | 43 | ||
46 | #endif | 44 | #endif |
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp index 0f60c28..606916b 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp | |||
@@ -1,38 +1,38 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #include "datebookpluginconfig.h" | 3 | #include "datebookpluginconfig.h" |
4 | 4 | ||
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | 6 | ||
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | #include <qtoolbutton.h> | 8 | #include <qtoolbutton.h> |
9 | #include <qlabel.h> | 9 | #include <qlabel.h> |
10 | #include <qhbox.h> | 10 | #include <qhbox.h> |
11 | #include <qvbox.h> | 11 | #include <qvbox.h> |
12 | 12 | ||
13 | DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) | 13 | DatebookPluginConfig::DatebookPluginConfig( QWidget* parent, const char* name) |
14 | : ConfigWidget( parent, name ) { | 14 | : TodayConfigWidget( parent, name ) { |
15 | 15 | ||
16 | QVBoxLayout * layout = new QVBoxLayout( this ); | 16 | QVBoxLayout * layout = new QVBoxLayout( this ); |
17 | layout->setMargin( 20 ); | 17 | layout->setMargin( 20 ); |
18 | 18 | ||
19 | QHBox *box1 = new QHBox( this ); | 19 | QHBox *box1 = new QHBox( this ); |
20 | QLabel* TextLabel4 = new QLabel( box1, "TextLabel4" ); | 20 | QLabel* TextLabel4 = new QLabel( box1, "TextLabel4" ); |
21 | TextLabel4->setText( tr( "Show location" ) ); | 21 | TextLabel4->setText( tr( "Show location" ) ); |
22 | CheckBox1 = new QCheckBox( box1, "CheckBox1" ); | 22 | CheckBox1 = new QCheckBox( box1, "CheckBox1" ); |
23 | 23 | ||
24 | QHBox *box2 = new QHBox( this ); | 24 | QHBox *box2 = new QHBox( this ); |
25 | QLabel* TextLabel5 = new QLabel( box2 , "TextLabel5" ); | 25 | QLabel* TextLabel5 = new QLabel( box2 , "TextLabel5" ); |
26 | TextLabel5->setText( tr( "Show notes" ) ); | 26 | TextLabel5->setText( tr( "Show notes" ) ); |
27 | CheckBox2 = new QCheckBox( box2, "CheckBox2" ); | 27 | CheckBox2 = new QCheckBox( box2, "CheckBox2" ); |
28 | 28 | ||
29 | QHBox *box3 = new QHBox( this ); | 29 | QHBox *box3 = new QHBox( this ); |
30 | QLabel* TextLabel6 = new QLabel( box3, "All Day"); | 30 | QLabel* TextLabel6 = new QLabel( box3, "All Day"); |
31 | TextLabel6->setText( tr( "Show only later\n appointments") ); | 31 | TextLabel6->setText( tr( "Show only later\n appointments") ); |
32 | CheckBox3 = new QCheckBox ( box3, "CheckBox3" ); | 32 | CheckBox3 = new QCheckBox ( box3, "CheckBox3" ); |
33 | 33 | ||
34 | QHBox *box4 = new QHBox( this ); | 34 | QHBox *box4 = new QHBox( this ); |
35 | QLabel *TextLabel3 = new QLabel( box4, "TextLabel3" ); | 35 | QLabel *TextLabel3 = new QLabel( box4, "TextLabel3" ); |
36 | TextLabel3->setText( tr( "How many \nappointment\n" | 36 | TextLabel3->setText( tr( "How many \nappointment\n" |
37 | "should be \nshown?" ) ); | 37 | "should be \nshown?" ) ); |
38 | SpinBox1 = new QSpinBox( box4, "SpinBox1" ); | 38 | SpinBox1 = new QSpinBox( box4, "SpinBox1" ); |
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index 9505a2d..99aa76c 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h | |||
@@ -1,35 +1,35 @@ | |||
1 | 1 | ||
2 | #ifndef DATEBOOK_PLUGIN_CONFIG_H | 2 | #ifndef DATEBOOK_PLUGIN_CONFIG_H |
3 | #define DATEBOOK_PLUGIN_CONFIG_H | 3 | #define DATEBOOK_PLUGIN_CONFIG_H |
4 | 4 | ||
5 | //#include <qwidget.h> | 5 | |
6 | #include <qcheckbox.h> | 6 | #include <qcheckbox.h> |
7 | #include <qspinbox.h> | 7 | #include <qspinbox.h> |
8 | 8 | ||
9 | #include "../../configwidget.h" | 9 | #include "../../todayconfigwidget.h" |
10 | 10 | ||
11 | class DatebookPluginConfig : public ConfigWidget { | 11 | class DatebookPluginConfig : public TodayConfigWidget { |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | public: | 15 | public: |
16 | DatebookPluginConfig( QWidget *parent, const char *name ); | 16 | DatebookPluginConfig( QWidget *parent, const char *name ); |
17 | ~DatebookPluginConfig(); | 17 | ~DatebookPluginConfig(); |
18 | 18 | ||
19 | void writeConfig(); | 19 | void writeConfig(); |
20 | private: | 20 | private: |
21 | /** | 21 | /** |
22 | * if changed then save | 22 | * if changed then save |
23 | */ | 23 | */ |
24 | bool changed(); | 24 | bool changed(); |
25 | void readConfig(); | 25 | void readConfig(); |
26 | 26 | ||
27 | QCheckBox* CheckBox2; | 27 | QCheckBox* CheckBox2; |
28 | QCheckBox* CheckBox1; | 28 | QCheckBox* CheckBox1; |
29 | QCheckBox* CheckBox3; | 29 | QCheckBox* CheckBox3; |
30 | QSpinBox* SpinBox1; | 30 | QSpinBox* SpinBox1; |
31 | 31 | ||
32 | // how many lines should be showed in the datebook section | 32 | // how many lines should be showed in the datebook section |
33 | int m_max_lines_meet; | 33 | int m_max_lines_meet; |
34 | // If location is to be showed too, 1 to activate it. | 34 | // If location is to be showed too, 1 to activate it. |
35 | int m_show_location; | 35 | int m_show_location; |
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp index 4241228..3ddf16e 100644 --- a/core/pim/today/plugins/mail/mailplugin.cpp +++ b/core/pim/today/plugins/mail/mailplugin.cpp | |||
@@ -9,55 +9,48 @@ | |||
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | #include "mailplugin.h" | 18 | #include "mailplugin.h" |
19 | #include "mailpluginwidget.h" | 19 | #include "mailpluginwidget.h" |
20 | 20 | ||
21 | 21 | ||
22 | MailPlugin::MailPlugin() { | 22 | MailPlugin::MailPlugin() { |
23 | } | 23 | } |
24 | 24 | ||
25 | MailPlugin::~MailPlugin() { | 25 | MailPlugin::~MailPlugin() { |
26 | } | 26 | } |
27 | 27 | ||
28 | QString MailPlugin::pluginName() const { | 28 | QString MailPlugin::pluginName() const { |
29 | return "Mail plugin"; | 29 | return "Mail plugin"; |
30 | } | 30 | } |
31 | 31 | ||
32 | double MailPlugin::versionNumber() const { | 32 | double MailPlugin::versionNumber() const { |
33 | return 0.1; | 33 | return 0.5; |
34 | } | 34 | } |
35 | 35 | ||
36 | QString MailPlugin::pixmapNameWidget() const { | 36 | QString MailPlugin::pixmapNameWidget() const { |
37 | return "mail/desktopicon"; | 37 | return "mail/desktopicon"; |
38 | } | 38 | } |
39 | 39 | ||
40 | QWidget* MailPlugin::widget( QWidget * wid ) { | 40 | QWidget* MailPlugin::widget( QWidget * wid ) { |
41 | return new MailPluginWidget( wid, "Mail" ); | 41 | return new MailPluginWidget( wid, "Mail" ); |
42 | } | 42 | } |
43 | 43 | ||
44 | QString MailPlugin::pixmapNameConfig() const { | 44 | QString MailPlugin::pixmapNameConfig() const { |
45 | return 0l; | 45 | return 0l; |
46 | } | 46 | } |
47 | 47 | ||
48 | ConfigWidget* MailPlugin::configWidget( QWidget* wid ) { | 48 | TodayConfigWidget* MailPlugin::configWidget( QWidget* wid ) { |
49 | return 0l; | 49 | return 0l; |
50 | } | 50 | } |
51 | 51 | ||
52 | QString MailPlugin::appName() const { | 52 | QString MailPlugin::appName() const { |
53 | return "Mail"; | 53 | return "Mail"; |
54 | } | 54 | } |
55 | 55 | ||
56 | int MailPlugin::minHeight() const { | ||
57 | return 10; | ||
58 | } | ||
59 | |||
60 | int MailPlugin::maxHeight() const { | ||
61 | return 10; | ||
62 | } | ||
63 | 56 | ||
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h index 96c73ed..a27f4c7 100644 --- a/core/pim/today/plugins/mail/mailplugin.h +++ b/core/pim/today/plugins/mail/mailplugin.h | |||
@@ -4,45 +4,44 @@ | |||
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | #ifndef MAIL_PLUGIN_H | 18 | #ifndef MAIL_PLUGIN_H |
19 | #define MAIL_PLUGIN_H | 19 | #define MAIL_PLUGIN_H |
20 | 20 | ||
21 | #include <qstring.h> | 21 | #include <qstring.h> |
22 | #include <qwidget.h> | 22 | #include <qwidget.h> |
23 | 23 | ||
24 | #include <opie/tododb.h> | 24 | #include <opie/tododb.h> |
25 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
26 | 26 | ||
27 | #include "../../todayplugininterface.h" | 27 | #include "../../todayplugininterface.h" |
28 | #include "../../configwidget.h" | 28 | #include "../../todayconfigwidget.h" |
29 | 29 | ||
30 | class MailPlugin : public TodayPluginObject { | 30 | class MailPlugin : public TodayPluginObject { |
31 | 31 | ||
32 | public: | 32 | public: |
33 | MailPlugin(); | 33 | MailPlugin(); |
34 | ~MailPlugin(); | 34 | ~MailPlugin(); |
35 | 35 | ||
36 | QString pluginName() const; | 36 | QString pluginName() const; |
37 | double versionNumber() const; | 37 | double versionNumber() const; |
38 | QString pixmapNameWidget() const; | 38 | QString pixmapNameWidget() const; |
39 | QWidget* widget(QWidget *); | 39 | QWidget* widget(QWidget *); |
40 | QString pixmapNameConfig() const; | 40 | QString pixmapNameConfig() const; |
41 | ConfigWidget* configWidget(QWidget *); | 41 | TodayConfigWidget* configWidget(QWidget *); |
42 | QString appName() const; | 42 | QString appName() const; |
43 | virtual int minHeight() const; | 43 | |
44 | virtual int maxHeight() const; | ||
45 | 44 | ||
46 | }; | 45 | }; |
47 | 46 | ||
48 | #endif | 47 | #endif |
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index 7ab27a0..19d9f37 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -26,40 +26,33 @@ TodolistPlugin::TodolistPlugin() { | |||
26 | 26 | ||
27 | TodolistPlugin::~TodolistPlugin() { | 27 | TodolistPlugin::~TodolistPlugin() { |
28 | } | 28 | } |
29 | 29 | ||
30 | QString TodolistPlugin::pluginName() const { | 30 | QString TodolistPlugin::pluginName() const { |
31 | return "Todolist plugin"; | 31 | return "Todolist plugin"; |
32 | } | 32 | } |
33 | 33 | ||
34 | double TodolistPlugin::versionNumber() const { | 34 | double TodolistPlugin::versionNumber() const { |
35 | return 0.7; | 35 | return 0.7; |
36 | } | 36 | } |
37 | 37 | ||
38 | QString TodolistPlugin::pixmapNameWidget() const { | 38 | QString TodolistPlugin::pixmapNameWidget() const { |
39 | return "TodoList"; | 39 | return "TodoList"; |
40 | } | 40 | } |
41 | 41 | ||
42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { | 42 | QWidget* TodolistPlugin::widget( QWidget *wid ) { |
43 | return new TodolistPluginWidget( wid, "Todolist" ); | 43 | return new TodolistPluginWidget( wid, "Todolist" ); |
44 | } | 44 | } |
45 | 45 | ||
46 | QString TodolistPlugin::pixmapNameConfig() const { | 46 | QString TodolistPlugin::pixmapNameConfig() const { |
47 | return "TodoList"; | 47 | return "TodoList"; |
48 | } | 48 | } |
49 | 49 | ||
50 | ConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { | 50 | TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) { |
51 | return new TodolistPluginConfig( wid , "Todolist" ); | 51 | return new TodolistPluginConfig( wid , "Todolist" ); |
52 | } | 52 | } |
53 | 53 | ||
54 | QString TodolistPlugin::appName() const { | 54 | QString TodolistPlugin::appName() const { |
55 | return QObject::tr( "Todolist" ); | 55 | return QObject::tr( "Todolist" ); |
56 | } | 56 | } |
57 | 57 | ||
58 | int TodolistPlugin::minHeight() const { | ||
59 | return 10; | ||
60 | } | ||
61 | |||
62 | int TodolistPlugin::maxHeight() const { | ||
63 | return 100; | ||
64 | } | ||
65 | 58 | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h index 7e5006f..2c03389 100644 --- a/core/pim/today/plugins/todolist/todoplugin.h +++ b/core/pim/today/plugins/todolist/todoplugin.h | |||
@@ -15,31 +15,30 @@ | |||
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef TODOLIST_PLUGIN_H | 17 | #ifndef TODOLIST_PLUGIN_H |
18 | #define TODOLIST_PLUGIN_H | 18 | #define TODOLIST_PLUGIN_H |
19 | 19 | ||
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qwidget.h> | 21 | #include <qwidget.h> |
22 | 22 | ||
23 | #include <opie/tododb.h> | 23 | #include <opie/tododb.h> |
24 | #include <opie/oclickablelabel.h> | 24 | #include <opie/oclickablelabel.h> |
25 | 25 | ||
26 | #include "../../todayplugininterface.h" | 26 | #include "../../todayplugininterface.h" |
27 | 27 | ||
28 | class TodolistPlugin : public TodayPluginObject { | 28 | class TodolistPlugin : public TodayPluginObject { |
29 | 29 | ||
30 | public: | 30 | public: |
31 | TodolistPlugin(); | 31 | TodolistPlugin(); |
32 | ~TodolistPlugin(); | 32 | ~TodolistPlugin(); |
33 | 33 | ||
34 | QString pluginName() const; | 34 | QString pluginName() const; |
35 | double versionNumber() const; | 35 | double versionNumber() const; |
36 | QString pixmapNameWidget() const; | 36 | QString pixmapNameWidget() const; |
37 | QWidget* widget(QWidget *); | 37 | QWidget* widget(QWidget *); |
38 | QString pixmapNameConfig() const; | 38 | QString pixmapNameConfig() const; |
39 | ConfigWidget* configWidget(QWidget *); | 39 | TodayConfigWidget* configWidget(QWidget *); |
40 | QString appName() const; | 40 | QString appName() const; |
41 | virtual int minHeight() const; | 41 | |
42 | virtual int maxHeight() const; | ||
43 | }; | 42 | }; |
44 | 43 | ||
45 | #endif | 44 | #endif |
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.cpp b/core/pim/today/plugins/todolist/todopluginconfig.cpp index 69ad727..110b2e0 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.cpp +++ b/core/pim/today/plugins/todolist/todopluginconfig.cpp | |||
@@ -5,49 +5,49 @@ | |||
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #include "todopluginconfig.h" | 17 | #include "todopluginconfig.h" |
18 | 18 | ||
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | 20 | ||
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qhbox.h> | 22 | #include <qhbox.h> |
23 | #include <qtoolbutton.h> | 23 | #include <qtoolbutton.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) | 28 | TodolistPluginConfig::TodolistPluginConfig( QWidget *parent, const char* name) |
29 | : ConfigWidget(parent, name ) { | 29 | : TodayConfigWidget(parent, name ) { |
30 | 30 | ||
31 | QVBoxLayout * layout = new QVBoxLayout( this ); | 31 | QVBoxLayout * layout = new QVBoxLayout( this ); |
32 | layout->setMargin( 20 ); | 32 | layout->setMargin( 20 ); |
33 | 33 | ||
34 | QHBox *box1 = new QHBox( this ); | 34 | QHBox *box1 = new QHBox( this ); |
35 | 35 | ||
36 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); | 36 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); |
37 | TextLabel6->setText( tr( "How many\n tasks should \n" | 37 | TextLabel6->setText( tr( "How many\n tasks should \n" |
38 | "be shown?" ) ); | 38 | "be shown?" ) ); |
39 | 39 | ||
40 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); | 40 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); |
41 | SpinBox2->setMaxValue( 40 ); | 41 | SpinBox2->setMaxValue( 40 ); |
42 | 42 | ||
43 | QHBox *box2 = new QHBox( this ); | 43 | QHBox *box2 = new QHBox( this ); |
44 | 44 | ||
45 | QLabel* clipLabel = new QLabel( box2, "" ); | 45 | QLabel* clipLabel = new QLabel( box2, "" ); |
46 | clipLabel->setText( tr( "Clip line after\n X chars" ) ); | 46 | clipLabel->setText( tr( "Clip line after\n X chars" ) ); |
47 | 47 | ||
48 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); | 48 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); |
49 | SpinBoxClip->setMaxValue( 200 ); | 49 | SpinBoxClip->setMaxValue( 200 ); |
50 | 50 | ||
51 | layout->addWidget( box1 ); | 51 | layout->addWidget( box1 ); |
52 | layout->addWidget( box2 ); | 52 | layout->addWidget( box2 ); |
53 | 53 | ||
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h index 934b319..26557d5 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.h +++ b/core/pim/today/plugins/todolist/todopluginconfig.h | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | * todopluginconfig.h | 2 | * todopluginconfig.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef TODOLIST_PLUGIN_CONFIG_H | 17 | #ifndef TODOLIST_PLUGIN_CONFIG_H |
18 | #define TODOLIST_PLUGIN_CONFIG_H | 18 | #define TODOLIST_PLUGIN_CONFIG_H |
19 | 19 | ||
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | #include <qspinbox.h> | 21 | #include <qspinbox.h> |
22 | 22 | ||
23 | #include "../../configwidget.h" | 23 | #include "../../todayconfigwidget.h" |
24 | 24 | ||
25 | class TodolistPluginConfig : public ConfigWidget { | 25 | class TodolistPluginConfig : public TodayConfigWidget { |
26 | 26 | ||
27 | 27 | ||
28 | public: | 28 | public: |
29 | 29 | ||
30 | TodolistPluginConfig( QWidget *parent, const char *name ); | 30 | TodolistPluginConfig( QWidget *parent, const char *name ); |
31 | ~TodolistPluginConfig(); | 31 | ~TodolistPluginConfig(); |
32 | 32 | ||
33 | private: | 33 | private: |
34 | /** | 34 | /** |
35 | * if changed then save | 35 | * if changed then save |
36 | */ | 36 | */ |
37 | bool changed(); | 37 | bool changed(); |
38 | void readConfig(); | 38 | void readConfig(); |
39 | void writeConfig(); | 39 | void writeConfig(); |
40 | 40 | ||
41 | QSpinBox* SpinBox2; | 41 | QSpinBox* SpinBox2; |
42 | QSpinBox* SpinBoxClip; | 42 | QSpinBox* SpinBoxClip; |
43 | 43 | ||
44 | // how many lines should be showed in the todolist section | 44 | // how many lines should be showed in the todolist section |
45 | int m_max_lines_task; | 45 | int m_max_lines_task; |
46 | // clip the lines after X chars | 46 | // clip the lines after X chars |
47 | int m_maxCharClip; | 47 | int m_maxCharClip; |
48 | 48 | ||
49 | 49 | ||
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 7673df5..f5f88f8 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | * today.cpp | 2 | * today.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002 by Maximilian Reiß | 4 | * copyright : (c) 2002 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | #include "today.h" | 18 | #include "today.h" |
19 | #include "configwidget.h" | 19 | #include "todayconfigwidget.h" |
20 | 20 | ||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/contact.h> | 26 | #include <qpe/contact.h> |
27 | 27 | ||
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qpixmap.h> | 33 | #include <qpixmap.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <opie/otabwidget.h> | 36 | #include <opie/otabwidget.h> |
37 | #include <qdialog.h> | 37 | #include <qdialog.h> |
38 | 38 | ||
39 | 39 | ||
40 | struct TodayPlugin { | 40 | struct TodayPlugin { |
41 | QLibrary *library; | 41 | QLibrary *library; |
42 | TodayPluginInterface *iface; | 42 | TodayPluginInterface *iface; |
43 | TodayPluginObject *guiPart; | 43 | TodayPluginObject *guiPart; |
@@ -148,49 +148,50 @@ void Today::loadPlugins() { | |||
148 | qDebug( QString(*it) ); | 148 | qDebug( QString(*it) ); |
149 | TodayPlugin plugin; | 149 | TodayPlugin plugin; |
150 | plugin.library = lib; | 150 | plugin.library = lib; |
151 | plugin.iface = iface; | 151 | plugin.iface = iface; |
152 | plugin.name = QString(*it); | 152 | plugin.name = QString(*it); |
153 | 153 | ||
154 | // find out if plugins should be shown | 154 | // find out if plugins should be shown |
155 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | 155 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
156 | plugin.active = true; | 156 | plugin.active = true; |
157 | } else { | 157 | } else { |
158 | plugin.active = false; | 158 | plugin.active = false; |
159 | } | 159 | } |
160 | plugin.guiPart = plugin.iface->guiPart(); | 160 | plugin.guiPart = plugin.iface->guiPart(); |
161 | 161 | ||
162 | // package the whole thing into a qwidget so it can be shown and hidden | 162 | // package the whole thing into a qwidget so it can be shown and hidden |
163 | plugin.guiBox = new QWidget( this ); | 163 | plugin.guiBox = new QWidget( this ); |
164 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); | 164 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); |
165 | QPixmap plugPix; | 165 | QPixmap plugPix; |
166 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); | 166 | plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( 18, 18 ), 0 ); |
167 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); | 167 | OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); |
168 | plugIcon->setPixmap( plugPix ); | 168 | plugIcon->setPixmap( plugPix ); |
169 | // a scrollview for each plugin | 169 | // a scrollview for each plugin |
170 | QScrollView* sv = new QScrollView( plugin.guiBox ); | 170 | QScrollView* sv = new QScrollView( plugin.guiBox ); |
171 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); | 171 | QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); |
172 | sv->setMinimumHeight( plugin.guiPart->minHeight() ); | 172 | // not sure if that is good .-) |
173 | sv->setMinimumHeight( 10 ); | ||
173 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 174 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
174 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 175 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
175 | sv->setFrameShape( QFrame::NoFrame ); | 176 | sv->setFrameShape( QFrame::NoFrame ); |
176 | sv->addChild( plugWidget ); | 177 | sv->addChild( plugWidget ); |
177 | // make sure the icon is on the top alligned | 178 | // make sure the icon is on the top alligned |
178 | boxLayout->addWidget( plugIcon, 0, AlignTop ); | 179 | boxLayout->addWidget( plugIcon, 0, AlignTop ); |
179 | boxLayout->addWidget( sv, 0, AlignTop ); | 180 | boxLayout->addWidget( sv, 0, AlignTop ); |
180 | boxLayout->setStretchFactor( plugIcon, 1 ); | 181 | boxLayout->setStretchFactor( plugIcon, 1 ); |
181 | boxLayout->setStretchFactor( sv, 9 ); | 182 | boxLayout->setStretchFactor( sv, 9 ); |
182 | // "prebuffer" it in one more list, to get the sorting done | 183 | // "prebuffer" it in one more list, to get the sorting done |
183 | tempList.insert( plugin.name, plugin ); | 184 | tempList.insert( plugin.name, plugin ); |
184 | 185 | ||
185 | // on first start the list is off course empty | 186 | // on first start the list is off course empty |
186 | if ( m_allApplets.isEmpty() ) { | 187 | if ( m_allApplets.isEmpty() ) { |
187 | layout->addWidget( plugin.guiBox ); | 188 | layout->addWidget( plugin.guiBox ); |
188 | pluginList.append( plugin ); | 189 | pluginList.append( plugin ); |
189 | } | 190 | } |
190 | } else { | 191 | } else { |
191 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 192 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
192 | delete lib; | 193 | delete lib; |
193 | } | 194 | } |
194 | } | 195 | } |
195 | 196 | ||
196 | if ( !m_allApplets.isEmpty() ) { | 197 | if ( !m_allApplets.isEmpty() ) { |
@@ -230,68 +231,68 @@ void Today::draw() { | |||
230 | } else { | 231 | } else { |
231 | // qDebug( plugin.name + " is INACTIVE" ); | 232 | // qDebug( plugin.name + " is INACTIVE" ); |
232 | plugin.guiBox->hide(); | 233 | plugin.guiBox->hide(); |
233 | } | 234 | } |
234 | count++; | 235 | count++; |
235 | } | 236 | } |
236 | 237 | ||
237 | if ( count == 0 ) { | 238 | if ( count == 0 ) { |
238 | QLabel *noPluginsActive = new QLabel( this ); | 239 | QLabel *noPluginsActive = new QLabel( this ); |
239 | noPluginsActive->setText( tr( "No plugins activated" ) ); | 240 | noPluginsActive->setText( tr( "No plugins activated" ) ); |
240 | layout->addWidget( noPluginsActive ); | 241 | layout->addWidget( noPluginsActive ); |
241 | } | 242 | } |
242 | layout->addStretch(0); | 243 | layout->addStretch(0); |
243 | } | 244 | } |
244 | 245 | ||
245 | 246 | ||
246 | /** | 247 | /** |
247 | * The method for the configuration dialog. | 248 | * The method for the configuration dialog. |
248 | */ | 249 | */ |
249 | void Today::startConfig() { | 250 | void Today::startConfig() { |
250 | 251 | ||
251 | TodayConfig conf( this, "dialog", true ); | 252 | TodayConfig conf( this, "dialog", true ); |
252 | 253 | ||
253 | TodayPlugin plugin; | 254 | TodayPlugin plugin; |
254 | QList<ConfigWidget> configWidgetList; | 255 | QList<TodayConfigWidget> configWidgetList; |
255 | 256 | ||
256 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { | 257 | for ( int i = pluginList.count() - 1 ; i >= 0; i-- ) { |
257 | plugin = pluginList[i]; | 258 | plugin = pluginList[i]; |
258 | 259 | ||
259 | // load the config widgets in the tabs | 260 | // load the config widgets in the tabs |
260 | if ( plugin.guiPart->configWidget( this ) != 0l ) { | 261 | if ( plugin.guiPart->configWidget( this ) != 0l ) { |
261 | ConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); | 262 | TodayConfigWidget* widget = plugin.guiPart->configWidget( conf.TabWidget3 ); |
262 | configWidgetList.append( widget ); | 263 | configWidgetList.append( widget ); |
263 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() | 264 | conf.TabWidget3->addTab( widget, plugin.guiPart->pixmapNameConfig() |
264 | , plugin.guiPart->appName() ); | 265 | , plugin.guiPart->appName() ); |
265 | } | 266 | } |
266 | // set the order/activate tab | 267 | // set the order/activate tab |
267 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), | 268 | conf.pluginManagement( plugin.name, plugin.guiPart->pluginName(), |
268 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); | 269 | Resource::loadPixmap( plugin.guiPart->pixmapNameWidget() ) ); |
269 | } | 270 | } |
270 | 271 | ||
271 | if ( conf.exec() == QDialog::Accepted ) { | 272 | if ( conf.exec() == QDialog::Accepted ) { |
272 | conf.writeConfig(); | 273 | conf.writeConfig(); |
273 | ConfigWidget *confWidget; | 274 | TodayConfigWidget *confWidget; |
274 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 275 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
275 | confWidget = configWidgetList.next() ) { | 276 | confWidget = configWidgetList.next() ) { |
276 | confWidget->writeConfig(); | 277 | confWidget->writeConfig(); |
277 | } | 278 | } |
278 | refresh(); | 279 | refresh(); |
279 | } | 280 | } |
280 | } | 281 | } |
281 | 282 | ||
282 | 283 | ||
283 | /** | 284 | /** |
284 | * Refresh for the view. Reload all applets | 285 | * Refresh for the view. Reload all applets |
285 | * | 286 | * |
286 | */ | 287 | */ |
287 | void Today::refresh() { | 288 | void Today::refresh() { |
288 | init(); | 289 | init(); |
289 | 290 | ||
290 | // set the date in top label | 291 | // set the date in top label |
291 | QDate date = QDate::currentDate(); | 292 | QDate date = QDate::currentDate(); |
292 | QString time = ( tr( date.toString() ) ); | 293 | QString time = ( tr( date.toString() ) ); |
293 | 294 | ||
294 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); | 295 | DateLabel->setText( QString( "<font color=#FFFFFF>" + time + "</font>" ) ); |
295 | 296 | ||
296 | if ( layout ) { | 297 | if ( layout ) { |
297 | delete layout; | 298 | delete layout; |
diff --git a/core/pim/today/todayconfigwidget.h b/core/pim/today/todayconfigwidget.h new file mode 100644 index 0000000..48cf379 --- a/dev/null +++ b/core/pim/today/todayconfigwidget.h | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | #ifndef CONFIG_WIDGET_H | ||
3 | #define CONFIG_WIDGET_H | ||
4 | |||
5 | |||
6 | class TodayConfigWidget : public QWidget { | ||
7 | |||
8 | |||
9 | public: | ||
10 | |||
11 | TodayConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) {} ; | ||
12 | virtual ~TodayConfigWidget() {}; | ||
13 | |||
14 | /** | ||
15 | * Plugins need to reimplement this in the config widget | ||
16 | * Used when the config dialog is closed to write config stuff | ||
17 | */ | ||
18 | virtual void writeConfig() = 0; | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/core/pim/today/todayplugininterface.h b/core/pim/today/todayplugininterface.h index 01e7d58..becb79c 100644 --- a/core/pim/today/todayplugininterface.h +++ b/core/pim/today/todayplugininterface.h | |||
@@ -1,82 +1,79 @@ | |||
1 | 1 | ||
2 | #ifndef TODAY_PLUGIN_INTERFACE | 2 | #ifndef TODAY_PLUGIN_INTERFACE |
3 | #define TODAY_PLUGIN_INTERFACE | 3 | #define TODAY_PLUGIN_INTERFACE |
4 | 4 | ||
5 | #include <qpe/qcom.h> | 5 | #include <qpe/qcom.h> |
6 | #include "configwidget.h" | 6 | #include "todayconfigwidget.h" |
7 | 7 | ||
8 | class QString; | 8 | class QString; |
9 | class QWidget; | 9 | class QWidget; |
10 | 10 | ||
11 | #ifndef IID_TodayPluginInterface | 11 | #ifndef IID_TodayPluginInterface |
12 | #define IID_TodayPluginInterface QUuid( 0x70481804, 0x2b50, 0x4fba, 0x80, 0xbb, 0x0b, 0xf8, 0xdc, 0x72, 0x04, 0x14) | 12 | #define IID_TodayPluginInterface QUuid( 0x70481804, 0x2b50, 0x4fba, 0x80, 0xbb, 0x0b, 0xf8, 0xdc, 0x72, 0x04, 0x14) |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | /** | 15 | /** |
16 | * | 16 | * |
17 | * | 17 | * |
18 | * | 18 | * |
19 | */ | 19 | */ |
20 | class TodayPluginObject { | 20 | class TodayPluginObject { |
21 | 21 | ||
22 | Q_OBJECT | 22 | Q_OBJECT |
23 | 23 | ||
24 | public: | 24 | public: |
25 | 25 | ||
26 | virtual ~TodayPluginObject() {}; | 26 | virtual ~TodayPluginObject() {}; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * The name if the plugin | 29 | * The name if the plugin |
30 | */ | 30 | */ |
31 | virtual QString pluginName() const = 0; | 31 | virtual QString pluginName() const = 0; |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Version numbering | 34 | * Version numbering |
35 | */ | 35 | */ |
36 | virtual double versionNumber() const = 0; | 36 | virtual double versionNumber() const = 0; |
37 | 37 | ||
38 | /** | 38 | |
39 | * the path and name of the identifer icon that should be shown | ||
40 | * in "Resource" notation, that means only subdir/picname form $QPEDIR/pics | ||
41 | */ | ||
42 | virtual QString pixmapNameWidget() const = 0; | 39 | virtual QString pixmapNameWidget() const = 0; |
43 | 40 | ||
44 | /** widget for the today view | 41 | /** widget for the today view |
45 | * It _needs_ a parent here. | 42 | * It _needs_ a parent here. |
46 | */ | 43 | */ |
47 | virtual QWidget* widget( QWidget * ) = 0; | 44 | virtual QWidget* widget( QWidget * ) = 0; |
48 | 45 | ||
49 | /** | 46 | /** |
50 | * Pixmap used in the config widget | 47 | * Pixmap used in the config widget |
51 | */ | 48 | */ |
52 | virtual QString pixmapNameConfig() const = 0; | 49 | virtual QString pixmapNameConfig() const = 0; |
53 | 50 | ||
54 | /** | 51 | /** |
55 | * Config plugin widget - optional | 52 | * Config plugin widget - optional |
56 | * If the plugin has a config widget, it _needs_ a parent here. | 53 | * If the plugin has a config widget, it _needs_ a parent here. |
57 | */ | 54 | */ |
58 | virtual ConfigWidget* configWidget( QWidget * ) = 0; | 55 | virtual TodayConfigWidget* configWidget( QWidget * ) = 0; |
59 | 56 | ||
60 | /** | 57 | /** |
61 | * The application that should be assigned to the button (pixmap) | 58 | * The application that should be assigned to the button (pixmap) |
62 | */ | 59 | */ |
63 | virtual QString appName() const = 0; | 60 | virtual QString appName() const = 0; |
64 | 61 | ||
65 | /** | 62 | /** |
66 | * minimum height the plugin at least should have | 63 | * minimum height the plugin at least should have |
67 | */ | 64 | */ |
68 | virtual int minHeight() const = 0; | 65 | // virtual int minHeight() const = 0; |
69 | 66 | ||
70 | /** | 67 | /** |
71 | * maximum height that should be used before starting scrolling | 68 | * maximum height that should be used before starting scrolling |
72 | */ | 69 | */ |
73 | virtual int maxHeight() const = 0; | 70 | // virtual int maxHeight() const = 0; |
74 | 71 | ||
75 | }; | 72 | }; |
76 | 73 | ||
77 | 74 | ||
78 | struct TodayPluginInterface : public QUnknownInterface { | 75 | struct TodayPluginInterface : public QUnknownInterface { |
79 | virtual TodayPluginObject *guiPart() = 0; | 76 | virtual TodayPluginObject *guiPart() = 0; |
80 | }; | 77 | }; |
81 | 78 | ||
82 | #endif | 79 | #endif |