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_hidden public
00047 #define k_dcop public
00048 #define ASYNC void
00049 
00066 class DCOPObject
00067 {
00068 public:
00073   DCOPObject();
00079   DCOPObject(QObject *obj);
00084   DCOPObject(const QCString &objId);
00089   virtual ~DCOPObject();
00090 
00095   QCString objId() const;
00096 
00103   bool setObjId(const QCString &objId);
00104 
00136   virtual bool process(const QCString &fun, const QByteArray &data,
00137                QCString& replyType, QByteArray &replyData);
00138 
00139 
00162   virtual bool processDynamic(const QCString &fun, const QByteArray &data,
00163                   QCString& replyType, QByteArray &replyData);
00164 
00176   virtual QCStringList functionsDynamic();
00177 
00189   virtual QCStringList interfacesDynamic();
00190 
00200   virtual QCStringList interfaces();
00201 
00220   virtual QCStringList functions();
00221 
00228   void emitDCOPSignal( const QCString &signal, const QByteArray &data);
00229 
00249   bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
00250                           const QCString &signal,
00251                           const QCString &slot,
00252                           bool Volatile);
00253 
00271   bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
00272                              const QCString &signal,
00273                              const QCString &slot);
00274 
00283   DCOPClient *callingDcopClient();
00284 
00289   void setCallingDcopClient(DCOPClient *);
00290 
00298   static bool hasObject(const QCString &objId);
00299 
00306   static DCOPObject *find(const QCString &objId);
00307 
00308 
00318   static QPtrList<DCOPObject> match(const QCString &partialId);
00319 
00326   static QCString objectName( QObject* obj );
00327 
00328 private:
00332   QCString ident;
00333 
00334 protected:
00335   virtual void virtual_hook( int id, void* data );
00336 private:
00337   class DCOPObjectPrivate;
00338   DCOPObjectPrivate *d;
00339 };
00340 
00341 class DCOPObjectProxyPrivate;
00351 class DCOPObjectProxy
00352 {
00353 public:
00357     DCOPObjectProxy();
00358 
00365     DCOPObjectProxy( DCOPClient*);
00366 
00370     virtual ~DCOPObjectProxy();
00371 
00393     virtual bool process( const QCString& obj, const QCString& fun,
00394               const QByteArray& data,
00395               QCString& replyType, QByteArray &replyData );
00396 private:
00397     void* unused;
00398     void* unused_too;
00399     friend class DCOPClient;
00400     static QPtrList<DCOPObjectProxy>* proxies;
00401 protected:
00402     virtual void virtual_hook( int id, void* data );
00403 private:
00404     DCOPObjectProxyPrivate* d;
00405 };
00406 
00407 
00408 
00409 #endif
 
This file is part of the documentation for dcop Library Version 3.2.0.