summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.h
Unidiff
Diffstat (limited to 'libkdepim/externalapphandler.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 1b04b2b..cfe577b 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -112,150 +112,156 @@ class QCopListTransferItem : public QCopTransferItem
112 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);
113 113
114}; 114};
115 115
116/********************************************************************************* 116/*********************************************************************************
117 * 117 *
118 ********************************************************************************/ 118 ********************************************************************************/
119 119
120 120
121class DefaultAppItem 121class DefaultAppItem
122{ 122{
123 public: 123 public:
124 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) 124 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2)
125 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) 125 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2)
126 {} 126 {}
127 127
128 DefaultAppItem() 128 DefaultAppItem()
129 { } 129 { }
130 130
131 public: 131 public:
132 int _type; 132 int _type;
133 int _id; 133 int _id;
134 QString _label; 134 QString _label;
135 QString _channel; 135 QString _channel;
136 QString _message; 136 QString _message;
137 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; 137 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ;
138 QString _message2; 138 QString _message2;
139 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; 139 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ;
140 140
141}; 141};
142 142
143/********************************************************************************* 143/*********************************************************************************
144 * 144 *
145 ********************************************************************************/ 145 ********************************************************************************/
146 146
147class ExternalAppHandler : public QObject 147class ExternalAppHandler : public QObject
148{ 148{
149 Q_OBJECT 149 Q_OBJECT
150 public: 150 public:
151 virtual ~ExternalAppHandler(); 151 virtual ~ExternalAppHandler();
152 152
153 static ExternalAppHandler *instance(); 153 static ExternalAppHandler *instance();
154 154
155 enum Types { 155 enum Types {
156 EMAIL = 0, 156 EMAIL = 0,
157 PHONE = 1, 157 PHONE = 1,
158 SMS = 2, 158 SMS = 2,
159 FAX = 3, 159 FAX = 3,
160 PAGER = 4 160 PAGER = 4,
161 SIP = 5
161 }; 162 };
162 163
163 enum Availability { 164 enum Availability {
164 UNDEFINED = -1, 165 UNDEFINED = -1,
165 UNAVAILABLE = 0, 166 UNAVAILABLE = 0,
166 AVAILABLE = 1 167 AVAILABLE = 1
167 }; 168 };
168 169
169 //calls the emailapplication with a number of attachments that need to be send. 170 //calls the emailapplication with a number of attachments that need to be send.
170 //either parameter can be left empty. 171 //either parameter can be left empty.
171 bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls ); 172 bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls );
172 173
173 //calls the emailapplication and creates a mail with parameter emailadress as recipients 174 //calls the emailapplication and creates a mail with parameter emailadress as recipients
174 bool mailToOneContact( const QString& name, const QString& emailadress ); 175 bool mailToOneContact( const QString& name, const QString& emailadress );
175 176
176 //calls the emailapplication and creates a mail with parameter as recipients 177 //calls the emailapplication and creates a mail with parameter as recipients
177 // parameters format is 178 // parameters format is
178 // NAME <EMAIL>:SUBJECT 179 // NAME <EMAIL>:SUBJECT
179 bool mailToOneContact( const QString& adressline ); 180 bool mailToOneContact( const QString& adressline );
180 181
181 //calls the phoneapplication with the number 182 //calls the phoneapplication with the number
182 bool callByPhone( const QString& phonenumber ); 183 bool callByPhone( const QString& phonenumber );
183 184
184 //calls the smsapplication with the number 185 //calls the smsapplication with the number
185 bool callBySMS( const QString& phonenumber ); 186 bool callBySMS( const QString& phonenumber );
186 187
187 //calls the pagerapplication with the number 188 //calls the pagerapplication with the number
188 bool callByPager( const QString& pagernumber ); 189 bool callByPager( const QString& pagernumber );
189 190
190 //calls the faxapplication with the number 191 //calls the faxapplication with the number
191 bool callByFax( const QString& faxnumber ); 192 bool callByFax( const QString& faxnumber );
192 193
194 //calls the sipapplication with the number
195 bool callBySIP( const QString& sipnumber );
196
193 bool isEmailAppAvailable(); 197 bool isEmailAppAvailable();
194 bool isSMSAppAvailable(); 198 bool isSMSAppAvailable();
195 bool isPhoneAppAvailable(); 199 bool isPhoneAppAvailable();
196 bool isFaxAppAvailable(); 200 bool isFaxAppAvailable();
197 bool isPagerAppAvailable(); 201 bool isPagerAppAvailable();
202 bool isSIPAppAvailable();
198 203
199 204
200 //Call this method on the source when you want to select names from the addressbook by using QCop 205 //Call this method on the source when you want to select names from the addressbook by using QCop
201 bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid); 206 bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid);
202 //Call this method on the target when you want to return the name/email map to the source (client). 207 //Call this method on the target when you want to return the name/email map to the source (client).
203 bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); 208 bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid);
204 209
205 bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email); 210 bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email);
206 bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); 211 bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid);
207 212
208 bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid); 213 bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid);
209 214
210 215
211 //loadConfig clears the cache and checks again if the applications are available or not 216 //loadConfig clears the cache and checks again if the applications are available or not
212 void loadConfig(); 217 void loadConfig();
213 218
214 QList<DefaultAppItem> getAvailableDefaultItems(Types); 219 QList<DefaultAppItem> getAvailableDefaultItems(Types);
215 DefaultAppItem* getDefaultItem(Types, int); 220 DefaultAppItem* getDefaultItem(Types, int);
216 221
217 public slots: 222 public slots:
218 void appMessage( const QCString& msg, const QByteArray& data ); 223 void appMessage( const QCString& msg, const QByteArray& data );
219 224
220 225
221 signals: 226 signals:
222 // Emmitted when the target app receives a request from the source app 227 // Emmitted when the target app receives a request from the source app
223 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); 228 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid);
224 229
225 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi 230 // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
226 // The first parameter is a uniqueid. It can be used to identify the event 231 // The first parameter is a uniqueid. It can be used to identify the event
227 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); 232 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
228 233
229 void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); 234 void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email);
230 void receivedFindBbyEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); 235 void receivedFindBbyEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
231 236
232 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); 237 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
233 238
234 239
235 private: 240 private:
236 ExternalAppHandler(); 241 ExternalAppHandler();
237 QList<DefaultAppItem> mDefaultItems; 242 QList<DefaultAppItem> mDefaultItems;
238 243
239 Availability mEmailAppAvailable; 244 Availability mEmailAppAvailable;
240 Availability mPhoneAppAvailable; 245 Availability mPhoneAppAvailable;
241 Availability mFaxAppAvailable; 246 Availability mFaxAppAvailable;
242 Availability mSMSAppAvailable; 247 Availability mSMSAppAvailable;
243 Availability mPagerAppAvailable; 248 Availability mPagerAppAvailable;
249 Availability mSIPAppAvailable;
244 250
245 QCopListTransferItem* mNameEmailUidListFromKAPITransfer; 251 QCopListTransferItem* mNameEmailUidListFromKAPITransfer;
246 QCopListTransferItem* mFindByEmailFromKAPITransfer; 252 QCopListTransferItem* mFindByEmailFromKAPITransfer;
247 QCopTransferItem* mDisplayDetails; 253 QCopTransferItem* mDisplayDetails;
248 254
249 255
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); 256 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2);
251 257
252 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const; 258 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const;
253 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const; 259 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const;
254 260
255 261
256 static ExternalAppHandler *sInstance; 262 static ExternalAppHandler *sInstance;
257 263
258}; 264};
259 265
260 266
261#endif 267#endif