summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h3
-rw-r--r--kaddressbook/mainembedded.cpp19
-rw-r--r--libkdepim/externalapphandler.cpp282
-rw-r--r--libkdepim/externalapphandler.h111
5 files changed, 435 insertions, 13 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6807bed..e7c815e 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -22,96 +22,98 @@
22*/ 22*/
23 23
24#include "kabcore.h" 24#include "kabcore.h"
25 25
26#include <stdaddressbook.h> 26#include <stdaddressbook.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
30#include <qclipboard.h> 30#include <qclipboard.h>
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qapplicaton.h> 33#include <qapplicaton.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qvbox.h> 36#include <qvbox.h>
37#include <kabc/addresseelist.h> 37#include <kabc/addresseelist.h>
38#include <kabc/errorhandler.h> 38#include <kabc/errorhandler.h>
39#include <kabc/resource.h> 39#include <kabc/resource.h>
40#include <kabc/vcardconverter.h> 40#include <kabc/vcardconverter.h>
41#include <kapplication.h> 41#include <kapplication.h>
42#include <kactionclasses.h> 42#include <kactionclasses.h>
43#include <kcmultidialog.h> 43#include <kcmultidialog.h>
44#include <kdebug.h> 44#include <kdebug.h>
45#include <kdeversion.h> 45#include <kdeversion.h>
46#include <kkeydialog.h> 46#include <kkeydialog.h>
47#include <kmessagebox.h> 47#include <kmessagebox.h>
48#include <kprinter.h> 48#include <kprinter.h>
49#include <kprotocolinfo.h> 49#include <kprotocolinfo.h>
50#include <kresources/selectdialog.h> 50#include <kresources/selectdialog.h>
51#include <kstandarddirs.h> 51#include <kstandarddirs.h>
52#include <ktempfile.h> 52#include <ktempfile.h>
53#include <kxmlguiclient.h> 53#include <kxmlguiclient.h>
54#include <kaboutdata.h> 54#include <kaboutdata.h>
55#include <libkdepim/categoryselectdialog.h> 55#include <libkdepim/categoryselectdialog.h>
56 56
57#include "addresseeutil.h" 57#include "addresseeutil.h"
58#include "addresseeeditordialog.h" 58#include "addresseeeditordialog.h"
59#include "extensionmanager.h" 59#include "extensionmanager.h"
60#include "kstdaction.h" 60#include "kstdaction.h"
61#include "kaddressbookservice.h" 61#include "kaddressbookservice.h"
62#include "ldapsearchdialog.h" 62#include "ldapsearchdialog.h"
63#include "printing/printingwizard.h" 63#include "printing/printingwizard.h"
64#else // KAB_EMBEDDED 64#else // KAB_EMBEDDED
65 65
66#include <kapplication.h> 66#include <kapplication.h>
67#include "KDGanttMinimizeSplitter.h" 67#include "KDGanttMinimizeSplitter.h"
68#include "kaddressbookmain.h" 68#include "kaddressbookmain.h"
69#include "kactioncollection.h" 69#include "kactioncollection.h"
70#include "addresseedialog.h"
71
70#include <qapp.h> 72#include <qapp.h>
71#include <qmenubar.h> 73#include <qmenubar.h>
72//#include <qtoolbar.h> 74//#include <qtoolbar.h>
73#include <qmessagebox.h> 75#include <qmessagebox.h>
74#include <kdebug.h> 76#include <kdebug.h>
75#include <kiconloader.h> // needed for SmallIcon 77#include <kiconloader.h> // needed for SmallIcon
76#include <kresources/kcmkresources.h> 78#include <kresources/kcmkresources.h>
77#include <ktoolbar.h> 79#include <ktoolbar.h>
78 80
79 81
80//#include <qlabel.h> 82//#include <qlabel.h>
81 83
82 84
83#ifndef DESKTOP_VERSION 85#ifndef DESKTOP_VERSION
84#include <qpe/ir.h> 86#include <qpe/ir.h>
85#endif 87#endif
86 88
87#endif // KAB_EMBEDDED 89#endif // KAB_EMBEDDED
88#include "kcmconfigs/kcmkabconfig.h" 90#include "kcmconfigs/kcmkabconfig.h"
89#include "kcmconfigs/kcmkdepimconfig.h" 91#include "kcmconfigs/kcmkdepimconfig.h"
90#include "kpimglobalprefs.h" 92#include "kpimglobalprefs.h"
91#include "externalapphandler.h" 93#include "externalapphandler.h"
92 94
93 95
94#include <kresources/selectdialog.h> 96#include <kresources/selectdialog.h>
95#include <kmessagebox.h> 97#include <kmessagebox.h>
96 98
97#include <picture.h> 99#include <picture.h>
98#include <resource.h> 100#include <resource.h>
99 101
100//US#include <qsplitter.h> 102//US#include <qsplitter.h>
101#include <qmap.h> 103#include <qmap.h>
102#include <qdir.h> 104#include <qdir.h>
103#include <qfile.h> 105#include <qfile.h>
104#include <qvbox.h> 106#include <qvbox.h>
105#include <qlayout.h> 107#include <qlayout.h>
106#include <qclipboard.h> 108#include <qclipboard.h>
107#include <qtextstream.h> 109#include <qtextstream.h>
108 110
109#include <libkdepim/categoryselectdialog.h> 111#include <libkdepim/categoryselectdialog.h>
110#include <kabc/vcardconverter.h> 112#include <kabc/vcardconverter.h>
111 113
112 114
113#include "addresseeutil.h" 115#include "addresseeutil.h"
114#include "undocmds.h" 116#include "undocmds.h"
115#include "addresseeeditordialog.h" 117#include "addresseeeditordialog.h"
116#include "viewmanager.h" 118#include "viewmanager.h"
117#include "details/detailsviewcontainer.h" 119#include "details/detailsviewcontainer.h"
@@ -166,103 +168,108 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
166 "X-ManagersName", "KADDRESSBOOK" ); 168 "X-ManagersName", "KADDRESSBOOK" );
167 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 169 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
168 "X-SpousesName", "KADDRESSBOOK" ); 170 "X-SpousesName", "KADDRESSBOOK" );
169 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 171 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
170 "X-Office", "KADDRESSBOOK" ); 172 "X-Office", "KADDRESSBOOK" );
171 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 173 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
172 "X-IMAddress", "KADDRESSBOOK" ); 174 "X-IMAddress", "KADDRESSBOOK" );
173 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 175 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
174 "X-Anniversary", "KADDRESSBOOK" ); 176 "X-Anniversary", "KADDRESSBOOK" );
175 177
176 //US added this field to become compatible with Opie/qtopia addressbook 178 //US added this field to become compatible with Opie/qtopia addressbook
177 // values can be "female" or "male" or "". An empty field represents undefined. 179 // values can be "female" or "male" or "". An empty field represents undefined.
178 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 180 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
179 "X-Gender", "KADDRESSBOOK" ); 181 "X-Gender", "KADDRESSBOOK" );
180 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 182 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
181 "X-Children", "KADDRESSBOOK" ); 183 "X-Children", "KADDRESSBOOK" );
182 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 184 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
183 "X-FreeBusyUrl", "KADDRESSBOOK" ); 185 "X-FreeBusyUrl", "KADDRESSBOOK" );
184 186
185 initGUI(); 187 initGUI();
186 188
187 mIncSearchWidget->setFocus(); 189 mIncSearchWidget->setFocus();
188 190
189 191
190 connect( mViewManager, SIGNAL( selected( const QString& ) ), 192 connect( mViewManager, SIGNAL( selected( const QString& ) ),
191 SLOT( setContactSelected( const QString& ) ) ); 193 SLOT( setContactSelected( const QString& ) ) );
192 connect( mViewManager, SIGNAL( executed( const QString& ) ), 194 connect( mViewManager, SIGNAL( executed( const QString& ) ),
193 SLOT( executeContact( const QString& ) ) ); 195 SLOT( executeContact( const QString& ) ) );
194 196
195 connect( mViewManager, SIGNAL( deleteRequest( ) ), 197 connect( mViewManager, SIGNAL( deleteRequest( ) ),
196 SLOT( deleteContacts( ) ) ); 198 SLOT( deleteContacts( ) ) );
197 connect( mViewManager, SIGNAL( modified() ), 199 connect( mViewManager, SIGNAL( modified() ),
198 SLOT( setModified() ) ); 200 SLOT( setModified() ) );
199 201
200 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 202 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
201 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 203 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
202 204
203 connect( mXXPortManager, SIGNAL( modified() ), 205 connect( mXXPortManager, SIGNAL( modified() ),
204 SLOT( setModified() ) ); 206 SLOT( setModified() ) );
205 207
206 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 208 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
207 SLOT( incrementalSearch( const QString& ) ) ); 209 SLOT( incrementalSearch( const QString& ) ) );
208 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 210 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
209 mJumpButtonBar, SLOT( recreateButtons() ) ); 211 mJumpButtonBar, SLOT( recreateButtons() ) );
210 212
211 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 213 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
212 SLOT( sendMail( const QString& ) ) ); 214 SLOT( sendMail( const QString& ) ) );
213 215
216
217 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&)));
218
219
214#ifndef KAB_EMBEDDED 220#ifndef KAB_EMBEDDED
215 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 221 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
216 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 222 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
217 223
218 connect( mDetails, SIGNAL( browse( const QString& ) ), 224 connect( mDetails, SIGNAL( browse( const QString& ) ),
219 SLOT( browse( const QString& ) ) ); 225 SLOT( browse( const QString& ) ) );
220 226
227
221 mAddressBookService = new KAddressBookService( this ); 228 mAddressBookService = new KAddressBookService( this );
222 229
223#endif //KAB_EMBEDDED 230#endif //KAB_EMBEDDED
224 mEditorDialog = 0; 231 mEditorDialog = 0;
225 createAddresseeEditorDialog( this ); 232 createAddresseeEditorDialog( this );
226 setModified( false ); 233 setModified( false );
227} 234}
228 235
229KABCore::~KABCore() 236KABCore::~KABCore()
230{ 237{
231 // save(); 238 // save();
232 //saveSettings(); 239 //saveSettings();
233 //KABPrefs::instance()->writeConfig(); 240 //KABPrefs::instance()->writeConfig();
234 delete AddresseeConfig::instance(); 241 delete AddresseeConfig::instance();
235 mAddressBook = 0; 242 mAddressBook = 0;
236 KABC::StdAddressBook::close(); 243 KABC::StdAddressBook::close();
237} 244}
238 245
239void KABCore::restoreSettings() 246void KABCore::restoreSettings()
240{ 247{
241 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 248 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
242 249
243 bool state; 250 bool state;
244 251
245 if (mMultipleViewsAtOnce) 252 if (mMultipleViewsAtOnce)
246 state = KABPrefs::instance()->mDetailsPageVisible; 253 state = KABPrefs::instance()->mDetailsPageVisible;
247 else 254 else
248 state = false; 255 state = false;
249 256
250 mActionDetails->setChecked( state ); 257 mActionDetails->setChecked( state );
251 setDetailsVisible( state ); 258 setDetailsVisible( state );
252 259
253 state = KABPrefs::instance()->mJumpButtonBarVisible; 260 state = KABPrefs::instance()->mJumpButtonBarVisible;
254 261
255 mActionJumpBar->setChecked( state ); 262 mActionJumpBar->setChecked( state );
256 setJumpButtonBarVisible( state ); 263 setJumpButtonBarVisible( state );
257/*US 264/*US
258 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 265 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
259 if ( splitterSize.count() == 0 ) { 266 if ( splitterSize.count() == 0 ) {
260 splitterSize.append( width() / 2 ); 267 splitterSize.append( width() / 2 );
261 splitterSize.append( width() / 2 ); 268 splitterSize.append( width() / 2 );
262 } 269 }
263 mMiniSplitter->setSizes( splitterSize ); 270 mMiniSplitter->setSizes( splitterSize );
264 if ( mExtensionBarSplitter ) { 271 if ( mExtensionBarSplitter ) {
265 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 272 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
266 if ( splitterSize.count() == 0 ) { 273 if ( splitterSize.count() == 0 ) {
267 splitterSize.append( width() / 2 ); 274 splitterSize.append( width() / 2 );
268 splitterSize.append( width() / 2 ); 275 splitterSize.append( width() / 2 );
@@ -1920,52 +1927,78 @@ void KABCore::clipboardDataChanged()
1920{ 1927{
1921 1928
1922 if ( mReadWrite ) 1929 if ( mReadWrite )
1923 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 1930 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
1924 1931
1925} 1932}
1926 1933
1927void KABCore::updateActionMenu() 1934void KABCore::updateActionMenu()
1928{ 1935{
1929 UndoStack *undo = UndoStack::instance(); 1936 UndoStack *undo = UndoStack::instance();
1930 RedoStack *redo = RedoStack::instance(); 1937 RedoStack *redo = RedoStack::instance();
1931 1938
1932 if ( undo->isEmpty() ) 1939 if ( undo->isEmpty() )
1933 mActionUndo->setText( i18n( "Undo" ) ); 1940 mActionUndo->setText( i18n( "Undo" ) );
1934 else 1941 else
1935 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 1942 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
1936 1943
1937 mActionUndo->setEnabled( !undo->isEmpty() ); 1944 mActionUndo->setEnabled( !undo->isEmpty() );
1938 1945
1939 if ( !redo->top() ) 1946 if ( !redo->top() )
1940 mActionRedo->setText( i18n( "Redo" ) ); 1947 mActionRedo->setText( i18n( "Redo" ) );
1941 else 1948 else
1942 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 1949 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
1943 1950
1944 mActionRedo->setEnabled( !redo->isEmpty() ); 1951 mActionRedo->setEnabled( !redo->isEmpty() );
1945} 1952}
1946 1953
1947void KABCore::configureKeyBindings() 1954void KABCore::configureKeyBindings()
1948{ 1955{
1949#ifndef KAB_EMBEDDED 1956#ifndef KAB_EMBEDDED
1950 KKeyDialog::configure( actionCollection(), true ); 1957 KKeyDialog::configure( actionCollection(), true );
1951#else //KAB_EMBEDDED 1958#else //KAB_EMBEDDED
1952 qDebug("KABCore::configureKeyBindings() not implemented"); 1959 qDebug("KABCore::configureKeyBindings() not implemented");
1953#endif //KAB_EMBEDDED 1960#endif //KAB_EMBEDDED
1954} 1961}
1955 1962
1956#ifdef KAB_EMBEDDED 1963#ifdef KAB_EMBEDDED
1957void KABCore::configureResources() 1964void KABCore::configureResources()
1958{ 1965{
1959 KRES::KCMKResources dlg( this, "" , 0 ); 1966 KRES::KCMKResources dlg( this, "" , 0 );
1960 1967
1961 if ( !dlg.exec() ) 1968 if ( !dlg.exec() )
1962 return; 1969 return;
1963 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 1970 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
1964} 1971}
1965#endif //KAB_EMBEDDED 1972#endif //KAB_EMBEDDED
1966 1973
1967 1974
1975/* this method will be called through the QCop interface from Ko/Pi to select addresses
1976 * for the attendees list of an event.
1977 */
1978void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1)
1979{
1980 //param1 is usually empty for this kind of request
1981
1982 QStringList nameList;
1983 QStringList emailList;
1984 QStringList uidList;
1985
1986 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
1987 uint i=0;
1988 for (i=0; i < list.count(); i++)
1989 {
1990 nameList.append(list[i].realName());
1991 emailList.append(list[i].preferredEmail());
1992 uidList.append(list[i].uid());
1993 }
1994
1995 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
1996
1997}
1998
1999
2000
1968 2001
1969#ifndef KAB_EMBEDDED 2002#ifndef KAB_EMBEDDED
1970#include "kabcore.moc" 2003#include "kabcore.moc"
1971#endif //KAB_EMBEDDED 2004#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index d4d28f1..fe778af 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -283,96 +283,99 @@ class KABCore : public QWidget
283 */ 283 */
284 void save(); 284 void save();
285 285
286 /** 286 /**
287 Undos the last command using the undo stack. 287 Undos the last command using the undo stack.
288 */ 288 */
289 void undo(); 289 void undo();
290 290
291 /** 291 /**
292 Redos the last command that was undone, using the redo stack. 292 Redos the last command that was undone, using the redo stack.
293 */ 293 */
294 void redo(); 294 void redo();
295 295
296 /** 296 /**
297 Shows the edit dialog for the given uid. If the uid is QString::null, 297 Shows the edit dialog for the given uid. If the uid is QString::null,
298 the method will try to find a selected addressee in the view. 298 the method will try to find a selected addressee in the view.
299 */ 299 */
300 void editContact( const QString &uid /*US = QString::null*/ ); 300 void editContact( const QString &uid /*US = QString::null*/ );
301//US added a second method without defaultparameter 301//US added a second method without defaultparameter
302 void editContact2(); 302 void editContact2();
303 303
304 /** 304 /**
305 Shows or edits the detail view for the given uid. If the uid is QString::null, 305 Shows or edits the detail view for the given uid. If the uid is QString::null,
306 the method will try to find a selected addressee in the view. 306 the method will try to find a selected addressee in the view.
307 */ 307 */
308 void executeContact( const QString &uid /*US = QString::null*/ ); 308 void executeContact( const QString &uid /*US = QString::null*/ );
309 309
310 /** 310 /**
311 Launches the configuration dialog. 311 Launches the configuration dialog.
312 */ 312 */
313 void openConfigDialog(); 313 void openConfigDialog();
314 314
315 /** 315 /**
316 Launches the ldap search dialog. 316 Launches the ldap search dialog.
317 */ 317 */
318 void openLDAPDialog(); 318 void openLDAPDialog();
319 319
320 /** 320 /**
321 Creates a KAddressBookPrinter, which will display the print 321 Creates a KAddressBookPrinter, which will display the print
322 dialog and do the printing. 322 dialog and do the printing.
323 */ 323 */
324 void print(); 324 void print();
325 325
326 /** 326 /**
327 Registers a new GUI client, so plugins can register its actions. 327 Registers a new GUI client, so plugins can register its actions.
328 */ 328 */
329 void addGUIClient( KXMLGUIClient *client ); 329 void addGUIClient( KXMLGUIClient *client );
330 330
331 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1);
332
333
331 signals: 334 signals:
332 void contactSelected( const QString &name ); 335 void contactSelected( const QString &name );
333 void contactSelected( const QPixmap &pixmap ); 336 void contactSelected( const QPixmap &pixmap );
334 public slots: 337 public slots:
335 void setDetailsVisible( bool visible ); 338 void setDetailsVisible( bool visible );
336 void setDetailsToState(); 339 void setDetailsToState();
337 private slots: 340 private slots:
338 void setJumpButtonBarVisible( bool visible ); 341 void setJumpButtonBarVisible( bool visible );
339 void importFromOL(); 342 void importFromOL();
340 void extensionModified( const KABC::Addressee::List &list ); 343 void extensionModified( const KABC::Addressee::List &list );
341 void extensionChanged( int id ); 344 void extensionChanged( int id );
342 void clipboardDataChanged(); 345 void clipboardDataChanged();
343 void updateActionMenu(); 346 void updateActionMenu();
344 void configureKeyBindings(); 347 void configureKeyBindings();
345 void removeVoice(); 348 void removeVoice();
346#ifdef KAB_EMBEDDED 349#ifdef KAB_EMBEDDED
347 void configureResources(); 350 void configureResources();
348#endif //KAB_EMBEDDED 351#endif //KAB_EMBEDDED
349 352
350 void slotEditorDestroyed( const QString &uid ); 353 void slotEditorDestroyed( const QString &uid );
351 void configurationChanged(); 354 void configurationChanged();
352 void addressBookChanged(); 355 void addressBookChanged();
353 356
354 private: 357 private:
355 void initGUI(); 358 void initGUI();
356 void initActions(); 359 void initActions();
357 360
358 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 361 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
359 const char *name = 0 ); 362 const char *name = 0 );
360 363
361 KXMLGUIClient *mGUIClient; 364 KXMLGUIClient *mGUIClient;
362 365
363 KABC::AddressBook *mAddressBook; 366 KABC::AddressBook *mAddressBook;
364 367
365 ViewManager *mViewManager; 368 ViewManager *mViewManager;
366 // QSplitter *mDetailsSplitter; 369 // QSplitter *mDetailsSplitter;
367 KDGanttMinimizeSplitter *mExtensionBarSplitter; 370 KDGanttMinimizeSplitter *mExtensionBarSplitter;
368 ViewContainer *mDetails; 371 ViewContainer *mDetails;
369 KDGanttMinimizeSplitter* mMiniSplitter; 372 KDGanttMinimizeSplitter* mMiniSplitter;
370 XXPortManager *mXXPortManager; 373 XXPortManager *mXXPortManager;
371 JumpButtonBar *mJumpButtonBar; 374 JumpButtonBar *mJumpButtonBar;
372 IncSearchWidget *mIncSearchWidget; 375 IncSearchWidget *mIncSearchWidget;
373 ExtensionManager *mExtensionManager; 376 ExtensionManager *mExtensionManager;
374 377
375 KCMultiDialog *mConfigureDialog; 378 KCMultiDialog *mConfigureDialog;
376 379
377#ifndef KAB_EMBEDDED 380#ifndef KAB_EMBEDDED
378 LDAPSearchDialog *mLdapSearchDialog; 381 LDAPSearchDialog *mLdapSearchDialog;
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,114 +1,115 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#else 4#else
5#include <qapplication.h> 5#include <qapplication.h>
6#include <qwindowsstyle.h> 6#include <qwindowsstyle.h>
7#include <qplatinumstyle.h> 7#include <qplatinumstyle.h>
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#endif 9#endif
10 10
11#include <kstandarddirs.h> 11#include <kstandarddirs.h>
12#include <kglobal.h> 12#include <kglobal.h>
13#include <stdio.h> 13#include <stdio.h>
14#include <qdir.h> 14#include <qdir.h>
15#include "kaddressbookmain.h" 15#include "kaddressbookmain.h"
16#include "externalapphandler.h"
16 17
17int main( int argc, char **argv ) 18int main( int argc, char **argv )
18{ 19{
19#ifndef DESKTOP_VERSION 20#ifndef DESKTOP_VERSION
20 QPEApplication a( argc, argv ); 21 QPEApplication a( argc, argv );
21 a.setKeepRunning (); 22 a.setKeepRunning ();
22#else 23#else
23 QApplication a( argc, argv ); 24 QApplication a( argc, argv );
24 QApplication::setStyle( new QPlatinumStyle ()); 25 QApplication::setStyle( new QPlatinumStyle ());
25#endif 26#endif
26 27
27 bool exitHelp = false; 28 bool exitHelp = false;
28 if ( argc > 1 ) { 29 if ( argc > 1 ) {
29 QString command = argv[1]; 30 QString command = argv[1];
30 if ( command == "-help" ){ 31 if ( command == "-help" ){
31 printf("KA/E command line commands:\n"); 32 printf("KA/E command line commands:\n");
32 printf(" no command: Start KA/E in usual way\n"); 33 printf(" no command: Start KA/E in usual way\n");
33 printf(" -help: This output\n"); 34 printf(" -help: This output\n");
34 printf(" KA/E is exiting now. Bye!\n"); 35 printf(" KA/E is exiting now. Bye!\n");
35 exitHelp = true; 36 exitHelp = true;
36 } 37 }
37 } 38 }
38 if ( ! exitHelp ) { 39 if ( ! exitHelp ) {
39 40
40 KGlobal::setAppName( "kaddressbook" ); 41 KGlobal::setAppName( "kaddressbook" );
41#ifndef DESKTOP_VERSION 42#ifndef DESKTOP_VERSION
42 if ( QApplication::desktop()->width() > 320 ) 43 if ( QApplication::desktop()->width() > 320 )
43 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 44 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
44 else 45 else
45 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 46 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
46#else 47#else
47 QString fileName ; 48 QString fileName ;
48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 49 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
49 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 50 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
50 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 51 QApplication::addLibraryPath ( qApp->applicationDirPath () );
51 52
52#endif 53#endif
53 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 54 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
54 KAddressBookMain m ; 55 KAddressBookMain m ;
55//US MainWindow m; 56//US MainWindow m;
56//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 57 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
57 58
58#ifndef DESKTOP_VERSION 59#ifndef DESKTOP_VERSION
59 a.showMainWidget( &m ); 60 a.showMainWidget( &m );
60#else 61#else
61 a.setMainWidget( &m ); 62 a.setMainWidget( &m );
62 m.resize (640, 480 ); 63 m.resize (640, 480 );
63 m.show(); 64 m.show();
64#endif 65#endif
65 a.exec(); 66 a.exec();
66 67
67 } 68 }
68 qDebug("KA: Bye! "); 69 qDebug("KA: Bye! ");
69} 70}
70 71
71/* 72/*
72#include <stdlib.h> 73#include <stdlib.h>
73 74
74#include <qstring.h> 75#include <qstring.h>
75 76
76#include <kabc/stdaddressbook.h> 77#include <kabc/stdaddressbook.h>
77#include <kaboutdata.h> 78#include <kaboutdata.h>
78#include <kcmdlineargs.h> 79#include <kcmdlineargs.h>
79#include <kcrash.h> 80#include <kcrash.h>
80#include <kdebug.h> 81#include <kdebug.h>
81#include <klocale.h> 82#include <klocale.h>
82#include <kstartupinfo.h> 83#include <kstartupinfo.h>
83#include <kuniqueapplication.h> 84#include <kuniqueapplication.h>
84#include <kwin.h> 85#include <kwin.h>
85 86
86#include "kaddressbookmain.h" 87#include "kaddressbookmain.h"
87#include "kabcore.h" 88#include "kabcore.h"
88 89
89extern "C" { 90extern "C" {
90 91
91void crashHandler( int ) 92void crashHandler( int )
92{ 93{
93 KABC::StdAddressBook::handleCrash(); 94 KABC::StdAddressBook::handleCrash();
94 ::exit( 0 ); 95 ::exit( 0 );
95} 96}
96 97
97} 98}
98 99
99class KAddressBookApp : public KUniqueApplication { 100class KAddressBookApp : public KUniqueApplication {
100 public: 101 public:
101 KAddressBookApp() : mMainWin( 0 ) {} 102 KAddressBookApp() : mMainWin( 0 ) {}
102 ~KAddressBookApp() {} 103 ~KAddressBookApp() {}
103 104
104 int newInstance(); 105 int newInstance();
105 106
106 private: 107 private:
107 KAddressBookMain *mMainWin; 108 KAddressBookMain *mMainWin;
108}; 109};
109 110
110int KAddressBookApp::newInstance() 111int KAddressBookApp::newInstance()
111{ 112{
112 if ( isRestored() ) { 113 if ( isRestored() ) {
113 // There can only be one main window 114 // There can only be one main window
114 if ( KMainWindow::canBeRestored( 1 ) ) { 115 if ( KMainWindow::canBeRestored( 1 ) ) {
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 35638b1..64caa7d 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -1,108 +1,344 @@
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 <qtopia/qcopenvelope_qws.h> 37#include <qtopia/qcopenvelope_qws.h>
38#endif 38#endif
39 39
40#include <kstaticdeleter.h> 40#include <kstaticdeleter.h>
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/*********************************************************************************
49 *
50 ********************************************************************************/
51
52
53QCopTransferItem::QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
54 : _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage)
55{
56 //sourceMessage passes later three parameters: sourceChannel, uid, param1
57 _sourceMessageParameters = "(QString,QString,QString)";
58}
59
60/*********************************************************************************/
61
62QCopTransferItem::QCopTransferItem()
63{
64}
65
66/*********************************************************************************/
67bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1)
68{
69
70#ifndef DESKTOP_VERSION
71 //sourceMessage passes two parameters: sourceChannel, uid
72 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
73
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());
76
77 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
78
79 e << _sourceChannel << uid << param1;
80
81 return true;
82
83#else
84 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
85 return false;
86#endif
87
88}
89
90
91/*********************************************************************************/
92void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
93{
94
95 if (_sourceChannel.isEmpty())
96 _sourceChannel = sourceChannel;
97}
98
99
100/*********************************************************************************/
101bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
102{
103/*US
104 // copied from old mail2
105 static int ii = 0;
106
107 // block second call
108 if ( ii < 2 ) {
109 ++ii;
110 if ( ii > 1 ) {
111 qDebug("qcop call blocked ");
112 return true;
113 }
114 }
115*/
116 qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
117
118 //we are in the target and get a request from the source
119 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data())
120 {
121 QDataStream stream( data, IO_ReadOnly );
122
123
124 QString sourceChannel;
125 QString uid;
126 QString param1;
48 127
128 stream >> sourceChannel >> uid >> param1;
49 129
130 emit receivedMessageFromSource(sourceChannel, uid, param1);
50 131
132 return true;
133 }
134
135 return false;
136}
137
138
139/*********************************************************************************
140 *
141 ********************************************************************************/
142
143
144QCopMapTransferItem::QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
145 : QCopTransferItem(sourceMessage, targetChannel,targetMessage)
146{
147 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
148 _targetMessageParameters = "(QString,QMAP<QString,QString>)";
149}
150
151/*********************************************************************************/
152bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
153{
154#ifndef DESKTOP_VERSION
155 //targetMessage passes two parameters: uid, map
156 QString targetMessage = _targetMessage + _targetMessageParameters;
157
158 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
159 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
51 160
161 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
162 //US we need no names in the To field. The emailadresses are enough
163
164 e << uid << nameEmailMap;
165
166 return true;
167
168#else
169 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
170 return false;
171#endif
172
173}
174
175
176/*********************************************************************************/
177bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
178{
179 bool res = QCopTransferItem::appMessage( cmsg, data );
180
181 if (res == false)
182 {
183 QDataStream stream( data, IO_ReadOnly );
184
185 qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
186
187 //we are in the source and get an answer from the target
188 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
189 {
190 QMap<QString,QString> adrMap;
191 QString uid;
192
193 stream >> uid >> adrMap;
194
195 emit receivedMessageFromTarget(uid, adrMap);
196
197
198 return true;
199 }
200 }
201
202 return false;
203}
204
205
206/*********************************************************************************
207 *
208 ********************************************************************************/
209
210
211QCopListTransferItem::QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
212 : QCopTransferItem(sourceMessage, targetChannel,targetMessage)
213{
214 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
215 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)";
216}
217
218/*********************************************************************************/
219bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
220{
221#ifndef DESKTOP_VERSION
222 //targetMessage passes two parameters: uid, map
223 QString targetMessage = _targetMessage + _targetMessageParameters;
224
225 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());
227
228 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
229 //US we need no names in the To field. The emailadresses are enough
230
231 e << uid << list1 << list2 << list3;
232
233 return true;
234
235#else
236 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
237 return false;
238#endif
239
240}
241
242
243/*********************************************************************************/
244bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
245{
246 bool res = QCopTransferItem::appMessage( cmsg, data );
247
248 if (res == false)
249 {
250 QDataStream stream( data, IO_ReadOnly );
251
252 qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
253
254 //we are in the source and get an answer from the target
255 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
256 {
257 QStringList list1;
258 QStringList list2;
259 QStringList list3;
260 QString uid;
261
262 stream >> uid >> list1 >> list2 >> list3;
263
264 emit receivedMessageFromTarget(uid, list1, list2, list3);
265
266
267 return true;
268 }
269 }
270
271 return false;
272}
273
274
275
276/*********************************************************************************
277 *
278 ********************************************************************************/
52 279
53 280
54ExternalAppHandler *ExternalAppHandler::sInstance = 0; 281ExternalAppHandler *ExternalAppHandler::sInstance = 0;
55static KStaticDeleter<ExternalAppHandler> staticDeleter; 282static KStaticDeleter<ExternalAppHandler> staticDeleter;
56 283
57
58ExternalAppHandler::ExternalAppHandler() 284ExternalAppHandler::ExternalAppHandler()
59{ 285{
60 mDefaultItems.setAutoDelete(true); 286 mDefaultItems.setAutoDelete(true);
287
288 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem("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&)));
290 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
291
292//US mFindByEmailFromKAPITransfer = new QCopListTransferItem("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&)));
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&)));
295
296
61} 297}
62 298
63ExternalAppHandler::~ExternalAppHandler() 299ExternalAppHandler::~ExternalAppHandler()
64{ 300{
65} 301}
66 302
67void ExternalAppHandler::loadConfig() 303void ExternalAppHandler::loadConfig()
68{ 304{
69 305
70 mDefaultItems.clear(); 306 mDefaultItems.clear();
71 307
72 mEmailAppAvailable = UNDEFINED; 308 mEmailAppAvailable = UNDEFINED;
73 mPhoneAppAvailable = UNDEFINED; 309 mPhoneAppAvailable = UNDEFINED;
74 mFaxAppAvailable = UNDEFINED; 310 mFaxAppAvailable = UNDEFINED;
75 mSMSAppAvailable = UNDEFINED; 311 mSMSAppAvailable = UNDEFINED;
76 mPagerAppAvailable = UNDEFINED; 312 mPagerAppAvailable = UNDEFINED;
77 313
78 314
79 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); 315 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
80 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); 316 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
81 317
82 if (opiepath.isEmpty()) 318 if (opiepath.isEmpty())
83 opiepath = qtopiapath; 319 opiepath = qtopiapath;
84 320
85 //mailclients 321 //mailclients
86 QString mailmsg1 = "writeMail(QString,QString)"; 322 QString mailmsg1 = "writeMail(QString,QString)";
87 QString mailmsg2 = "writeMail(QMap(QString,QString))"; 323 QString mailmsg2 = "writeMail(QMap(QString,QString))";
88 324
89 QString undefined = ""; 325 QString undefined = "";
90 326
91 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); 327 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined);
92 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); 328 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined);
93 329
94 if (( QFile::exists( qtopiapath + "/bin/ompi" )) || 330 if (( QFile::exists( qtopiapath + "/bin/ompi" )) ||
95 ( QFile::exists( opiepath + "/bin/ompi" ))) 331 ( QFile::exists( opiepath + "/bin/ompi" )))
96 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 332 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
97 333
98 if ( QFile::exists( qtopiapath + "/bin/qtmail" )) 334 if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
99 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 335 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
100 336
101 if ( QFile::exists( opiepath + "/bin/opiemail" )) 337 if ( QFile::exists( opiepath + "/bin/opiemail" ))
102 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 338 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
103 339
104 340
105 341
106 //phoneclients 342 //phoneclients
107 343
108 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); 344 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined);
@@ -346,97 +582,98 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
346 { 582 {
347 qDebug("could not find configured email application."); 583 qDebug("could not find configured email application.");
348 return false; 584 return false;
349 } 585 }
350 channel = dai->_channel; 586 channel = dai->_channel;
351 message = dai->_message; 587 message = dai->_message;
352 parameters = dai->_parameters; 588 parameters = dai->_parameters;
353 } 589 }
354 590
355 591
356 //first check if one of the mailers need the emails right in the message. 592 //first check if one of the mailers need the emails right in the message.
357 message = translateMessage(message, name, emailadress); 593 message = translateMessage(message, name, emailadress);
358 594
359 595
360 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 596 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
361 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 597 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
362 598
363 QCopEnvelope e(channel.latin1(), message.latin1()); 599 QCopEnvelope e(channel.latin1(), message.latin1());
364 //US we need no names in the To field. The emailadresses are enough 600 //US we need no names in the To field. The emailadresses are enough
365 601
366 passParameters(&e, parameters, name, emailadress); 602 passParameters(&e, parameters, name, emailadress);
367 603
368 604
369#else 605#else
370 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 606 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
371#endif 607#endif
372 608
373 609
374 return true; 610 return true;
375} 611}
376 612
377/************************************************************************** 613/**************************************************************************
378 * 614 *
379 **************************************************************************/ 615 **************************************************************************/
380 616
381//calls the emailapplication and creates a mail with parameter as recipients 617//calls the emailapplication and creates a mail with parameter as recipients
382// parameters format is 618// parameters format is
383// NAME <EMAIL>:SUBJECT 619// NAME <EMAIL>:SUBJECT
384bool ExternalAppHandler::mailToOneContact( const QString& adressline ) 620bool ExternalAppHandler::mailToOneContact( const QString& adressline )
385{ 621{
386 QString line = adressline; 622 QString line = adressline;
387 623
388 int first = line.find( "<"); 624 int first = line.find( "<");
389 int last = line.find( ">"); 625 int last = line.find( ">");
390 QString name = line.left(first); 626 QString name = line.left(first);
391 QString emailadress = line.mid(first+1, last-first-1); 627 QString emailadress = line.mid(first+1, last-first-1);
392 628
393 //Subject can not be handled right now. 629 //Subject can not be handled right now.
394 mailToOneContact( name, emailadress ); 630 return mailToOneContact( name, emailadress );
631
395} 632}
396 633
397 634
398/************************************************************************** 635/**************************************************************************
399 * 636 *
400 **************************************************************************/ 637 **************************************************************************/
401 638
402//calls the phoneapplication with the number 639//calls the phoneapplication with the number
403bool ExternalAppHandler::callByPhone( const QString& phonenumber ) 640bool ExternalAppHandler::callByPhone( const QString& phonenumber )
404{ 641{
405#ifndef DESKTOP_VERSION 642#ifndef DESKTOP_VERSION
406 QString channel; 643 QString channel;
407 QString message; 644 QString message;
408 QString parameters; 645 QString parameters;
409 646
410 647
411 int client = KPimGlobalPrefs::instance()->mPhoneClient; 648 int client = KPimGlobalPrefs::instance()->mPhoneClient;
412 if (client == KPimGlobalPrefs::OTHER_PHC) 649 if (client == KPimGlobalPrefs::OTHER_PHC)
413 { 650 {
414 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel; 651 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel;
415 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage; 652 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage;
416 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters; 653 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters;
417 } 654 }
418 else 655 else
419 { 656 {
420 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client); 657 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client);
421 if (!dai) 658 if (!dai)
422 { 659 {
423 qDebug("could not find configured phone application."); 660 qDebug("could not find configured phone application.");
424 return false; 661 return false;
425 } 662 }
426 channel = dai->_channel; 663 channel = dai->_channel;
427 message = dai->_message; 664 message = dai->_message;
428 parameters = dai->_parameters; 665 parameters = dai->_parameters;
429 } 666 }
430 667
431 668
432 //first check if one of the mailers need the emails right in the message. 669 //first check if one of the mailers need the emails right in the message.
433 message = translateMessage(message, phonenumber, ""); 670 message = translateMessage(message, phonenumber, "");
434 671
435 672
436 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 673 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
437 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 674 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
438 675
439 QCopEnvelope e(channel.latin1(), message.latin1()); 676 QCopEnvelope e(channel.latin1(), message.latin1());
440 //US we need no names in the To field. The emailadresses are enough 677 //US we need no names in the To field. The emailadresses are enough
441 678
442 passParameters(&e, parameters, phonenumber, ""); 679 passParameters(&e, parameters, phonenumber, "");
@@ -634,48 +871,89 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
634{ 871{
635#ifndef DESKTOP_VERSION 872#ifndef DESKTOP_VERSION
636 QMap<QString, QString> valmap; 873 QMap<QString, QString> valmap;
637 bool useValMap = false; 874 bool useValMap = false;
638 875
639 // first extract all parts of the parameters. 876 // first extract all parts of the parameters.
640 QStringList paramlist = QStringList::split(";", parameters); 877 QStringList paramlist = QStringList::split(";", parameters);
641 878
642 //Now check how many parts we have. 879 //Now check how many parts we have.
643 //=0 :no params to pass 880 //=0 :no params to pass
644 //>0 :parameters to pass 881 //>0 :parameters to pass
645 for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) 882 for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it )
646 { 883 {
647 QString param = (*it); 884 QString param = (*it);
648 QStringList keyvallist = QStringList::split("=", param); 885 QStringList keyvallist = QStringList::split("=", param);
649 886
650 //if we have keyvalue pairs, we assume that we pass a map to the envelope 887 //if we have keyvalue pairs, we assume that we pass a map to the envelope
651 QStringList::Iterator it2 = keyvallist.begin(); 888 QStringList::Iterator it2 = keyvallist.begin();
652 QString key = (*it2); 889 QString key = (*it2);
653 key = key.replace( QRegExp("%1"), param1 ); 890 key = key.replace( QRegExp("%1"), param1 );
654 key = key.replace( QRegExp("%2"), param2 ); 891 key = key.replace( QRegExp("%2"), param2 );
655 ++it2; 892 ++it2;
656 893
657 if(it2 != keyvallist.end()) 894 if(it2 != keyvallist.end())
658 { 895 {
659 QString value = (*it2); 896 QString value = (*it2);
660 value = value.replace( QRegExp("%1"), param1 ); 897 value = value.replace( QRegExp("%1"), param1 );
661 value = value.replace( QRegExp("%2"), param2 ); 898 value = value.replace( QRegExp("%2"), param2 );
662 899
663 valmap.insert(key, value); 900 valmap.insert(key, value);
664 useValMap = true; 901 useValMap = true;
665 } 902 }
666 else 903 else
667 { 904 {
668 // qDebug("pass parameter << %s", key.latin1()); 905 // qDebug("pass parameter << %s", key.latin1());
669 (*e) << key; 906 (*e) << key;
670 } 907 }
671 } 908 }
672 909
673 if (useValMap == true) 910 if (useValMap == true)
674 (*e) << valmap; 911 (*e) << valmap;
675 912
676#endif 913#endif
677 914
678} 915}
679 916
680 917
681 918
919/**************************************************************************
920 *
921 **************************************************************************/
922
923void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
924{
925 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
926
927// if (!res)
928// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
929}
930
931
932
933bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid)
934{
935 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
936 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(uid, QString::null);
937}
938
939bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
940{
941 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
942 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3);
943}
944
945bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email)
946{
947 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
948 return mFindByEmailFromKAPITransfer->sendMessageToTarget(uid, email);
949}
950
951bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
952{
953 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
954 return mFindByEmailFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3);
955}
956
957
958
959
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 3cf9e06..7c8de4e 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -1,145 +1,252 @@
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 EXTERNALAPPHANDLER_H 31#ifndef EXTERNALAPPHANDLER_H
32#define EXTERNALAPPHANDLER_H 32#define EXTERNALAPPHANDLER_H
33 33
34#include <qobject.h>
34#include <qlist.h> 35#include <qlist.h>
36#include <qmap.h>
35 37
36class QCopEnvelope; 38class QCopEnvelope;
37 39
38 40
39class ExternalAppHandler; 41class ExternalAppHandler;
42class QCopTransferItem : public QObject
43{
44 Q_OBJECT
45 public:
46 QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
47 QCopTransferItem();
48
49 bool sendMessageToTarget(const QString& uid, const QString& param1);
50
51 void setSourceChannel(const QString& sourceChannel);
52
53 virtual bool appMessage( const QCString& msg, const QByteArray& data );
54
55
56 signals:
57 void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1);
58
59
60 public:
61 QString _sourceChannel;
62 QString _sourceMessage;
63 QString _sourceMessageParameters;
64 QString _targetChannel;
65 QString _targetMessage;
66 QString _targetMessageParameters;
67
68};
69
70/*********************************************************************************
71 *
72 ********************************************************************************/
73
74class QCopMapTransferItem : public QCopTransferItem
75{
76 Q_OBJECT
77 public:
78 QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
79
80 bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap);
81
82
83 virtual bool appMessage( const QCString& msg, const QByteArray& data );
84
85
86 signals:
87 void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap);
88
89};
90
91/*********************************************************************************
92 *
93 ********************************************************************************/
94
95class QCopListTransferItem : public QCopTransferItem
96{
97 Q_OBJECT
98 public:
99 QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
100
101 bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
102
103
104 virtual bool appMessage( const QCString& msg, const QByteArray& data );
105
106
107 signals:
108 void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
109
110};
111
112/*********************************************************************************
113 *
114 ********************************************************************************/
115
40 116
41class DefaultAppItem 117class DefaultAppItem
42{ 118{
43 public: 119 public:
44 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) 120 DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2)
45 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) 121 : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2)
46 {} 122 {}
47 123
48 DefaultAppItem() 124 DefaultAppItem()
49 { } 125 { }
50 126
51 public: 127 public:
52 int _type; 128 int _type;
53 int _id; 129 int _id;
54 QString _label; 130 QString _label;
55 QString _channel; 131 QString _channel;
56 QString _message; 132 QString _message;
57 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; 133 QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ;
58 QString _message2; 134 QString _message2;
59 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; 135 QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ;
60 136
61}; 137};
62 138
63class ExternalAppHandler 139/*********************************************************************************
140 *
141 ********************************************************************************/
142
143class ExternalAppHandler : public QObject
64{ 144{
145 Q_OBJECT
65 public: 146 public:
66 virtual ~ExternalAppHandler(); 147 virtual ~ExternalAppHandler();
67 148
68 static ExternalAppHandler *instance(); 149 static ExternalAppHandler *instance();
69 150
70 enum Types { 151 enum Types {
71 EMAIL = 0, 152 EMAIL = 0,
72 PHONE = 1, 153 PHONE = 1,
73 SMS = 2, 154 SMS = 2,
74 FAX = 3, 155 FAX = 3,
75 PAGER = 4 156 PAGER = 4
76 }; 157 };
77 158
78 enum Availability { 159 enum Availability {
79 UNDEFINED = -1, 160 UNDEFINED = -1,
80 UNAVAILABLE = 0, 161 UNAVAILABLE = 0,
81 AVAILABLE = 1 162 AVAILABLE = 1
82 }; 163 };
83 164
84 //calls the emailapplication with a number of attachments that need to be send. 165 //calls the emailapplication with a number of attachments that need to be send.
85 //either parameter can be left empty. 166 //either parameter can be left empty.
86 bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls ); 167 bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls );
87 168
88 //calls the emailapplication and creates a mail with parameter emailadress as recipients 169 //calls the emailapplication and creates a mail with parameter emailadress as recipients
89 bool mailToOneContact( const QString& name, const QString& emailadress ); 170 bool mailToOneContact( const QString& name, const QString& emailadress );
90 171
91 //calls the emailapplication and creates a mail with parameter as recipients 172 //calls the emailapplication and creates a mail with parameter as recipients
92 // parameters format is 173 // parameters format is
93 // NAME <EMAIL>:SUBJECT 174 // NAME <EMAIL>:SUBJECT
94 bool mailToOneContact( const QString& adressline ); 175 bool mailToOneContact( const QString& adressline );
95 176
96 //calls the phoneapplication with the number 177 //calls the phoneapplication with the number
97 bool callByPhone( const QString& phonenumber ); 178 bool callByPhone( const QString& phonenumber );
98 179
99 //calls the smsapplication with the number 180 //calls the smsapplication with the number
100 bool callBySMS( const QString& phonenumber ); 181 bool callBySMS( const QString& phonenumber );
101 182
102 //calls the pagerapplication with the number 183 //calls the pagerapplication with the number
103 bool callByPager( const QString& pagernumber ); 184 bool callByPager( const QString& pagernumber );
104 185
105 //calls the faxapplication with the number 186 //calls the faxapplication with the number
106 bool callByFax( const QString& faxnumber ); 187 bool callByFax( const QString& faxnumber );
107 188
108 bool isEmailAppAvailable(); 189 bool isEmailAppAvailable();
109 bool isSMSAppAvailable(); 190 bool isSMSAppAvailable();
110 bool isPhoneAppAvailable(); 191 bool isPhoneAppAvailable();
111 bool isFaxAppAvailable(); 192 bool isFaxAppAvailable();
112 bool isPagerAppAvailable(); 193 bool isPagerAppAvailable();
113 194
114 195
196 //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);
198 //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);
200
201 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);
203
115 204
116 //loadConfig clears the cache and checks again if the applications are available or not 205 //loadConfig clears the cache and checks again if the applications are available or not
117 void loadConfig(); 206 void loadConfig();
118 207
119 QList<DefaultAppItem> getAvailableDefaultItems(Types); 208 QList<DefaultAppItem> getAvailableDefaultItems(Types);
120 DefaultAppItem* getDefaultItem(Types, int); 209 DefaultAppItem* getDefaultItem(Types, int);
121 210
211 public slots:
212 void appMessage( const QCString& msg, const QByteArray& data );
213
214
215 signals:
216 // Emmitted when the target app receives a request from the source app
217 void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1);
218
219 // 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
221 void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
222
223 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);
225
122 226
123 private: 227 private:
124 ExternalAppHandler(); 228 ExternalAppHandler();
125 QList<DefaultAppItem> mDefaultItems; 229 QList<DefaultAppItem> mDefaultItems;
126 230
127 Availability mEmailAppAvailable; 231 Availability mEmailAppAvailable;
128 Availability mPhoneAppAvailable; 232 Availability mPhoneAppAvailable;
129 Availability mFaxAppAvailable; 233 Availability mFaxAppAvailable;
130 Availability mSMSAppAvailable; 234 Availability mSMSAppAvailable;
131 Availability mPagerAppAvailable; 235 Availability mPagerAppAvailable;
132 236
237 QCopListTransferItem* mNameEmailUidListFromKAPITransfer;
238 QCopListTransferItem* mFindByEmailFromKAPITransfer;
239
133 240
134 void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); 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);
135 242
136 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const; 243 QString& translateMessage(QString& message, const QString& param1, const QString& param2) const;
137 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const; 244 void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const;
138 245
139 246
140 static ExternalAppHandler *sInstance; 247 static ExternalAppHandler *sInstance;
141 248
142
143}; 249};
144 250
251
145#endif 252#endif