summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorulf69 <ulf69>2004-08-17 00:09:26 (UTC)
committer ulf69 <ulf69>2004-08-17 00:09:26 (UTC)
commitab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb (patch) (side-by-side diff)
treea9f62469297dda2981807b5235e7812cac72f44c /kaddressbook
parent0e46d151bca931ff5c69a637d91cfcc381094e0b (diff)
downloadkdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.zip
kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.gz
kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.bz2
QCop implementation for KOrganizer to access Ka/pi directly
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h3
-rw-r--r--kaddressbook/mainembedded.cpp3
3 files changed, 38 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6807bed..e7c815e 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -66,8 +66,10 @@
#include <kapplication.h>
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
+#include "addresseedialog.h"
+
#include <qapp.h>
#include <qmenubar.h>
//#include <qtoolbar.h>
#include <qmessagebox.h>
@@ -210,15 +212,20 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
SLOT( sendMail( const QString& ) ) );
+
+ connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&)));
+
+
#ifndef KAB_EMBEDDED
connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
mXXPortManager, SLOT( importVCard( const KURL& ) ) );
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
+
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
mEditorDialog = 0;
@@ -1964,8 +1971,34 @@ void KABCore::configureResources()
}
#endif //KAB_EMBEDDED
+/* this method will be called through the QCop interface from Ko/Pi to select addresses
+ * for the attendees list of an event.
+ */
+void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1)
+{
+ //param1 is usually empty for this kind of request
+
+ QStringList nameList;
+ QStringList emailList;
+ QStringList uidList;
+
+ KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
+ uint i=0;
+ for (i=0; i < list.count(); i++)
+ {
+ nameList.append(list[i].realName());
+ emailList.append(list[i].preferredEmail());
+ uidList.append(list[i].uid());
+ }
+
+ bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
+
+}
+
+
+
#ifndef KAB_EMBEDDED
#include "kabcore.moc"
#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
@@ -327,8 +327,11 @@ class KABCore : public QWidget
Registers a new GUI client, so plugins can register its actions.
*/
void addGUIClient( KXMLGUIClient *client );
+ void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1);
+
+
signals:
void contactSelected( const QString &name );
void contactSelected( const QPixmap &pixmap );
public slots:
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -12,8 +12,9 @@
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
+#include "externalapphandler.h"
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
@@ -52,9 +53,9 @@ int main( int argc, char **argv )
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
-//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
+ QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else