summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-11-07 01:13:59 (UTC)
committer ulf69 <ulf69>2004-11-07 01:13:59 (UTC)
commitc3168210fffc83fbab58f44ce456fd241d44716d (patch) (unidiff)
treec93de33dd16e9b0f1e0752d6006aa75bd003fccf
parent023e0e82dd8bf6421d12492a2dd25534fc43ad31 (diff)
downloadkdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.zip
kdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.tar.gz
kdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.tar.bz2
added support for mailit opie mailer,
now we check for applications in QTDIR, QPEDIR and OPIEDIR
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp17
-rw-r--r--libkdepim/kpimglobalprefs.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 9f12152..3079141 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -1,949 +1,962 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 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 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 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 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 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. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30#include <stdlib.h> 30#include <stdlib.h>
31 31
32#include <qfile.h> 32#include <qfile.h>
33#include <qmap.h> 33#include <qmap.h>
34#include <qregexp.h> 34#include <qregexp.h>
35 35
36#ifndef DESKTOP_VERSION 36#ifndef DESKTOP_VERSION
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include <qtopia/qcopenvelope_qws.h> 38#include <qtopia/qcopenvelope_qws.h>
39#else 39#else
40#include <qapplication.h> 40#include <qapplication.h>
41#endif 41#endif
42 42
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45 45
46 46
47#include "externalapphandler.h" 47#include "externalapphandler.h"
48 48
49#include "kpimglobalprefs.h" 49#include "kpimglobalprefs.h"
50 50
51//uncomment line to get debug output 51//uncomment line to get debug output
52//#define DEBUG_EXT_APP_HANDLER 52//#define DEBUG_EXT_APP_HANDLER
53 53
54/********************************************************************************* 54/*********************************************************************************
55 * 55 *
56 ********************************************************************************/ 56 ********************************************************************************/
57 57
58 58
59QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 59QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
60 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) 60 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage)
61{ 61{
62 //sourceMessage passes later three parameters: sourceChannel, uid, param1 62 //sourceMessage passes later three parameters: sourceChannel, uid, param1
63 if (_usedSourceParameters == 0) 63 if (_usedSourceParameters == 0)
64 _sourceMessageParameters = "QString,QString)"; 64 _sourceMessageParameters = "QString,QString)";
65 else if (_usedSourceParameters == 1) 65 else if (_usedSourceParameters == 1)
66 _sourceMessageParameters = "(QString,QString,QString)"; 66 _sourceMessageParameters = "(QString,QString,QString)";
67 else if (_usedSourceParameters == 2) 67 else if (_usedSourceParameters == 2)
68 _sourceMessageParameters = "(QString,QString,QString,QString)"; 68 _sourceMessageParameters = "(QString,QString,QString,QString)";
69 else if (_usedSourceParameters == 3) 69 else if (_usedSourceParameters == 3)
70 _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; 70 _sourceMessageParameters = "(QString,QString,QString,QString,QString)";
71} 71}
72 72
73/*********************************************************************************/ 73/*********************************************************************************/
74 74
75QCopTransferItem::QCopTransferItem() 75QCopTransferItem::QCopTransferItem()
76{ 76{
77} 77}
78 78
79/*********************************************************************************/ 79/*********************************************************************************/
80bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) 80bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
81{ 81{
82 82
83#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
84 //sourceMessage passes two parameters: sourceChannel, uid 84 //sourceMessage passes two parameters: sourceChannel, uid
85 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 85 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
86#ifdef DEBUG_EXT_APP_HANDLER 86#ifdef DEBUG_EXT_APP_HANDLER
87 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 87 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
88 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); 88 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1());
89#endif 89#endif
90 90
91 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 91 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
92 92
93 e << _sourceChannel << uid; 93 e << _sourceChannel << uid;
94 94
95 if (_usedSourceParameters == 1) 95 if (_usedSourceParameters == 1)
96 e << param1; 96 e << param1;
97 else if (_usedSourceParameters == 2) 97 else if (_usedSourceParameters == 2)
98 e << param1 << param2; 98 e << param1 << param2;
99 else if (_usedSourceParameters == 3) 99 else if (_usedSourceParameters == 3)
100 e << param1 << param2 << param3; 100 e << param1 << param2 << param3;
101 101
102 qApp->processEvents(); 102 qApp->processEvents();
103 103
104 return true; 104 return true;
105 105
106#else 106#else
107 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 107 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
108 return false; 108 return false;
109#endif 109#endif
110 110
111} 111}
112 112
113 113
114/*********************************************************************************/ 114/*********************************************************************************/
115void QCopTransferItem::setSourceChannel(const QString& sourceChannel) 115void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
116{ 116{
117 117
118 if ( !sourceChannel.isEmpty()) 118 if ( !sourceChannel.isEmpty())
119 _sourceChannel = sourceChannel; 119 _sourceChannel = sourceChannel;
120} 120}
121 121
122 122
123/*********************************************************************************/ 123/*********************************************************************************/
124bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 124bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
125{ 125{
126 126
127 // copied from old mail2 127 // copied from old mail2
128/* 128/*
129 static int ii = 0; 129 static int ii = 0;
130 130
131 // block second call 131 // block second call
132 if ( ii < 2 ) { 132 if ( ii < 2 ) {
133 ++ii; 133 ++ii;
134 if ( ii > 1 ) { 134 if ( ii > 1 ) {
135 qDebug("qcop call blocked "); 135 qDebug("qcop call blocked ");
136 return true; 136 return true;
137 } 137 }
138 } 138 }
139*/ 139*/
140 140
141// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); 141// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
142 142
143 //we are in the target and get a request from the source 143 //we are in the target and get a request from the source
144 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) 144 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data())
145 { 145 {
146 146
147 QDataStream stream( data, IO_ReadOnly ); 147 QDataStream stream( data, IO_ReadOnly );
148 148
149 149
150 QString sourceChannel; 150 QString sourceChannel;
151 QString uid; 151 QString uid;
152 QString param1; 152 QString param1;
153 QString param2; 153 QString param2;
154 QString param3; 154 QString param3;
155 155
156 stream >> sourceChannel >> uid; 156 stream >> sourceChannel >> uid;
157 157
158 if (_usedSourceParameters == 0) 158 if (_usedSourceParameters == 0)
159 { 159 {
160 emit receivedMessageFromSource(sourceChannel, uid); 160 emit receivedMessageFromSource(sourceChannel, uid);
161 } 161 }
162 else if (_usedSourceParameters == 1) 162 else if (_usedSourceParameters == 1)
163 { 163 {
164 stream >> param1; 164 stream >> param1;
165 emit receivedMessageFromSource(sourceChannel, uid, param1); 165 emit receivedMessageFromSource(sourceChannel, uid, param1);
166 } 166 }
167 else if (_usedSourceParameters == 2) 167 else if (_usedSourceParameters == 2)
168 { 168 {
169 stream >> param1 >> param2; 169 stream >> param1 >> param2;
170 emit receivedMessageFromSource(sourceChannel, uid, param1, param2); 170 emit receivedMessageFromSource(sourceChannel, uid, param1, param2);
171 } 171 }
172 else if (_usedSourceParameters == 3) 172 else if (_usedSourceParameters == 3)
173 { 173 {
174 stream >> param1 >> param2 >> param3; 174 stream >> param1 >> param2 >> param3;
175 emit receivedMessageFromSource(sourceChannel, uid, param1, param2, param3); 175 emit receivedMessageFromSource(sourceChannel, uid, param1, param2, param3);
176 } 176 }
177 177
178 return true; 178 return true;
179 } 179 }
180 180
181 return false; 181 return false;
182} 182}
183 183
184 184
185/********************************************************************************* 185/*********************************************************************************
186 * 186 *
187 ********************************************************************************/ 187 ********************************************************************************/
188 188
189 189
190QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 190QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
191 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 191 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
192{ 192{
193 //targetMessage returns later two parameters: uid, and map<qstring,qstring> 193 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
194 _targetMessageParameters = "(QString,QMAP<QString,QString>)"; 194 _targetMessageParameters = "(QString,QMAP<QString,QString>)";
195} 195}
196 196
197/*********************************************************************************/ 197/*********************************************************************************/
198bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 198bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
199{ 199{
200#ifndef DESKTOP_VERSION 200#ifndef DESKTOP_VERSION
201 //targetMessage passes two parameters: uid, map 201 //targetMessage passes two parameters: uid, map
202 QString targetMessage = _targetMessage + _targetMessageParameters; 202 QString targetMessage = _targetMessage + _targetMessageParameters;
203 203
204#ifdef DEBUG_EXT_APP_HANDLER 204#ifdef DEBUG_EXT_APP_HANDLER
205 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 205 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
206 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1()); 206 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
207#endif 207#endif
208 208
209 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 209 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
210 //US we need no names in the To field. The emailadresses are enough 210 //US we need no names in the To field. The emailadresses are enough
211 211
212 e << uid << nameEmailMap; 212 e << uid << nameEmailMap;
213 213
214 qApp->processEvents(); 214 qApp->processEvents();
215 215
216 return true; 216 return true;
217 217
218#else 218#else
219 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 219 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
220 return false; 220 return false;
221#endif 221#endif
222 222
223} 223}
224 224
225 225
226/*********************************************************************************/ 226/*********************************************************************************/
227bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 227bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
228{ 228{
229 bool res = QCopTransferItem::appMessage( cmsg, data ); 229 bool res = QCopTransferItem::appMessage( cmsg, data );
230 230
231 if (res == false) 231 if (res == false)
232 { 232 {
233 QDataStream stream( data, IO_ReadOnly ); 233 QDataStream stream( data, IO_ReadOnly );
234 234
235// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); 235// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
236 236
237 //we are in the source and get an answer from the target 237 //we are in the source and get an answer from the target
238 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 238 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
239 { 239 {
240 QMap<QString,QString> adrMap; 240 QMap<QString,QString> adrMap;
241 QString uid; 241 QString uid;
242 242
243 stream >> uid >> adrMap; 243 stream >> uid >> adrMap;
244 244
245 emit receivedMessageFromTarget(uid, adrMap); 245 emit receivedMessageFromTarget(uid, adrMap);
246 246
247 247
248 return true; 248 return true;
249 } 249 }
250 } 250 }
251 251
252 return false; 252 return false;
253} 253}
254 254
255 255
256/********************************************************************************* 256/*********************************************************************************
257 * 257 *
258 ********************************************************************************/ 258 ********************************************************************************/
259 259
260QCopListTransferItem::~QCopListTransferItem() 260QCopListTransferItem::~QCopListTransferItem()
261{ 261{
262 262
263} 263}
264 264
265QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 265QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
266 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 266 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
267{ 267{
268 //targetMessage returns later two parameters: uid, and three lists 268 //targetMessage returns later two parameters: uid, and three lists
269 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)"; 269 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)";
270} 270}
271 271
272/*********************************************************************************/ 272/*********************************************************************************/
273bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) 273bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
274{ 274{
275#ifndef DESKTOP_VERSION 275#ifndef DESKTOP_VERSION
276 //targetMessage passes two parameters: uid, map 276 //targetMessage passes two parameters: uid, map
277 QString targetMessage = _targetMessage + _targetMessageParameters; 277 QString targetMessage = _targetMessage + _targetMessageParameters;
278 278
279#ifdef DEBUG_EXT_APP_HANDLER 279#ifdef DEBUG_EXT_APP_HANDLER
280 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 280 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
281 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1()); 281 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1());
282 282
283 283
284 for ( int i = 0; i < list3.count(); i++) 284 for ( int i = 0; i < list3.count(); i++)
285 qDebug("listentry list3: %s",list3[i].latin1()); 285 qDebug("listentry list3: %s",list3[i].latin1());
286#endif 286#endif
287 287
288 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 288 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
289 //US we need no names in the To field. The emailadresses are enough 289 //US we need no names in the To field. The emailadresses are enough
290 290
291 e << uid << list1 << list2 << list3 << list4 << list5 << list6; 291 e << uid << list1 << list2 << list3 << list4 << list5 << list6;
292 292
293 qApp->processEvents(); 293 qApp->processEvents();
294 294
295 return true; 295 return true;
296 296
297#else 297#else
298 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 298 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
299 return false; 299 return false;
300#endif 300#endif
301 301
302} 302}
303 303
304 304
305/*********************************************************************************/ 305/*********************************************************************************/
306bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 306bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
307{ 307{
308 bool res = QCopTransferItem::appMessage( cmsg, data ); 308 bool res = QCopTransferItem::appMessage( cmsg, data );
309#ifdef DEBUG_EXT_APP_HANDLER 309#ifdef DEBUG_EXT_APP_HANDLER
310 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 310 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
311#endif 311#endif
312 312
313 if (res == false) 313 if (res == false)
314 { 314 {
315 QDataStream stream( data, IO_ReadOnly ); 315 QDataStream stream( data, IO_ReadOnly );
316 316
317#ifdef DEBUG_EXT_APP_HANDLER 317#ifdef DEBUG_EXT_APP_HANDLER
318 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 318 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
319#endif 319#endif
320 320
321 //we are in the source and get an answer from the target 321 //we are in the source and get an answer from the target
322 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 322 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
323 { 323 {
324 QStringList list1; 324 QStringList list1;
325 QStringList list2; 325 QStringList list2;
326 QStringList list3; 326 QStringList list3;
327 QStringList list4; 327 QStringList list4;
328 QStringList list5; 328 QStringList list5;
329 QStringList list6; 329 QStringList list6;
330 QString uid; 330 QString uid;
331 331
332#ifdef DEBUG_EXT_APP_HANDLER 332#ifdef DEBUG_EXT_APP_HANDLER
333 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 333 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
334#endif 334#endif
335 335
336 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6; 336 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6;
337 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6); 337 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6);
338 338
339 339
340 return true; 340 return true;
341 } 341 }
342 } 342 }
343 343
344 return false; 344 return false;
345} 345}
346 346
347 347
348 348
349/********************************************************************************* 349/*********************************************************************************
350 * 350 *
351 ********************************************************************************/ 351 ********************************************************************************/
352 352
353 353
354ExternalAppHandler *ExternalAppHandler::sInstance = 0; 354ExternalAppHandler *ExternalAppHandler::sInstance = 0;
355static KStaticDeleter<ExternalAppHandler> staticDeleter; 355static KStaticDeleter<ExternalAppHandler> staticDeleter;
356 356
357ExternalAppHandler::ExternalAppHandler() 357ExternalAppHandler::ExternalAppHandler()
358{ 358{
359 mDefaultItems.setAutoDelete(true); 359 mDefaultItems.setAutoDelete(true);
360 360
361 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); 361 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
362 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); 362 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
363 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 363 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
364 364
365//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); 365//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
366//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); 366//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
367//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 367//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
368 368
369 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); 369 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
370 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 370 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
371 371
372 372
373 373
374 mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); 374 mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList");
375 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); 375 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&)));
376 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 376 connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
377 377
378 378
379} 379}
380 380
381ExternalAppHandler::~ExternalAppHandler() 381ExternalAppHandler::~ExternalAppHandler()
382{ 382{
383 delete mNameEmailUidListFromKAPITransfer; 383 delete mNameEmailUidListFromKAPITransfer;
384 //delete mFindByEmailFromKAPITransfer; 384 //delete mFindByEmailFromKAPITransfer;
385 delete mDisplayDetails; 385 delete mDisplayDetails;
386 delete mBirthdayListFromKAPITransfer; 386 delete mBirthdayListFromKAPITransfer;
387} 387}
388 388
389void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, 389void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid,
390 const QStringList& nameList, 390 const QStringList& nameList,
391 const QStringList& emailList, 391 const QStringList& emailList,
392 const QStringList& uidList, 392 const QStringList& uidList,
393 const QStringList&, 393 const QStringList&,
394 const QStringList&, 394 const QStringList&,
395 const QStringList& ) 395 const QStringList& )
396{ 396{
397 // this method is a conevnient way to reduce the number of parameters I have to pass 397 // this method is a conevnient way to reduce the number of parameters I have to pass
398 emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); 398 emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList);
399} 399}
400 400
401 401
402void ExternalAppHandler::loadConfig() 402void ExternalAppHandler::loadConfig()
403{ 403{
404 404
405 mDefaultItems.clear(); 405 mDefaultItems.clear();
406 mEmailAppAvailable = UNDEFINED; 406 mEmailAppAvailable = UNDEFINED;
407 mPhoneAppAvailable = UNDEFINED; 407 mPhoneAppAvailable = UNDEFINED;
408 mFaxAppAvailable = UNDEFINED; 408 mFaxAppAvailable = UNDEFINED;
409 mSMSAppAvailable = UNDEFINED; 409 mSMSAppAvailable = UNDEFINED;
410 mPagerAppAvailable = UNDEFINED; 410 mPagerAppAvailable = UNDEFINED;
411 mSIPAppAvailable = UNDEFINED; 411 mSIPAppAvailable = UNDEFINED;
412 412
413 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); 413 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
414 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); 414 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
415 QString qtpath = QString::fromLatin1( getenv("QTDIR") );
415 416
417 //if qtopiapath is not set, fallback to qt
418 if (qtopiapath.isEmpty())
419 qtopiapath = qtpath;
420
421 //if opiepath is not set, fallback to qtopia
416 if (opiepath.isEmpty()) 422 if (opiepath.isEmpty())
417 opiepath = qtopiapath; 423 opiepath = qtopiapath;
418 424
425
426
419 //mailclients 427 //mailclients
420 QString mailmsg1 = "writeMail(QString,QString)"; 428 QString mailmsg1 = "writeMail(QString,QString)";
421 QString mailmsg2 = "writeMail(QMap(QString,QString))"; 429 QString mailmsg2 = "writeMail(QMap(QString,QString))";
422 430
423 QString undefined = ""; 431 QString undefined = "";
424 432
425 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); 433 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined);
426 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); 434 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined);
427 435
428 if (( QFile::exists( qtopiapath + "/bin/ompi" )) || 436 if (( QFile::exists( qtopiapath + "/bin/ompi" )) ||
429 ( QFile::exists( opiepath + "/bin/ompi" ))) 437 ( QFile::exists( opiepath + "/bin/ompi" )) ||
438 ( QFile::exists( qtpath + "/bin/ompi" )))
430 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 439 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
431 440
432 if ( QFile::exists( qtopiapath + "/bin/qtmail" )) 441 if (( QFile::exists( qtopiapath + "/bin/qtmail" )) ||
442 ( QFile::exists( qtpath + "/bin/qtmail" )))
433 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 443 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
434 444
435 if ( QFile::exists( opiepath + "/bin/opiemail" )) 445 if ( QFile::exists( opiepath + "/bin/opiemail" ))
436 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 446 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
437 447
448 if ( QFile::exists( opiepath + "/bin/mailit" ))
449 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_MAILIT_EMC, "Opie mailit email client", "QPE/Application/mailit", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
450
438 451
439 452
440 //phoneclients 453 //phoneclients
441 454
442 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); 455 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined);
443 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); 456 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined);
444 if (( QFile::exists( qtopiapath + "/bin/kppi" )) || 457 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
445 ( QFile::exists( opiepath + "/bin/kppi" ))) 458 ( QFile::exists( opiepath + "/bin/kppi" )))
446 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 459 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
447 460
448 //faxclients 461 //faxclients
449 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); 462 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined);
450 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); 463 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined);
451 464
452 //smsclients 465 //smsclients
453 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); 466 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined);
454 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); 467 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined);
455 468
456 //pagerclients 469 //pagerclients
457 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); 470 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined);
458 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); 471 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined);
459 472
460 //sipclients 473 //sipclients
461 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No SIP client installed", undefined, undefined, undefined, undefined, undefined); 474 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No SIP client installed", undefined, undefined, undefined, undefined, undefined);
462 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other SIP client", undefined, undefined, undefined, undefined, undefined); 475 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other SIP client", undefined, undefined, undefined, undefined, undefined);
463 if (( QFile::exists( qtopiapath + "/bin/kppi" )) || 476 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
464 ( QFile::exists( opiepath + "/bin/kppi" ))) 477 ( QFile::exists( opiepath + "/bin/kppi" )))
465 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::KPPI_SIC, "KP/Pi SIP client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 478 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::KPPI_SIC, "KP/Pi SIP client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
466 479
467} 480}
468 481
469ExternalAppHandler *ExternalAppHandler::instance() 482ExternalAppHandler *ExternalAppHandler::instance()
470{ 483{
471 if ( !sInstance ) { 484 if ( !sInstance ) {
472 sInstance = staticDeleter.setObject( new ExternalAppHandler() ); 485 sInstance = staticDeleter.setObject( new ExternalAppHandler() );
473 sInstance->loadConfig(); 486 sInstance->loadConfig();
474 } 487 }
475 488
476 return sInstance; 489 return sInstance;
477} 490}
478 491
479void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) 492void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2)
480{ 493{
481 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); 494 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2);
482 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); 495 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() );
483 mDefaultItems.append(dai); 496 mDefaultItems.append(dai);
484} 497}
485 498
486 499
487QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) 500QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type)
488{ 501{
489 QList<DefaultAppItem> list; 502 QList<DefaultAppItem> list;
490 503
491 DefaultAppItem* dai; 504 DefaultAppItem* dai;
492 505
493 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 506 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
494 { 507 {
495 if (dai->_type == type) 508 if (dai->_type == type)
496 list.append(dai); 509 list.append(dai);
497 } 510 }
498 511
499 return list; 512 return list;
500} 513}
501 514
502DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) 515DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid)
503{ 516{
504 DefaultAppItem* dai; 517 DefaultAppItem* dai;
505 518
506 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 519 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
507 { 520 {
508 if (dai->_type == type && dai->_id == clientid) 521 if (dai->_type == type && dai->_id == clientid)
509 return dai; 522 return dai;
510 } 523 }
511 524
512 return 0; 525 return 0;
513} 526}
514 527
515bool ExternalAppHandler::isEmailAppAvailable() 528bool ExternalAppHandler::isEmailAppAvailable()
516{ 529{
517#ifndef DESKTOP_VERSION 530#ifndef DESKTOP_VERSION
518 if (mEmailAppAvailable == UNDEFINED) 531 if (mEmailAppAvailable == UNDEFINED)
519 { 532 {
520 int client = KPimGlobalPrefs::instance()->mEmailClient; 533 int client = KPimGlobalPrefs::instance()->mEmailClient;
521 if (client == KPimGlobalPrefs::NONE_EMC) 534 if (client == KPimGlobalPrefs::NONE_EMC)
522 mEmailAppAvailable = UNAVAILABLE; 535 mEmailAppAvailable = UNAVAILABLE;
523 else 536 else
524 mEmailAppAvailable = AVAILABLE; 537 mEmailAppAvailable = AVAILABLE;
525 } 538 }
526 return (mEmailAppAvailable == AVAILABLE); 539 return (mEmailAppAvailable == AVAILABLE);
527 540
528#else //DESKTOP_VERSION 541#else //DESKTOP_VERSION
529 return false; 542 return false;
530#endif //DESKTOP_VERSION 543#endif //DESKTOP_VERSION
531} 544}
532 545
533bool ExternalAppHandler::isSMSAppAvailable() 546bool ExternalAppHandler::isSMSAppAvailable()
534{ 547{
535#ifndef DESKTOP_VERSION 548#ifndef DESKTOP_VERSION
536 if (mSMSAppAvailable == UNDEFINED) 549 if (mSMSAppAvailable == UNDEFINED)
537 { 550 {
538 int client = KPimGlobalPrefs::instance()->mSMSClient; 551 int client = KPimGlobalPrefs::instance()->mSMSClient;
539 if (client == KPimGlobalPrefs::NONE_SMC) 552 if (client == KPimGlobalPrefs::NONE_SMC)
540 mSMSAppAvailable = UNAVAILABLE; 553 mSMSAppAvailable = UNAVAILABLE;
541 else 554 else
542 mSMSAppAvailable = AVAILABLE; 555 mSMSAppAvailable = AVAILABLE;
543 } 556 }
544 557
545 return (mSMSAppAvailable == AVAILABLE); 558 return (mSMSAppAvailable == AVAILABLE);
546#else //DESKTOP_VERSION 559#else //DESKTOP_VERSION
547 return false; 560 return false;
548#endif //DESKTOP_VERSION 561#endif //DESKTOP_VERSION
549} 562}
550 563
551bool ExternalAppHandler::isPhoneAppAvailable() 564bool ExternalAppHandler::isPhoneAppAvailable()
552{ 565{
553#ifndef DESKTOP_VERSION 566#ifndef DESKTOP_VERSION
554 if (mPhoneAppAvailable == UNDEFINED) 567 if (mPhoneAppAvailable == UNDEFINED)
555 { 568 {
556 int client = KPimGlobalPrefs::instance()->mPhoneClient; 569 int client = KPimGlobalPrefs::instance()->mPhoneClient;
557 if (client == KPimGlobalPrefs::NONE_PHC) 570 if (client == KPimGlobalPrefs::NONE_PHC)
558 mPhoneAppAvailable = UNAVAILABLE; 571 mPhoneAppAvailable = UNAVAILABLE;
559 else 572 else
560 mPhoneAppAvailable = AVAILABLE; 573 mPhoneAppAvailable = AVAILABLE;
561 } 574 }
562 575
563 return (mPhoneAppAvailable == AVAILABLE); 576 return (mPhoneAppAvailable == AVAILABLE);
564#else //DESKTOP_VERSION 577#else //DESKTOP_VERSION
565 return false; 578 return false;
566#endif //DESKTOP_VERSION 579#endif //DESKTOP_VERSION
567} 580}
568 581
569bool ExternalAppHandler::isFaxAppAvailable() 582bool ExternalAppHandler::isFaxAppAvailable()
570{ 583{
571#ifndef DESKTOP_VERSION 584#ifndef DESKTOP_VERSION
572 if (mFaxAppAvailable == UNDEFINED) 585 if (mFaxAppAvailable == UNDEFINED)
573 { 586 {
574 int client = KPimGlobalPrefs::instance()->mFaxClient; 587 int client = KPimGlobalPrefs::instance()->mFaxClient;
575 if (client == KPimGlobalPrefs::NONE_FAC) 588 if (client == KPimGlobalPrefs::NONE_FAC)
576 mFaxAppAvailable = UNAVAILABLE; 589 mFaxAppAvailable = UNAVAILABLE;
577 else 590 else
578 mFaxAppAvailable = AVAILABLE; 591 mFaxAppAvailable = AVAILABLE;
579 } 592 }
580 593
581 return (mFaxAppAvailable == AVAILABLE); 594 return (mFaxAppAvailable == AVAILABLE);
582#else //DESKTOP_VERSION 595#else //DESKTOP_VERSION
583 return false; 596 return false;
584#endif //DESKTOP_VERSION 597#endif //DESKTOP_VERSION
585} 598}
586 599
587bool ExternalAppHandler::isPagerAppAvailable() 600bool ExternalAppHandler::isPagerAppAvailable()
588{ 601{
589#ifndef DESKTOP_VERSION 602#ifndef DESKTOP_VERSION
590 if (mPagerAppAvailable == UNDEFINED) 603 if (mPagerAppAvailable == UNDEFINED)
591 { 604 {
592 int client = KPimGlobalPrefs::instance()->mPagerClient; 605 int client = KPimGlobalPrefs::instance()->mPagerClient;
593 if (client == KPimGlobalPrefs::NONE_PAC) 606 if (client == KPimGlobalPrefs::NONE_PAC)
594 mPagerAppAvailable = UNAVAILABLE; 607 mPagerAppAvailable = UNAVAILABLE;
595 else 608 else
596 mPagerAppAvailable = AVAILABLE; 609 mPagerAppAvailable = AVAILABLE;
597 } 610 }
598 611
599 return (mPagerAppAvailable == AVAILABLE); 612 return (mPagerAppAvailable == AVAILABLE);
600#else //DESKTOP_VERSION 613#else //DESKTOP_VERSION
601 return false; 614 return false;
602#endif //DESKTOP_VERSION 615#endif //DESKTOP_VERSION
603} 616}
604 617
605 618
606bool ExternalAppHandler::isSIPAppAvailable() 619bool ExternalAppHandler::isSIPAppAvailable()
607{ 620{
608#ifndef DESKTOP_VERSION 621#ifndef DESKTOP_VERSION
609 if (mSIPAppAvailable == UNDEFINED) 622 if (mSIPAppAvailable == UNDEFINED)
610 { 623 {
611 int client = KPimGlobalPrefs::instance()->mSipClient; 624 int client = KPimGlobalPrefs::instance()->mSipClient;
612 if (client == KPimGlobalPrefs::NONE_SIC) 625 if (client == KPimGlobalPrefs::NONE_SIC)
613 mSIPAppAvailable = UNAVAILABLE; 626 mSIPAppAvailable = UNAVAILABLE;
614 else 627 else
615 mSIPAppAvailable = AVAILABLE; 628 mSIPAppAvailable = AVAILABLE;
616 } 629 }
617 630
618 return (mSIPAppAvailable == AVAILABLE); 631 return (mSIPAppAvailable == AVAILABLE);
619#else //DESKTOP_VERSION 632#else //DESKTOP_VERSION
620 return false; 633 return false;
621#endif //DESKTOP_VERSION 634#endif //DESKTOP_VERSION
622} 635}
623 636
624/************************************************************************** 637/**************************************************************************
625 * 638 *
626 **************************************************************************/ 639 **************************************************************************/
627 640
628 641
629//calls the emailapplication with a number of attachments that need to be send (Seperated by Comma) 642//calls the emailapplication with a number of attachments that need to be send (Seperated by Comma)
630bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QString& urls ) 643bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QString& urls )
631{ 644{
632 645
633#ifndef DESKTOP_VERSION 646#ifndef DESKTOP_VERSION
634 QString channel; 647 QString channel;
635 QString message2; 648 QString message2;
636 QString parameters2; 649 QString parameters2;
637 650
638 651
639 int client = KPimGlobalPrefs::instance()->mEmailClient; 652 int client = KPimGlobalPrefs::instance()->mEmailClient;
640 if (client == KPimGlobalPrefs::OTHER_EMC) 653 if (client == KPimGlobalPrefs::OTHER_EMC)
641 { 654 {
642 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel; 655 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel;
643 message2 = KPimGlobalPrefs::instance()->mEmailOtherMessage; 656 message2 = KPimGlobalPrefs::instance()->mEmailOtherMessage;
644 parameters2 = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters; 657 parameters2 = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters;
645 } 658 }
646 else 659 else
647 { 660 {
648 DefaultAppItem* dai = getDefaultItem(EMAIL, client); 661 DefaultAppItem* dai = getDefaultItem(EMAIL, client);
649 if (!dai) 662 if (!dai)
650 { 663 {
651 qDebug("could not find configured email application."); 664 qDebug("could not find configured email application.");
652 return false; 665 return false;
653 } 666 }
654 channel = dai->_channel; 667 channel = dai->_channel;
655 message2 = dai->_message2; 668 message2 = dai->_message2;
656 parameters2 = dai->_parameters2; 669 parameters2 = dai->_parameters2;
657 } 670 }
658 671
659 //first check if one of the mailers need the emails right in the message. 672 //first check if one of the mailers need the emails right in the message.
660 message2 = translateMessage(message2, emails, urls); 673 message2 = translateMessage(message2, emails, urls);
661 674
662 675
663#ifdef DEBUG_EXT_APP_HANDLER 676#ifdef DEBUG_EXT_APP_HANDLER
664 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); 677 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1());
665 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); 678 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1());
666#endif 679#endif
667 680
668 681
669 QCopEnvelope e(channel.latin1(), message2.latin1()); 682 QCopEnvelope e(channel.latin1(), message2.latin1());
670 //US we need no names in the To field. The emailadresses are enough 683 //US we need no names in the To field. The emailadresses are enough
671 684
672 passParameters(&e, parameters2, emails, urls); 685 passParameters(&e, parameters2, emails, urls);
673 686
674 687
675 688
676#else 689#else
677 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 690 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
678#endif 691#endif
679 692
680 return true; 693 return true;
681} 694}
682 695
683/************************************************************************** 696/**************************************************************************
684 * 697 *
685 **************************************************************************/ 698 **************************************************************************/
686 699
687 700
688//calls the emailapplication and creates a mail with parameter emails as recipients 701//calls the emailapplication and creates a mail with parameter emails as recipients
689bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress ) 702bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress )
690{ 703{
691#ifndef DESKTOP_VERSION 704#ifndef DESKTOP_VERSION
692 QString channel; 705 QString channel;
693 QString message; 706 QString message;
694 QString parameters; 707 QString parameters;
695 708
696 709
697 int client = KPimGlobalPrefs::instance()->mEmailClient; 710 int client = KPimGlobalPrefs::instance()->mEmailClient;
698 if (client == KPimGlobalPrefs::OTHER_EMC) 711 if (client == KPimGlobalPrefs::OTHER_EMC)
699 { 712 {
700 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel; 713 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel;
701 message = KPimGlobalPrefs::instance()->mEmailOtherMessage; 714 message = KPimGlobalPrefs::instance()->mEmailOtherMessage;
702 parameters = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters; 715 parameters = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters;
703 } 716 }
704 else 717 else
705 { 718 {
706 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client); 719 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client);
707 if (!dai) 720 if (!dai)
708 { 721 {
709 qDebug("could not find configured email application."); 722 qDebug("could not find configured email application.");
710 return false; 723 return false;
711 } 724 }
712 channel = dai->_channel; 725 channel = dai->_channel;
713 message = dai->_message; 726 message = dai->_message;
714 parameters = dai->_parameters; 727 parameters = dai->_parameters;
715 } 728 }
716 729
717 730
718 //first check if one of the mailers need the emails right in the message. 731 //first check if one of the mailers need the emails right in the message.
719 message = translateMessage(message, name, emailadress); 732 message = translateMessage(message, name, emailadress);
720 733
721 734
722#ifdef DEBUG_EXT_APP_HANDLER 735#ifdef DEBUG_EXT_APP_HANDLER
723 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 736 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
724 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 737 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
725#endif 738#endif
726 739
727 QCopEnvelope e(channel.latin1(), message.latin1()); 740 QCopEnvelope e(channel.latin1(), message.latin1());
728 //US we need no names in the To field. The emailadresses are enough 741 //US we need no names in the To field. The emailadresses are enough
729 742
730 passParameters(&e, parameters, name, emailadress); 743 passParameters(&e, parameters, name, emailadress);
731 744
732 745
733#else 746#else
734 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 747 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
735#endif 748#endif
736 749
737 750
738 return true; 751 return true;
739} 752}
740 753
741/************************************************************************** 754/**************************************************************************
742 * 755 *
743 **************************************************************************/ 756 **************************************************************************/
744 757
745//calls the emailapplication and creates a mail with parameter as recipients 758//calls the emailapplication and creates a mail with parameter as recipients
746// parameters format is 759// parameters format is
747// NAME <EMAIL>:SUBJECT 760// NAME <EMAIL>:SUBJECT
748bool ExternalAppHandler::mailToOneContact( const QString& adressline ) 761bool ExternalAppHandler::mailToOneContact( const QString& adressline )
749{ 762{
750 QString line = adressline; 763 QString line = adressline;
751 764
752 int first = line.find( "<"); 765 int first = line.find( "<");
753 int last = line.find( ">"); 766 int last = line.find( ">");
754 QString name = line.left(first); 767 QString name = line.left(first);
755 QString emailadress = line.mid(first+1, last-first-1); 768 QString emailadress = line.mid(first+1, last-first-1);
756 769
757 //Subject can not be handled right now. 770 //Subject can not be handled right now.
758 return mailToOneContact( name, emailadress ); 771 return mailToOneContact( name, emailadress );
759 772
760} 773}
761 774
762 775
763/************************************************************************** 776/**************************************************************************
764 * 777 *
765 **************************************************************************/ 778 **************************************************************************/
766 779
767//calls the phoneapplication with the number 780//calls the phoneapplication with the number
768bool ExternalAppHandler::callByPhone( const QString& phonenumber ) 781bool ExternalAppHandler::callByPhone( const QString& phonenumber )
769{ 782{
770#ifndef DESKTOP_VERSION 783#ifndef DESKTOP_VERSION
771 QString channel; 784 QString channel;
772 QString message; 785 QString message;
773 QString parameters; 786 QString parameters;
774 787
775 788
776 int client = KPimGlobalPrefs::instance()->mPhoneClient; 789 int client = KPimGlobalPrefs::instance()->mPhoneClient;
777 if (client == KPimGlobalPrefs::OTHER_PHC) 790 if (client == KPimGlobalPrefs::OTHER_PHC)
778 { 791 {
779 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel; 792 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel;
780 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage; 793 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage;
781 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters; 794 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters;
782 } 795 }
783 else 796 else
784 { 797 {
785 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client); 798 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client);
786 if (!dai) 799 if (!dai)
787 { 800 {
788 qDebug("could not find configured phone application."); 801 qDebug("could not find configured phone application.");
789 return false; 802 return false;
790 } 803 }
791 channel = dai->_channel; 804 channel = dai->_channel;
792 message = dai->_message; 805 message = dai->_message;
793 parameters = dai->_parameters; 806 parameters = dai->_parameters;
794 } 807 }
795 808
796 809
797 //first check if one of the mailers need the emails right in the message. 810 //first check if one of the mailers need the emails right in the message.
798 message = translateMessage(message, phonenumber, ""); 811 message = translateMessage(message, phonenumber, "");
799 812
800 813
801#ifdef DEBUG_EXT_APP_HANDLER 814#ifdef DEBUG_EXT_APP_HANDLER
802 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 815 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
803 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 816 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
804#endif 817#endif
805 818
806 QCopEnvelope e(channel.latin1(), message.latin1()); 819 QCopEnvelope e(channel.latin1(), message.latin1());
807 //US we need no names in the To field. The emailadresses are enough 820 //US we need no names in the To field. The emailadresses are enough
808 821
809 passParameters(&e, parameters, phonenumber, ""); 822 passParameters(&e, parameters, phonenumber, "");
810 823
811 824
812#else 825#else
813 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) ); 826 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) );
814#endif 827#endif
815 828
816 829
817 return true; 830 return true;
818} 831}
819 832
820/************************************************************************** 833/**************************************************************************
821 * 834 *
822 **************************************************************************/ 835 **************************************************************************/
823 836
824//calls the smsapplication with the number 837//calls the smsapplication with the number
825bool ExternalAppHandler::callBySMS( const QString& phonenumber ) 838bool ExternalAppHandler::callBySMS( const QString& phonenumber )
826{ 839{
827#ifndef DESKTOP_VERSION 840#ifndef DESKTOP_VERSION
828 QString channel; 841 QString channel;
829 QString message; 842 QString message;
830 QString parameters; 843 QString parameters;
831 844
832 845
833 int client = KPimGlobalPrefs::instance()->mSMSClient; 846 int client = KPimGlobalPrefs::instance()->mSMSClient;
834 if (client == KPimGlobalPrefs::OTHER_SMC) 847 if (client == KPimGlobalPrefs::OTHER_SMC)
835 { 848 {
836 channel = KPimGlobalPrefs::instance()->mSMSOtherChannel; 849 channel = KPimGlobalPrefs::instance()->mSMSOtherChannel;
837 message = KPimGlobalPrefs::instance()->mSMSOtherMessage; 850 message = KPimGlobalPrefs::instance()->mSMSOtherMessage;
838 parameters = KPimGlobalPrefs::instance()->mSMSOtherMessageParameters; 851 parameters = KPimGlobalPrefs::instance()->mSMSOtherMessageParameters;
839 } 852 }
840 else 853 else
841 { 854 {
842 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client); 855 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client);
843 if (!dai) 856 if (!dai)
844 { 857 {
845 qDebug("could not find configured sms application."); 858 qDebug("could not find configured sms application.");
846 return false; 859 return false;
847 } 860 }
848 channel = dai->_channel; 861 channel = dai->_channel;
849 message = dai->_message; 862 message = dai->_message;
850 parameters = dai->_parameters; 863 parameters = dai->_parameters;
851 } 864 }
852 865
853 866
854 //first check if one of the mailers need the emails right in the message. 867 //first check if one of the mailers need the emails right in the message.
855 message = translateMessage(message, phonenumber, ""); 868 message = translateMessage(message, phonenumber, "");
856 869
857 870
858#ifdef DEBUG_EXT_APP_HANDLER 871#ifdef DEBUG_EXT_APP_HANDLER
859 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 872 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
860 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 873 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
861#endif 874#endif
862 875
863 QCopEnvelope e(channel.latin1(), message.latin1()); 876 QCopEnvelope e(channel.latin1(), message.latin1());
864 //US we need no names in the To field. The emailadresses are enough 877 //US we need no names in the To field. The emailadresses are enough
865 878
866 passParameters(&e, parameters, phonenumber, ""); 879 passParameters(&e, parameters, phonenumber, "");
867 880
868 881
869#else 882#else
870 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) ); 883 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) );
871#endif 884#endif
872 885
873 886
874 return true; 887 return true;
875} 888}
876 889
877/************************************************************************** 890/**************************************************************************
878 * 891 *
879 **************************************************************************/ 892 **************************************************************************/
880 893
881//calls the pagerapplication with the number 894//calls the pagerapplication with the number
882bool ExternalAppHandler::callByPager( const QString& pagernumber ) 895bool ExternalAppHandler::callByPager( const QString& pagernumber )
883{ 896{
884#ifndef DESKTOP_VERSION 897#ifndef DESKTOP_VERSION
885 QString channel; 898 QString channel;
886 QString message; 899 QString message;
887 QString parameters; 900 QString parameters;
888 901
889 902
890 int client = KPimGlobalPrefs::instance()->mPagerClient; 903 int client = KPimGlobalPrefs::instance()->mPagerClient;
891 if (client == KPimGlobalPrefs::OTHER_PAC) 904 if (client == KPimGlobalPrefs::OTHER_PAC)
892 { 905 {
893 channel = KPimGlobalPrefs::instance()->mPagerOtherChannel; 906 channel = KPimGlobalPrefs::instance()->mPagerOtherChannel;
894 message = KPimGlobalPrefs::instance()->mPagerOtherMessage; 907 message = KPimGlobalPrefs::instance()->mPagerOtherMessage;
895 parameters = KPimGlobalPrefs::instance()->mPagerOtherMessageParameters; 908 parameters = KPimGlobalPrefs::instance()->mPagerOtherMessageParameters;
896 } 909 }
897 else 910 else
898 { 911 {
899 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client); 912 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client);
900 if (!dai) 913 if (!dai)
901 { 914 {
902 qDebug("could not find configured pager application."); 915 qDebug("could not find configured pager application.");
903 return false; 916 return false;
904 } 917 }
905 channel = dai->_channel; 918 channel = dai->_channel;
906 message = dai->_message; 919 message = dai->_message;
907 parameters = dai->_parameters; 920 parameters = dai->_parameters;
908 } 921 }
909 922
910 923
911 //first check if one of the mailers need the emails right in the message. 924 //first check if one of the mailers need the emails right in the message.
912 message = translateMessage(message, pagernumber, ""); 925 message = translateMessage(message, pagernumber, "");
913 926
914 927
915#ifdef DEBUG_EXT_APP_HANDLER 928#ifdef DEBUG_EXT_APP_HANDLER
916 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 929 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
917 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1()); 930 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1());
918#endif 931#endif
919 932
920 QCopEnvelope e(channel.latin1(), message.latin1()); 933 QCopEnvelope e(channel.latin1(), message.latin1());
921 //US we need no names in the To field. The emailadresses are enough 934 //US we need no names in the To field. The emailadresses are enough
922 935
923 passParameters(&e, parameters, pagernumber, ""); 936 passParameters(&e, parameters, pagernumber, "");
924 937
925 938
926#else 939#else
927 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) ); 940 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) );
928#endif 941#endif
929 942
930 943
931 return true; 944 return true;
932} 945}
933 946
934/************************************************************************** 947/**************************************************************************
935 * 948 *
936 **************************************************************************/ 949 **************************************************************************/
937 950
938//calls the faxapplication with the number 951//calls the faxapplication with the number
939bool ExternalAppHandler::callByFax( const QString& faxnumber ) 952bool ExternalAppHandler::callByFax( const QString& faxnumber )
940{ 953{
941#ifndef DESKTOP_VERSION 954#ifndef DESKTOP_VERSION
942 QString channel; 955 QString channel;
943 QString message; 956 QString message;
944 QString parameters; 957 QString parameters;
945 958
946 959
947 int client = KPimGlobalPrefs::instance()->mFaxClient; 960 int client = KPimGlobalPrefs::instance()->mFaxClient;
948 if (client == KPimGlobalPrefs::OTHER_FAC) 961 if (client == KPimGlobalPrefs::OTHER_FAC)
949 { 962 {
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 11c534a..5e27e85 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -1,142 +1,143 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 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 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 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 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 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. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KPIMGLOBALPREFS_H 31#ifndef KPIMGLOBALPREFS_H
32#define KPIMGLOBALPREFS_H 32#define KPIMGLOBALPREFS_H
33 33
34#include "kprefs.h" 34#include "kprefs.h"
35#include <qdict.h> 35#include <qdict.h>
36 36
37class KPimGlobalPrefs : public KPrefs 37class KPimGlobalPrefs : public KPrefs
38{ 38{
39 public: 39 public:
40 40
41 void setGlobalConfig(); 41 void setGlobalConfig();
42 static KPimGlobalPrefs *instance(); 42 static KPimGlobalPrefs *instance();
43 43
44 44
45 virtual ~KPimGlobalPrefs(); 45 virtual ~KPimGlobalPrefs();
46 46
47 47
48 enum EMailClients { 48 enum EMailClients {
49 NONE_EMC = 0, 49 NONE_EMC = 0,
50 OTHER_EMC = 1, 50 OTHER_EMC = 1,
51 OMPI_EMC = 2, 51 OMPI_EMC = 2,
52 QTOPIA_EMC = 3, 52 QTOPIA_EMC = 3,
53 OPIE_EMC = 4 53 OPIE_EMC = 4,
54 OPIE_MAILIT_EMC = 5
54 }; 55 };
55 56
56 enum PhoneClients { 57 enum PhoneClients {
57 NONE_PHC = 0, 58 NONE_PHC = 0,
58 OTHER_PHC = 1, 59 OTHER_PHC = 1,
59 KPPI_PHC = 2 60 KPPI_PHC = 2
60 }; 61 };
61 62
62 enum FaxClients { 63 enum FaxClients {
63 NONE_FAC = 0, 64 NONE_FAC = 0,
64 OTHER_FAC = 1 65 OTHER_FAC = 1
65 }; 66 };
66 67
67 enum SMSClients { 68 enum SMSClients {
68 NONE_SMC = 0, 69 NONE_SMC = 0,
69 OTHER_SMC = 1 70 OTHER_SMC = 1
70 }; 71 };
71 72
72 enum PagerClients { 73 enum PagerClients {
73 NONE_PAC = 0, 74 NONE_PAC = 0,
74 OTHER_PAC = 1 75 OTHER_PAC = 1
75 }; 76 };
76 77
77 enum SIPClients { 78 enum SIPClients {
78 NONE_SIC = 0, 79 NONE_SIC = 0,
79 OTHER_SIC = 1, 80 OTHER_SIC = 1,
80 KPPI_SIC = 2 81 KPPI_SIC = 2
81 }; 82 };
82 83
83 private: 84 private:
84 KPimGlobalPrefs( const QString &name = QString::null ); 85 KPimGlobalPrefs( const QString &name = QString::null );
85 86
86 static KPimGlobalPrefs *sInstance; 87 static KPimGlobalPrefs *sInstance;
87 QDict<QString> *mLocaleDict; 88 QDict<QString> *mLocaleDict;
88 89
89 90
90 public: 91 public:
91 //US I copied the following "locale" settings from KOPrefs 92 //US I copied the following "locale" settings from KOPrefs
92 int mPreferredDate; 93 int mPreferredDate;
93 QString mUserDateFormatLong; 94 QString mUserDateFormatLong;
94 QString mUserDateFormatShort; 95 QString mUserDateFormatShort;
95 int mPreferredLanguage; 96 int mPreferredLanguage;
96 int mPreferredTime; 97 int mPreferredTime;
97 bool mWeekStartsOnSunday; 98 bool mWeekStartsOnSunday;
98 QString mTimeZoneId; 99 QString mTimeZoneId;
99 bool mUseDaylightsaving; 100 bool mUseDaylightsaving;
100 int mDaylightsavingStart; 101 int mDaylightsavingStart;
101 int mDaylightsavingEnd; 102 int mDaylightsavingEnd;
102 bool mTimeZoneAdd30min; 103 bool mTimeZoneAdd30min;
103 104
104 int mEmailClient; 105 int mEmailClient;
105 QString mEmailOtherChannel; 106 QString mEmailOtherChannel;
106 QString mEmailOtherMessage; 107 QString mEmailOtherMessage;
107 QString mEmailOtherMessageParameters; 108 QString mEmailOtherMessageParameters;
108 QString mEmailOtherMessage2; 109 QString mEmailOtherMessage2;
109 QString mEmailOtherMessageParameters2; 110 QString mEmailOtherMessageParameters2;
110 111
111 int mPhoneClient; 112 int mPhoneClient;
112 QString mPhoneOtherChannel; 113 QString mPhoneOtherChannel;
113 QString mPhoneOtherMessage; 114 QString mPhoneOtherMessage;
114 QString mPhoneOtherMessageParameters; 115 QString mPhoneOtherMessageParameters;
115 116
116 int mFaxClient; 117 int mFaxClient;
117 QString mFaxOtherChannel; 118 QString mFaxOtherChannel;
118 QString mFaxOtherMessage; 119 QString mFaxOtherMessage;
119 QString mFaxOtherMessageParameters; 120 QString mFaxOtherMessageParameters;
120 121
121 int mSMSClient; 122 int mSMSClient;
122 QString mSMSOtherChannel; 123 QString mSMSOtherChannel;
123 QString mSMSOtherMessage; 124 QString mSMSOtherMessage;
124 QString mSMSOtherMessageParameters; 125 QString mSMSOtherMessageParameters;
125 126
126 int mPagerClient; 127 int mPagerClient;
127 QString mPagerOtherChannel; 128 QString mPagerOtherChannel;
128 QString mPagerOtherMessage; 129 QString mPagerOtherMessage;
129 QString mPagerOtherMessageParameters; 130 QString mPagerOtherMessageParameters;
130 131
131 int mSipClient; 132 int mSipClient;
132 QString mSipOtherChannel; 133 QString mSipOtherChannel;
133 QString mSipOtherMessage; 134 QString mSipOtherMessage;
134 QString mSipOtherMessageParameters; 135 QString mSipOtherMessageParameters;
135 136
136 QString mEx2PhoneDevice; 137 QString mEx2PhoneDevice;
137 QString mEx2PhoneConnection; 138 QString mEx2PhoneConnection;
138 QString mEx2PhoneModel; 139 QString mEx2PhoneModel;
139 140
140}; 141};
141 142
142#endif 143#endif