author | ulf69 <ulf69> | 2004-08-10 16:10:42 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 16:10:42 (UTC) |
commit | c56c4729e32a9c8ba8709493b3ea11cf7cf229d3 (patch) (unidiff) | |
tree | 10072e3a37eb3dca26482e67c08229bd2a1cbba6 /libkdepim/externalapphandler.h | |
parent | c9d570427f3d5bead7bee1301514a2d4b82836ea (diff) | |
download | kdepimpi-c56c4729e32a9c8ba8709493b3ea11cf7cf229d3.zip kdepimpi-c56c4729e32a9c8ba8709493b3ea11cf7cf229d3.tar.gz kdepimpi-c56c4729e32a9c8ba8709493b3ea11cf7cf229d3.tar.bz2 |
additional files for external application configuration
Diffstat (limited to 'libkdepim/externalapphandler.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h new file mode 100644 index 0000000..3ecf1b1 --- a/dev/null +++ b/libkdepim/externalapphandler.h | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | This file is part of libkdepim. | ||
3 | Copyright (c) 2004 Ulf Schenk | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | Enhanced Version of the file for platform independent KDE tools. | ||
26 | Copyright (c) 2004 Ulf Schenk | ||
27 | |||
28 | $Id$ | ||
29 | */ | ||
30 | |||
31 | #ifndef EXTERNALAPPHANDLER_H | ||
32 | #define EXTERNALAPPHANDLER_H | ||
33 | |||
34 | #include <qlist.h> | ||
35 | |||
36 | class QCopEnvelope; | ||
37 | |||
38 | |||
39 | class ExternalAppHandler; | ||
40 | |||
41 | class DefaultAppItem | ||
42 | { | ||
43 | public: | ||
44 | DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) | ||
45 | : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) | ||
46 | {} | ||
47 | |||
48 | DefaultAppItem() | ||
49 | { } | ||
50 | |||
51 | public: | ||
52 | int _type; | ||
53 | int _id; | ||
54 | QString _label; | ||
55 | QString _channel; | ||
56 | QString _message; | ||
57 | QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; | ||
58 | QString _message2; | ||
59 | QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; | ||
60 | |||
61 | }; | ||
62 | |||
63 | class ExternalAppHandler | ||
64 | { | ||
65 | public: | ||
66 | virtual ~ExternalAppHandler(); | ||
67 | |||
68 | static ExternalAppHandler *instance(); | ||
69 | |||
70 | enum Types { | ||
71 | EMAIL = 0, | ||
72 | PHONE = 1, | ||
73 | SMS = 2, | ||
74 | FAX = 3, | ||
75 | PAGER = 4 | ||
76 | }; | ||
77 | |||
78 | //calls the emailapplication with a number of attachments that need to be send | ||
79 | bool mailAttachments( const QString& urls ); | ||
80 | |||
81 | //calls the emailapplication and creates a mail with parameter emails as recipients | ||
82 | bool mailToContacts( const QString& emails ); | ||
83 | |||
84 | //calls the phoneapplication with the number | ||
85 | bool callByPhone( const QString& phonenumber ); | ||
86 | |||
87 | //calls the smsapplication with the number | ||
88 | bool callBySMS( const QString& phonenumber ); | ||
89 | |||
90 | //calls the pagerapplication with the number | ||
91 | bool callByPager( const QString& pagernumber ); | ||
92 | |||
93 | //calls the faxapplication with the number | ||
94 | bool callByFax( const QString& faxnumber ); | ||
95 | |||
96 | |||
97 | //loadConfig clears the cache and checks again if the applications are available or not | ||
98 | void loadConfig(); | ||
99 | |||
100 | QList<DefaultAppItem> getAvailableDefaultItems(Types); | ||
101 | DefaultAppItem* getDefaultItem(Types, int); | ||
102 | |||
103 | |||
104 | private: | ||
105 | ExternalAppHandler(); | ||
106 | QList<DefaultAppItem> mDefaultItems; | ||
107 | |||
108 | |||
109 | void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); | ||
110 | |||
111 | QString& translateMessage(QString& message, const QString& emails) const; | ||
112 | void passParameter(QCopEnvelope* e, const QString& parameters, const QString& param1) const; | ||
113 | |||
114 | |||
115 | static ExternalAppHandler *sInstance; | ||
116 | |||
117 | |||
118 | }; | ||
119 | |||
120 | #endif | ||