summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.h
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 /libkdepim/externalapphandler.h
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 'libkdepim/externalapphandler.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.h111
1 files changed, 109 insertions, 2 deletions
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 3cf9e06..7c8de4e 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -32,5 +32,7 @@ $Id$
#define EXTERNALAPPHANDLER_H
+#include <qobject.h>
#include <qlist.h>
+#include <qmap.h>
class QCopEnvelope;
@@ -38,4 +40,78 @@ class QCopEnvelope;
class ExternalAppHandler;
+class QCopTransferItem : public QObject
+{
+ Q_OBJECT
+ public:
+ QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
+ QCopTransferItem();
+
+ bool sendMessageToTarget(const QString& uid, const QString& param1);
+
+ void setSourceChannel(const QString& sourceChannel);
+
+ virtual bool appMessage( const QCString& msg, const QByteArray& data );
+
+
+ signals:
+ void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1);
+
+
+ public:
+ QString _sourceChannel;
+ QString _sourceMessage;
+ QString _sourceMessageParameters;
+ QString _targetChannel;
+ QString _targetMessage;
+ QString _targetMessageParameters;
+
+};
+
+/*********************************************************************************
+ *
+ ********************************************************************************/
+
+class QCopMapTransferItem : public QCopTransferItem
+{
+ Q_OBJECT
+ public:
+ QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
+
+ bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap);
+
+
+ virtual bool appMessage( const QCString& msg, const QByteArray& data );
+
+
+ signals:
+ void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap);
+
+};
+
+/*********************************************************************************
+ *
+ ********************************************************************************/
+
+class QCopListTransferItem : public QCopTransferItem
+{
+ Q_OBJECT
+ public:
+ QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage);
+
+ bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
+
+
+ virtual bool appMessage( const QCString& msg, const QByteArray& data );
+
+
+ signals:
+ void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3);
+
+};
+
+/*********************************************************************************
+ *
+ ********************************************************************************/
+
class DefaultAppItem
@@ -61,6 +137,11 @@ class DefaultAppItem
};
-class ExternalAppHandler
+/*********************************************************************************
+ *
+ ********************************************************************************/
+
+class ExternalAppHandler : public QObject
{
+ Q_OBJECT
public:
virtual ~ExternalAppHandler();
@@ -113,4 +194,12 @@ class ExternalAppHandler
+ //Call this method on the source when you want to select names from the addressbook by using QCop
+ bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid);
+ //Call this method on the target when you want to return the name/email map to the source (client).
+ bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid);
+
+ bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email);
+ bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid);
+
//loadConfig clears the cache and checks again if the applications are available or not
@@ -120,4 +209,19 @@ class ExternalAppHandler
DefaultAppItem* getDefaultItem(Types, int);
+ public slots:
+ void appMessage( const QCString& msg, const QByteArray& data );
+
+
+ signals:
+ // Emmitted when the target app receives a request from the source app
+ void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1);
+
+ // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
+ // The first parameter is a uniqueid. It can be used to identify the event
+ void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
+
+ void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email);
+ void receivedFindBbyEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
+
private:
@@ -131,4 +235,7 @@ class ExternalAppHandler
Availability mPagerAppAvailable;
+ QCopListTransferItem* mNameEmailUidListFromKAPITransfer;
+ QCopListTransferItem* mFindByEmailFromKAPITransfer;
+
void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2);
@@ -140,6 +247,6 @@ class ExternalAppHandler
static ExternalAppHandler *sInstance;
-
};
+
#endif