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
@@ -31,12 +31,88 @@ $Id$
#ifndef EXTERNALAPPHANDLER_H
#define EXTERNALAPPHANDLER_H
+#include <qobject.h>
#include <qlist.h>
+#include <qmap.h>
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
{
@@ -60,8 +136,13 @@ class DefaultAppItem
};
-class ExternalAppHandler
+/*********************************************************************************
+ *
+ ********************************************************************************/
+
+class ExternalAppHandler : public QObject
{
+ Q_OBJECT
public:
virtual ~ExternalAppHandler();
@@ -112,6 +193,14 @@ class ExternalAppHandler
bool isPagerAppAvailable();
+ //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
void loadConfig();
@@ -119,6 +208,21 @@ class ExternalAppHandler
QList<DefaultAppItem> getAvailableDefaultItems(Types);
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:
ExternalAppHandler();
@@ -130,6 +234,9 @@ class ExternalAppHandler
Availability mSMSAppAvailable;
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);
@@ -139,7 +246,7 @@ class ExternalAppHandler
static ExternalAppHandler *sInstance;
-
};
+
#endif