dcop
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 <tqobject.h>
00027 #include <tqmap.h>
00028 #include <tqstring.h>
00029 #include <tqptrlist.h>
00030 #include <tqvaluelist.h>
00031 #include <kdatastream.h>
00032 #include "tdelibs_export.h"
00033
00034 class DCOPClient;
00035 typedef TQValueList<TQCString> QCStringList;
00036
00037
00038
00039 #define K_DCOP \
00040 public: \
00041 virtual bool process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &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(TQObject *obj);
00085 DCOPObject(const TQCString &objId);
00090 virtual ~DCOPObject();
00091
00096 TQCString objId() const;
00097
00104 bool setObjId(const TQCString &objId);
00105
00137 virtual bool process(const TQCString &fun, const TQByteArray &data,
00138 TQCString& replyType, TQByteArray &replyData);
00139
00140
00163 virtual bool processDynamic(const TQCString &fun, const TQByteArray &data,
00164 TQCString& replyType, TQByteArray &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 TQCString &signal, const TQByteArray &data);
00230
00250 bool connectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
00251 const TQCString &signal,
00252 const TQCString &slot,
00253 bool Volatile);
00254
00272 bool disconnectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
00273 const TQCString &signal,
00274 const TQCString &slot);
00275
00284 DCOPClient *callingDcopClient();
00285
00290 void setCallingDcopClient(DCOPClient *);
00291
00299 static bool hasObject(const TQCString &objId);
00300
00307 static DCOPObject *find(const TQCString &objId);
00308
00309
00319 static TQPtrList<DCOPObject> match(const TQCString &partialId);
00320
00327 static TQCString objectName( TQObject* obj );
00328
00329 private:
00333 TQCString 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 TQCString& obj, const TQCString& fun,
00395 const TQByteArray& data,
00396 TQCString& replyType, TQByteArray &replyData );
00397 private:
00398 void* unused;
00399 void* unused_too;
00400 friend class DCOPClient;
00401 static TQPtrList<DCOPObjectProxy>* proxies;
00402 protected:
00403 virtual void virtual_hook( int id, void* data );
00404 private:
00405 DCOPObjectProxyPrivate* d;
00406 };
00407
00408
00409
00410 #endif