dcopobject.h
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
00033 class DCOPClient;
00034 typedef QValueList<QCString> QCStringList;
00035
00036
00037
00038 #define K_DCOP \
00039 public: \
00040 virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); \
00041 QCStringList functions(); \
00042 QCStringList interfaces(); \
00043 private:
00044
00045 #define k_dcop_signals public
00046 #define k_dcop public
00047 #define ASYNC void
00048
00065 class DCOPObject
00066 {
00067 public:
00072 DCOPObject();
00078 DCOPObject(QObject *obj);
00083 DCOPObject(const QCString &objId);
00088 virtual ~DCOPObject();
00089
00094 QCString objId() const;
00095
00102 bool setObjId(const QCString &objId);
00103
00135 virtual bool process(const QCString &fun, const QByteArray &data,
00136 QCString& replyType, QByteArray &replyData);
00137
00138
00161 virtual bool processDynamic(const QCString &fun, const QByteArray &data,
00162 QCString& replyType, QByteArray &replyData);
00163
00175 virtual QCStringList functionsDynamic();
00176
00188 virtual QCStringList interfacesDynamic();
00189
00199 virtual QCStringList interfaces();
00200
00219 virtual QCStringList functions();
00220
00227 void emitDCOPSignal( const QCString &signal, const QByteArray &data);
00228
00248 bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
00249 const QCString &signal,
00250 const QCString &slot,
00251 bool Volatile);
00252
00270 bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
00271 const QCString &signal,
00272 const QCString &slot);
00273
00282 DCOPClient *callingDcopClient();
00283
00288 void setCallingDcopClient(DCOPClient *);
00289
00297 static bool hasObject(const QCString &objId);
00298
00305 static DCOPObject *find(const QCString &objId);
00306
00307
00317 static QPtrList<DCOPObject> match(const QCString &partialId);
00318
00325 static QCString objectName( QObject* obj );
00326
00327 private:
00331 QCString ident;
00332
00333 protected:
00334 virtual void virtual_hook( int id, void* data );
00335 private:
00336 class DCOPObjectPrivate;
00337 DCOPObjectPrivate *d;
00338 };
00339
00340 class DCOPObjectProxyPrivate;
00350 class DCOPObjectProxy
00351 {
00352 public:
00356 DCOPObjectProxy();
00357
00364 DCOPObjectProxy( DCOPClient*);
00365
00369 virtual ~DCOPObjectProxy();
00370
00391 virtual bool process( const QCString& obj, const QCString& fun,
00392 const QByteArray& data,
00393 QCString& replyType, QByteArray &replyData );
00394 private:
00395 void* unused;
00396 void* unused_too;
00397 friend class DCOPClient;
00398 static QPtrList<DCOPObjectProxy>* proxies;
00399 protected:
00400 virtual void virtual_hook( int id, void* data );
00401 private:
00402 DCOPObjectProxyPrivate* d;
00403 };
00404
00405
00406
00407 #endif
This file is part of the documentation for kdelibs Version 3.1.4.