author | ulf69 <ulf69> | 2004-08-18 21:11:43 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-18 21:11:43 (UTC) |
commit | 05a1b5cbea6a7c1a7500632f8e7c1bf5be9328d8 (patch) (side-by-side diff) | |
tree | 605819f51c314d137f24281f1ed4854b2086aa68 | |
parent | 7d15927b7e7957a80da335587598e7b62dece1a4 (diff) | |
download | kdepimpi-05a1b5cbea6a7c1a7500632f8e7c1bf5be9328d8.zip kdepimpi-05a1b5cbea6a7c1a7500632f8e7c1bf5be9328d8.tar.gz kdepimpi-05a1b5cbea6a7c1a7500632f8e7c1bf5be9328d8.tar.bz2 |
added new QCop method requestForDetails
-rw-r--r-- | libkdepim/externalapphandler.cpp | 87 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 19 |
2 files changed, 77 insertions, 29 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 64caa7d..b57506b 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -52,4 +52,4 @@ $Id$ -QCopTransferItem::QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) - : _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) +QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) + : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) { @@ -66,3 +66,3 @@ QCopTransferItem::QCopTransferItem() /*********************************************************************************/ -bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1) +bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) { @@ -74,3 +74,3 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); - qDebug("passing sourcechannel(%s), uid(%s), param1(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1()); + qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param3(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); @@ -78,3 +78,11 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa - e << _sourceChannel << uid << param1; + e << _sourceChannel << uid; + + if (_usedSourceParameters == 1) + e << param1; + else if (_usedSourceParameters == 2) + e << param1 << param2; + else if (_usedSourceParameters == 3) + e << param1 << param2 << param3; + @@ -126,6 +134,26 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data QString param1; + QString param2; + QString param3; - stream >> sourceChannel >> uid >> param1; + stream >> sourceChannel >> uid; - emit receivedMessageFromSource(sourceChannel, uid, param1); + if (_usedSourceParameters == 0) + { + emit receivedMessageFromSource(sourceChannel, uid); + } + else if (_usedSourceParameters == 1) + { + stream >> param1; + emit receivedMessageFromSource(sourceChannel, uid, param1); + } + else if (_usedSourceParameters == 2) + { + stream >> param1 >> param2; + emit receivedMessageFromSource(sourceChannel, uid, param1, param2); + } + else if (_usedSourceParameters == 3) + { + stream >> param1 >> param2 >> param3; + emit receivedMessageFromSource(sourceChannel, uid, param1, param2, param3); + } @@ -143,4 +171,4 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data -QCopMapTransferItem::QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) - : QCopTransferItem(sourceMessage, targetChannel,targetMessage) +QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) + : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) { @@ -210,6 +238,6 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da -QCopListTransferItem::QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) - : QCopTransferItem(sourceMessage, targetChannel,targetMessage) +QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) + : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) { - //targetMessage returns later two parameters: uid, and map<qstring,qstring> + //targetMessage returns later two parameters: uid, and three lists _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)"; @@ -287,7 +315,7 @@ ExternalAppHandler::ExternalAppHandler() - mNameEmailUidListFromKAPITransfer = new QCopListTransferItem("requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); - connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&))); + mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); + connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); -//US mFindByEmailFromKAPITransfer = new QCopListTransferItem("requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); +//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); @@ -295,3 +323,4 @@ ExternalAppHandler::ExternalAppHandler() - + mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); + connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); } @@ -926,2 +955,5 @@ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& dat + if (!res) + res = mDisplayDetails->appMessage( cmsg, data ); + // if (!res) @@ -932,26 +964,33 @@ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& dat -bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid) +bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) { mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); - return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(uid, QString::null); + return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); } -bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) +bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) { mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); - return mNameEmailUidListFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3); + return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); } -bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email) +bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) { mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); - return mFindByEmailFromKAPITransfer->sendMessageToTarget(uid, email); + return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); } -bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) +bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) { mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); - return mFindByEmailFromKAPITransfer->sendMessageToSource(uid, list1, list2, list3); + return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); } +bool ExternalAppHandler::requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) +{ + mDisplayDetails->setSourceChannel(sourceChannel); + return mDisplayDetails->sendMessageToTarget(sessionuid, name, email, uid); +} + + diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 7c8de4e..a74080f 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h @@ -45,6 +45,6 @@ class QCopTransferItem : public QObject public: - QCopTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); + QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); QCopTransferItem(); - bool sendMessageToTarget(const QString& uid, const QString& param1); + bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); @@ -56,3 +56,6 @@ class QCopTransferItem : public QObject signals: + void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); + void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); + void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); @@ -60,2 +63,3 @@ class QCopTransferItem : public QObject public: + int _usedSourceParameters; QString _sourceChannel; @@ -77,3 +81,3 @@ class QCopMapTransferItem : public QCopTransferItem public: - QCopMapTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); + QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); @@ -98,3 +102,3 @@ class QCopListTransferItem : public QCopTransferItem public: - QCopListTransferItem(const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); + QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); @@ -203,2 +207,4 @@ class ExternalAppHandler : public QObject + bool requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); + @@ -216,3 +222,3 @@ class ExternalAppHandler : public QObject // Emmitted when the target app receives a request from the source app - void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1); + void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); @@ -225,2 +231,4 @@ class ExternalAppHandler : public QObject + void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); + @@ -238,2 +246,3 @@ class ExternalAppHandler : public QObject QCopListTransferItem* mFindByEmailFromKAPITransfer; + QCopTransferItem* mDisplayDetails; |