dcopobject.h
/*
Copyright (c) 1999,2000 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 _DCOPOBJECT_H
#define _DCOPOBJECT_H
#include <qobject.h>
#include <qmap.h>
#include <qstring.h>
#include <qptrlist.h>
#include <qvaluelist.h>
#include <kdatastream.h> // needed for proper bool marshalling
#include "kdelibs_export.h"
class DCOPClient;
typedef QValueList<QCString> QCStringList;
// Makros for DCOP interfaces
#define K_DCOP \
public: \
virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); \
QCStringList functions(); \
QCStringList interfaces(); \
private:
#define k_dcop_signals public
#define k_dcop_hidden public
#define k_dcop public
#define ASYNC void
class DCOP_EXPORT DCOPObject
{
public:
DCOPObject();
DCOPObject(QObject *obj);
DCOPObject(const QCString &objId);
virtual ~DCOPObject();
QCString objId() const;
bool setObjId(const QCString &objId);
virtual bool process(const QCString &fun, const QByteArray &data,
QCString& replyType, QByteArray &replyData);
virtual bool processDynamic(const QCString &fun, const QByteArray &data,
QCString& replyType, QByteArray &replyData);
virtual QCStringList functionsDynamic();
virtual QCStringList interfacesDynamic();
virtual QCStringList interfaces();
virtual QCStringList functions();
void emitDCOPSignal( const QCString &signal, const QByteArray &data);
bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
const QCString &signal,
const QCString &slot,
bool Volatile);
bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
const QCString &signal,
const QCString &slot);
DCOPClient *callingDcopClient();
void setCallingDcopClient(DCOPClient *);
static bool hasObject(const QCString &objId);
static DCOPObject *find(const QCString &objId);
static QPtrList<DCOPObject> match(const QCString &partialId);
static QCString objectName( QObject* obj );
private:
QCString ident;
protected:
virtual void virtual_hook( int id, void* data );
private:
class DCOPObjectPrivate;
DCOPObjectPrivate *d;
};
class DCOPObjectProxyPrivate;
class DCOP_EXPORT DCOPObjectProxy
{
public:
DCOPObjectProxy();
DCOPObjectProxy( DCOPClient*);
virtual ~DCOPObjectProxy();
virtual bool process( const QCString& obj, const QCString& fun,
const QByteArray& data,
QCString& replyType, QByteArray &replyData );
private:
void* unused;
void* unused_too;
friend class DCOPClient;
static QPtrList<DCOPObjectProxy>* proxies;
protected:
virtual void virtual_hook( int id, void* data );
private:
DCOPObjectProxyPrivate* 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
DCOPObject
Provides an interface for receiving DCOP messages.
Definition: dcopobject.h:67

KDE Home | KDE Accessibility Home | Description of Access Keys