summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp87
-rw-r--r--libkdepim/externalapphandler.h19
2 files changed, 77 insertions, 29 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 64caa7d..b57506b 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -41,51 +41,59 @@ $Id$
41#include <kmessagebox.h> 41#include <kmessagebox.h>
42 42
43 43
44#include "externalapphandler.h" 44#include "externalapphandler.h"
45 45
46#include "kpimglobalprefs.h" 46#include "kpimglobalprefs.h"
47 47
48/********************************************************************************* 48/*********************************************************************************
49 * 49 *
50 ********************************************************************************/ 50 ********************************************************************************/
51 51
52 52
53QCopTransferItem::QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 53QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
54 : _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) 54 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage)
55{ 55{
56 //sourceMessage passes later three parameters: sourceChannel, uid, param1 56 //sourceMessage passes later three parameters: sourceChannel, uid, param1
57 _sourceMessageParameters = "(QString,QString,QString)"; 57 _sourceMessageParameters = "(QString,QString,QString)";
58} 58}
59 59
60/*********************************************************************************/ 60/*********************************************************************************/
61 61
62QCopTransferItem::QCopTransferItem() 62QCopTransferItem::QCopTransferItem()
63{ 63{
64} 64}
65 65
66/*********************************************************************************/ 66/*********************************************************************************/
67bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1) 67bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
68{ 68{
69 69
70#ifndef DESKTOP_VERSION 70#ifndef DESKTOP_VERSION
71 //sourceMessage passes two parameters: sourceChannel, uid 71 //sourceMessage passes two parameters: sourceChannel, uid
72 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 72 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
73 73
74 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 74 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
75 qDebug("passing sourcechannel(%s), uid(%s), param1(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1()); 75 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param3(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1());
76 76
77 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 77 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
78 78
79 e << _sourceChannel << uid << param1; 79 e << _sourceChannel << uid;
80
81 if (_usedSourceParameters == 1)
82 e << param1;
83 else if (_usedSourceParameters == 2)
84 e << param1 << param2;
85 else if (_usedSourceParameters == 3)
86 e << param1 << param2 << param3;
87
80 88
81 return true; 89 return true;
82 90
83#else 91#else
84 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 92 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
85 return false; 93 return false;
86#endif 94#endif
87 95
88} 96}
89 97
90 98
91/*********************************************************************************/ 99/*********************************************************************************/
@@ -115,43 +123,63 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data
115*/ 123*/
116 qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); 124 qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
117 125
118 //we are in the target and get a request from the source 126 //we are in the target and get a request from the source
119 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) 127 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data())
120 { 128 {
121 QDataStream stream( data, IO_ReadOnly ); 129 QDataStream stream( data, IO_ReadOnly );
122 130
123 131
124 QString sourceChannel; 132 QString sourceChannel;
125 QString uid; 133 QString uid;
126 QString param1; 134 QString param1;
135 QString param2;
136 QString param3;
127 137
128 stream >> sourceChannel >> uid >> param1; 138 stream >> sourceChannel >> uid;
129 139
130 emit receivedMessageFromSource(sourceChannel, uid, param1); 140 if (_usedSourceParameters == 0)
141 {
142 emit receivedMessageFromSource(sourceChannel, uid);
143 }
144 else if (_usedSourceParameters == 1)
145 {
146 stream >> param1;
147 emit receivedMessageFromSource(sourceChannel, uid, param1);
148 }
149 else if (_usedSourceParameters == 2)
150 {
151 stream >> param1 >> param2;
152 emit receivedMessageFromSource(sourceChannel, uid, param1, param2);
153 }
154 else if (_usedSourceParameters == 3)
155 {
156 stream >> param1 >> param2 >> param3;
157 emit receivedMessageFromSource(sourceChannel, uid, param1, param2, param3);
158 }
131 159
132 return true; 160 return true;
133 } 161 }
134 162
135 return false; 163 return false;
136} 164}
137 165
138 166
139/********************************************************************************* 167/*********************************************************************************
140 * 168 *
141 ********************************************************************************/ 169 ********************************************************************************/
142 170
143 171
144QCopMapTransferItem::QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 172QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
145 : QCopTransferItem(sourceMessage, targetChannel,targetMessage) 173 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
146{ 174{
147 //targetMessage returns later two parameters: uid, and map<qstring,qstring> 175 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
148 _targetMessageParameters = "(QString,QMAP<QString,QString>)"; 176 _targetMessageParameters = "(QString,QMAP<QString,QString>)";
149} 177}
150 178
151/*********************************************************************************/ 179/*********************************************************************************/
152bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 180bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
153{ 181{
154#ifndef DESKTOP_VERSION 182#ifndef DESKTOP_VERSION
155 //targetMessage passes two parameters: uid, map 183 //targetMessage passes two parameters: uid, map
156 QString targetMessage = _targetMessage + _targetMessageParameters; 184 QString targetMessage = _targetMessage + _targetMessageParameters;
157 185
@@ -199,28 +227,28 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
199 } 227 }
200 } 228 }
201 229
202 return false; 230 return false;
203} 231}
204 232
205 233
206/********************************************************************************* 234/*********************************************************************************
207 * 235 *
208 ********************************************************************************/ 236 ********************************************************************************/
209 237
210 238
211QCopListTransferItem::QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 239QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
212 : QCopTransferItem(sourceMessage, targetChannel,targetMessage) 240 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
213{ 241{
214 //targetMessage returns later two parameters: uid, and map<qstring,qstring> 242 //targetMessage returns later two parameters: uid, and three lists
215 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)"; 243 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)";
216} 244}
217 245
218/*********************************************************************************/ 246/*********************************************************************************/
219bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 247bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
220{ 248{
221#ifndef DESKTOP_VERSION 249#ifndef DESKTOP_VERSION
222 //targetMessage passes two parameters: uid, map 250 //targetMessage passes two parameters: uid, map
223 QString targetMessage = _targetMessage + _targetMessageParameters; 251 QString targetMessage = _targetMessage + _targetMessageParameters;
224 252
225 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 253 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
226 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1()); 254 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1());
@@ -276,33 +304,34 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
276/********************************************************************************* 304/*********************************************************************************
277 * 305 *
278 ********************************************************************************/ 306 ********************************************************************************/
279 307
280 308
281ExternalAppHandler *ExternalAppHandler::sInstance = 0; 309ExternalAppHandler *ExternalAppHandler::sInstance = 0;
282static KStaticDeleter<ExternalAppHandler> staticDeleter; 310static KStaticDeleter<ExternalAppHandler> staticDeleter;
283 311
284ExternalAppHandler::ExternalAppHandler() 312ExternalAppHandler::ExternalAppHandler()
285{ 313{
286 mDefaultItems.setAutoDelete(true); 314 mDefaultItems.setAutoDelete(true);
287 315
288 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem("requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); 316 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
289 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&))); 317 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
290 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 318 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
291 319
292//US mFindByEmailFromKAPITransfer = new QCopListTransferItem("requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); 320//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
293//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); 321//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
294//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 322//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
295 323
296 324 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
325 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
297} 326}
298 327
299ExternalAppHandler::~ExternalAppHandler() 328ExternalAppHandler::~ExternalAppHandler()
300{ 329{
301} 330}
302 331
303void ExternalAppHandler::loadConfig() 332void ExternalAppHandler::loadConfig()
304{ 333{
305 334
306 mDefaultItems.clear(); 335 mDefaultItems.clear();
307 336
308 mEmailAppAvailable = UNDEFINED; 337 mEmailAppAvailable = UNDEFINED;
@@ -915,45 +944,55 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
915} 944}
916 945
917 946
918 947
919/************************************************************************** 948/**************************************************************************
920 * 949 *
921 **************************************************************************/ 950 **************************************************************************/
922 951
923void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) 952void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
924{ 953{
925 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 954 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
926 955
956 if (!res)
957 res = mDisplayDetails->appMessage( cmsg, data );
958
927// if (!res) 959// if (!res)
928// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 960// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
929} 961}
930 962
931 963
932 964
933bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid) 965bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
934{ 966{
935 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 967 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
936 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(uid, QString::null); 968 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid);
937} 969}
938 970
939bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 971bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
940{ 972{
941 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 973 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
942 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3); 974 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
943} 975}
944 976
945bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email) 977bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
946{ 978{
947 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 979 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
948 return mFindByEmailFromKAPITransfer->sendMessageToTarget(uid, email); 980 return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email);
949} 981}
950 982
951bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 983bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
952{ 984{
953 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 985 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
954 return mFindByEmailFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3); 986 return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
955} 987}
956 988
989bool ExternalAppHandler::requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
990{
991 mDisplayDetails->setSourceChannel(sourceChannel);
992 return mDisplayDetails->sendMessageToTarget(sessionuid, name, email, uid);
993}
994
995
957 996
958 997
959 998
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 7c8de4e..a74080f 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -34,78 +34,82 @@ $Id$
34#include <qobject.h> 34#include <qobject.h>
35#include <qlist.h> 35#include <qlist.h>
36#include <qmap.h> 36#include <qmap.h>
37 37
38class QCopEnvelope; 38class QCopEnvelope;
39 39
40 40
41class ExternalAppHandler; 41class ExternalAppHandler;
42class QCopTransferItem : public QObject 42class QCopTransferItem : public QObject
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 public: 45 public:
46 QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 46 QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
47 QCopTransferItem(); 47 QCopTransferItem();
48 48
49 bool sendMessageToTarget(const QString& uid, const QString& param1); 49 bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null);
50 50
51 void setSourceChannel(const QString& sourceChannel); 51 void setSourceChannel(const QString& sourceChannel);
52 52
53 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 53 virtual bool appMessage( const QCString& msg, const QByteArray& data );
54 54
55 55
56 signals: 56 signals:
57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid);
57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); 58 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1);
59 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2);
60 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3);
58 61
59 62
60 public: 63 public:
64 int _usedSourceParameters;
61 QString _sourceChannel; 65 QString _sourceChannel;
62 QString _sourceMessage; 66 QString _sourceMessage;
63 QString _sourceMessageParameters; 67 QString _sourceMessageParameters;
64 QString _targetChannel; 68 QString _targetChannel;
65 QString _targetMessage; 69 QString _targetMessage;
66 QString _targetMessageParameters; 70 QString _targetMessageParameters;
67 71
68}; 72};
69 73
70/********************************************************************************* 74/*********************************************************************************
71 * 75 *
72 ********************************************************************************/ 76 ********************************************************************************/
73 77
74class QCopMapTransferItem : public QCopTransferItem 78class QCopMapTransferItem : public QCopTransferItem
75{ 79{
76 Q_OBJECT 80 Q_OBJECT
77 public: 81 public:
78 QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 82 QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
79 83
80 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); 84 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap);
81 85
82 86
83 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 87 virtual bool appMessage( const QCString& msg, const QByteArray& data );
84 88
85 89
86 signals: 90 signals:
87 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); 91 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap);
88 92
89}; 93};
90 94
91/********************************************************************************* 95/*********************************************************************************
92 * 96 *
93 ********************************************************************************/ 97 ********************************************************************************/
94 98
95class QCopListTransferItem : public QCopTransferItem 99class QCopListTransferItem : public QCopTransferItem
96{ 100{
97 Q_OBJECT 101 Q_OBJECT
98 public: 102 public:
99 QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); 103 QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
100 104
101 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3); 105 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
102 106
103 107
104 virtual bool appMessage( const QCString& msg, const QByteArray& data ); 108 virtual bool appMessage( const QCString& msg, const QByteArray& data );
105 109
106 110
107 signals: 111 signals:
108 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3); 112 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
109 113
110}; 114};
111 115
@@ -192,59 +196,64 @@ class ExternalAppHandler : public QObject
192 bool isFaxAppAvailable(); 196 bool isFaxAppAvailable();
193 bool isPagerAppAvailable(); 197 bool isPagerAppAvailable();
194 198
195 199
196 //Call this method on the source when you want to select names from the addressbook by using QCop 200 //Call this method on the source when you want to select names from the addressbook by using QCop
197 bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid); 201 bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid);
198 //Call this method on the target when you want to return the name/email map to the source (client). 202 //Call this method on the target when you want to return the name/email map to the source (client).
199 bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid); 203 bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid);
200 204
201 bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email); 205 bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email);
202 bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid); 206 bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid);
203 207
208 bool requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
209
204 210
205 //loadConfig clears the cache and checks again if the applications are available or not 211 //loadConfig clears the cache and checks again if the applications are available or not
206 void loadConfig(); 212 void loadConfig();
207 213
208 QList<DefaultAppItem> getAvailableDefaultItems(Types); 214 QList<DefaultAppItem> getAvailableDefaultItems(Types);
209 DefaultAppItem* getDefaultItem(Types, int); 215 DefaultAppItem* getDefaultItem(Types, int);
210 216
211 public slots: 217 public slots:
212 void appMessage( const QCString& msg, const QByteArray& data ); 218 void appMessage( const QCString& msg, const QByteArray& data );
213 219
214 220
215 signals: 221 signals:
216 // Emmitted when the target app receives a request from the source app 222 // Emmitted when the target app receives a request from the source app
217 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1); 223 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid);
218 224
219 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi 225 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
220 // The first parameter is a uniqueid. It can be used to identify the event 226 // The first parameter is a uniqueid. It can be used to identify the event
221 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); 227 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
222 228
223 void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); 229 void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email);
224 void receivedFindBbyEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); 230 void receivedFindBbyEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
225 231
232 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
233
226 234
227 private: 235 private:
228 ExternalAppHandler(); 236 ExternalAppHandler();
229 QList<DefaultAppItem> mDefaultItems; 237 QList<DefaultAppItem> mDefaultItems;
230 238
231 Availability mEmailAppAvailable; 239 Availability mEmailAppAvailable;
232 Availability mPhoneAppAvailable; 240 Availability mPhoneAppAvailable;
233 Availability mFaxAppAvailable; 241 Availability mFaxAppAvailable;
234 Availability mSMSAppAvailable; 242 Availability mSMSAppAvailable;
235 Availability mPagerAppAvailable; 243 Availability mPagerAppAvailable;
236 244
237 QCopListTransferItem* mNameEmailUidListFromKAPITransfer; 245 QCopListTransferItem* mNameEmailUidListFromKAPITransfer;
238 QCopListTransferItem* mFindByEmailFromKAPITransfer; 246 QCopListTransferItem* mFindByEmailFromKAPITransfer;
247 QCopTransferItem* mDisplayDetails;
239 248
240 249
241 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); 250 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2);
242 251
243 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const; 252 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const;
244 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const; 253 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const;
245 254
246 255
247 static ExternalAppHandler *sInstance; 256 static ExternalAppHandler *sInstance;
248 257
249}; 258};
250 259