dcopclient.h
/*
Copyright (c) 1999 Preston Brown <pbrown@kde.org>
Copyright (c) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _DCOPCLIENT_H
#define _DCOPCLIENT_H
#include <qobject.h>
#include <qcstring.h>
#include <qvaluelist.h>
#include <qstring.h>
#include <kdatastream.h> // needed for proper bool marshalling
#include <kdelibs_export.h>
class DCOPObjectProxy;
class DCOPClientPrivate;
class DCOPClientTransaction;
typedef QValueList<QCString> QCStringList;
class DCOP_EXPORT DCOPClient : public QObject
{
Q_OBJECT
public:
DCOPClient();
virtual ~DCOPClient();
static void setServerAddress(const QCString &addr);
bool attach();
void bindToApp();
bool detach();
bool isAttached() const;
bool isAttachedToForeignServer() const;
bool acceptCalls() const;
void setAcceptCalls(bool b);
bool qtBridgeEnabled(); // ### KDE 4.0: make const
void setQtBridgeEnabled(bool b);
QCString registerAs( const QCString &appId, bool addPID = true );
bool isRegistered() const;
QCString appId() const;
int socket() const;
void suspend();
void resume();
bool isSuspended() const;
bool send(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data);
bool send(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QString &data);
bool call(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QCString& replyType, QByteArray &replyData,
bool useEventLoop/*=false*/, int timeout/*=-1*/);
// KDE4 merge with above
bool call(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QCString& replyType, QByteArray &replyData,
bool useEventLoop=false);
int callAsync(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QObject *callBackObj, const char *callBackSlot);
bool findObject(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QCString &foundApp, QCString &foundObj,
bool useEventLoop/*=false*/, int timeout/*=-1*/);
// KDE4 merge with above
bool findObject(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QCString &foundApp, QCString &foundObj,
bool useEventLoop=false);
void emitDCOPSignal( const QCString &object, const QCString &signal,
const QByteArray &data);
/* For backwards compatibility */
void emitDCOPSignal( const QCString &signal, const QByteArray &data);
bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
const QCString &signal,
const QCString &receiverObj, const QCString &slot,
bool Volatile);
bool connectDCOPSignal( const QCString &sender, const QCString &signal,
const QCString &receiverObj, const QCString &slot,
bool Volatile) KDE_DEPRECATED;
bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
const QCString &signal,
const QCString &receiverObj, const QCString &slot);
bool disconnectDCOPSignal( const QCString &sender, const QCString &signal,
const QCString &receiverObj, const QCString &slot) KDE_DEPRECATED;
virtual bool process(const QCString &fun, const QByteArray &data,
QCString& replyType, QByteArray &replyData);
DCOPClientTransaction *beginTransaction( );
void endTransaction( DCOPClientTransaction *t, QCString& replyType, QByteArray &replyData);
Q_INT32 transactionId() const;
bool isApplicationRegistered( const QCString& remApp);
QCStringList registeredApplications();
QCStringList remoteObjects( const QCString& remApp, bool *ok = 0 );
QCStringList remoteInterfaces( const QCString& remApp, const QCString& remObj , bool *ok = 0 );
QCStringList remoteFunctions( const QCString& remApp, const QCString& remObj , bool *ok = 0 );
bool receive(const QCString &app, const QCString &obj,
const QCString &fun, const QByteArray& data,
QCString& replyType, QByteArray &replyData);
bool find(const QCString &app, const QCString &obj,
const QCString &fun, const QByteArray& data,
QCString& replyType, QByteArray &replyData);
static QCString normalizeFunctionSignature( const QCString& fun );
QCString senderId() const;
void setDefaultObject( const QCString& objId );
QCString defaultObject() const;
void setNotifications( bool enabled );
void setDaemonMode( bool daemonMode );
void setPriorityCall(bool);
static DCOPClient* mainClient();
static void setMainClient( DCOPClient* mainClient);
static DCOPClient* findLocalClient( const QCString &_appId );
static void emergencyClose();
static const char *postMortemSender();
static const char *postMortemObject();
static const char *postMortemFunction();
static QCString dcopServerFile(const QCString &hostname=0);
static QCString dcopServerFileOld(const QCString &hostname=0) KDE_DEPRECATED;
static QCString iceauthPath();
signals:
void applicationRegistered( const QCString& appId );
void applicationRemoved( const QCString& appId );
void attachFailed(const QString &msg);
void blockUserInput( bool block );
void callBack(int, const QCString&, const QByteArray &);
public slots:
void processSocketData(int socknum);
protected slots:
private slots:
void processPostedMessagesInternal();
void asyncReplyReady();
void eventLoopTimeout();
public:
class ReplyStruct;
void handleAsyncReply(ReplyStruct *replyStruct);
private:
bool isLocalTransactionFinished(Q_INT32 id, QCString &replyType, QByteArray &replyData);
bool attachInternal( bool registerAsAnonymous = true );
bool callInternal(const QCString &remApp, const QCString &remObj,
const QCString &remFun, const QByteArray &data,
QCString& replyType, QByteArray &replyData,
bool useEventLoop, int timeout, int minor_opcode);
bool callInternal(const QCString &remApp, const QCString &remObjId,
const QCString &remFun, const QByteArray &data,
ReplyStruct *replyStruct,
bool useEventLoop, int timeout, int minor_opcode);
protected:
virtual void virtual_hook( int id, void* data );
private:
DCOPClientPrivate *d;
};
#endif
DCOPClient
Inter-process communication and remote procedure calls for KDE applications.
Definition: dcopclient.h:68
DCOPObjectProxy
You must use a proxy if you want to dispatch method calls for object IDs which don't have (yet) a cor...
Definition: dcopobject.h:352

KDE Home | KDE Accessibility Home | Description of Access Keys