dcop
dcopobject.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _DCOPOBJECT_H
00024 #define _DCOPOBJECT_H
00025
00026 #include <qobject.h>
00027 #include <qmap.h>
00028 #include <qstring.h>
00029 #include <qptrlist.h>
00030 #include <qvaluelist.h>
00031 #include <kdatastream.h>
00032 #include "kdelibs_export.h"
00033
00034 class DCOPClient;
00035 typedef QValueList<QCString> QCStringList;
00036
00037
00038
00039 #define K_DCOP \
00040 public: \
00041 virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); \
00042 QCStringList functions(); \
00043 QCStringList interfaces(); \
00044 private:
00045
00046 #define k_dcop_signals public
00047 #define k_dcop_hidden public
00048 #define k_dcop public
00049 #define ASYNC void
00050
00067 class DCOP_EXPORT DCOPObject
00068 {
00069 public:
00074 DCOPObject();
00080 DCOPObject(QObject *obj);
00085 DCOPObject(const QCString &objId);
00090 virtual ~DCOPObject();
00091
00096 QCString objId() const;
00097
00104 bool setObjId(const QCString &objId);
00105
00137 virtual bool process(const QCString &fun, const QByteArray &data,
00138 QCString& replyType, QByteArray &replyData);
00139
00140
00163 virtual bool processDynamic(const QCString &fun, const QByteArray &data,
00164 QCString& replyType, QByteArray &replyData);
00165
00177 virtual QCStringList functionsDynamic();
00178
00190 virtual QCStringList interfacesDynamic();
00191
00201 virtual QCStringList interfaces();
00202
00221 virtual QCStringList functions();
00222
00229 void emitDCOPSignal( const QCString &signal, const QByteArray &data);
00230
00250 bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
00251 const QCString &signal,
00252 const QCString &slot,
00253 bool Volatile);
00254
00272 bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
00273 const QCString &signal,
00274 const QCString &slot);
00275
00284 DCOPClient *callingDcopClient();
00285
00290 void setCallingDcopClient(DCOPClient *);
00291
00299 static bool hasObject(const QCString &objId);
00300
00307 static DCOPObject *find(const QCString &objId);
00308
00309
00319 static QPtrList<DCOPObject> match(const QCString &partialId);
00320
00327 static QCString objectName( QObject* obj );
00328
00329 private:
00333 QCString ident;
00334
00335 protected:
00336 virtual void virtual_hook( int id, void* data );
00337 private:
00338 class DCOPObjectPrivate;
00339 DCOPObjectPrivate *d;
00340 };
00341
00342 class DCOPObjectProxyPrivate;
00352 class DCOP_EXPORT DCOPObjectProxy
00353 {
00354 public:
00358 DCOPObjectProxy();
00359
00366 DCOPObjectProxy( DCOPClient*);
00367
00371 virtual ~DCOPObjectProxy();
00372
00394 virtual bool process( const QCString& obj, const QCString& fun,
00395 const QByteArray& data,
00396 QCString& replyType, QByteArray &replyData );
00397 private:
00398 void* unused;
00399 void* unused_too;
00400 friend class DCOPClient;
00401 static QPtrList<DCOPObjectProxy>* proxies;
00402 protected:
00403 virtual void virtual_hook( int id, void* data );
00404 private:
00405 DCOPObjectProxyPrivate* d;
00406 };
00407
00408
00409
00410 #endif