• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • dcop
 

dcop

  • dcop
dcopclient.h
1 /*
2 Copyright (c) 1999 Preston Brown <pbrown@kde.org>
3 Copyright (c) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22 
23 #ifndef _DCOPCLIENT_H
24 #define _DCOPCLIENT_H
25 
26 #include <tqobject.h>
27 #include <tqcstring.h>
28 #include <tqvaluelist.h>
29 #include <tqstring.h>
30 #include <kdatastream.h> // needed for proper bool marshalling
31 #include <kdelibs_export.h>
32 
33 class DCOPObjectProxy;
34 class DCOPClientPrivate;
35 class DCOPClientTransaction;
36 
37 typedef TQValueList<TQCString> QCStringList;
38 
68 class DCOP_EXPORT DCOPClient : public TQObject
69 {
70  Q_OBJECT
71  TQ_OBJECT
72 
73  public:
76  DCOPClient();
77 
81  virtual ~DCOPClient();
82 
90  static void setServerAddress(const TQCString &addr);
91 
110  bool attach();
111 
118  void bindToApp();
119 
124  bool detach();
125 
130  bool isAttached() const;
131 
137  bool isAttachedToForeignServer() const;
138 
143  bool acceptCalls() const;
144 
151  void setAcceptCalls(bool b);
152 
159  bool qtBridgeEnabled(); // ### KDE 4.0: make const
160 
168  void setQtBridgeEnabled(bool b);
169 
195  TQCString registerAs( const TQCString &appId, bool addPID = true );
196 
201  bool isRegistered() const;
202 
208  TQCString appId() const;
209 
214  int socket() const;
215 
228  void suspend();
229 
235  void resume();
236 
243  bool isSuspended() const;
244 
255  bool send(const TQCString &remApp, const TQCString &remObj,
256  const TQCString &remFun, const TQByteArray &data);
257 
269  bool send(const TQCString &remApp, const TQCString &remObj,
270  const TQCString &remFun, const TQString &data);
271 
301  bool call(const TQCString &remApp, const TQCString &remObj,
302  const TQCString &remFun, const TQByteArray &data,
303  TQCString& replyType, TQByteArray &replyData,
304  bool useEventLoop/*=false*/, int timeout/*=-1*/);
308  // KDE4 merge with above
309  bool call(const TQCString &remApp, const TQCString &remObj,
310  const TQCString &remFun, const TQByteArray &data,
311  TQCString& replyType, TQByteArray &replyData,
312  bool useEventLoop=false);
313 
342  int callAsync(const TQCString &remApp, const TQCString &remObj,
343  const TQCString &remFun, const TQByteArray &data,
344  TQObject *callBackObj, const char *callBackSlot);
345 
382  bool findObject(const TQCString &remApp, const TQCString &remObj,
383  const TQCString &remFun, const TQByteArray &data,
384  TQCString &foundApp, TQCString &foundObj,
385  bool useEventLoop/*=false*/, int timeout/*=-1*/);
386 
390  // KDE4 merge with above
391  bool findObject(const TQCString &remApp, const TQCString &remObj,
392  const TQCString &remFun, const TQByteArray &data,
393  TQCString &foundApp, TQCString &foundObj,
394  bool useEventLoop=false);
395 
396 
401  void emitDCOPSignal( const TQCString &object, const TQCString &signal,
402  const TQByteArray &data);
403 
404  /* For backwards compatibility */
405  void emitDCOPSignal( const TQCString &signal, const TQByteArray &data);
406 
427  bool connectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
428  const TQCString &signal,
429  const TQCString &receiverObj, const TQCString &slot,
430  bool Volatile);
431 
436  bool connectDCOPSignal( const TQCString &sender, const TQCString &signal,
437  const TQCString &receiverObj, const TQCString &slot,
438  bool Volatile) KDE_DEPRECATED;
439 
457  bool disconnectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
458  const TQCString &signal,
459  const TQCString &receiverObj, const TQCString &slot);
460 
465  bool disconnectDCOPSignal( const TQCString &sender, const TQCString &signal,
466  const TQCString &receiverObj, const TQCString &slot) KDE_DEPRECATED;
467 
483  virtual bool process(const TQCString &fun, const TQByteArray &data,
484  TQCString& replyType, TQByteArray &replyData);
485 
495  DCOPClientTransaction *beginTransaction( );
496 
504  void endTransaction( DCOPClientTransaction *t, TQCString& replyType, TQByteArray &replyData);
505 
515  TQ_INT32 transactionId() const;
516 
522  bool isApplicationRegistered( const TQCString& remApp);
523 
529  QCStringList registeredApplications();
530 
538  QCStringList remoteObjects( const TQCString& remApp, bool *ok = 0 );
539 
549  QCStringList remoteInterfaces( const TQCString& remApp, const TQCString& remObj , bool *ok = 0 );
550 
560  QCStringList remoteFunctions( const TQCString& remApp, const TQCString& remObj , bool *ok = 0 );
561 
576  bool receive(const TQCString &app, const TQCString &obj,
577  const TQCString &fun, const TQByteArray& data,
578  TQCString& replyType, TQByteArray &replyData);
579 
593  bool find(const TQCString &app, const TQCString &obj,
594  const TQCString &fun, const TQByteArray& data,
595  TQCString& replyType, TQByteArray &replyData);
596 
614  static TQCString normalizeFunctionSignature( const TQCString& fun );
615 
616 
622  TQCString senderId() const;
623 
624 
632  void setDefaultObject( const TQCString& objId );
633 
642  TQCString defaultObject() const;
643 
655  void setNotifications( bool enabled );
656 
665  void setDaemonMode( bool daemonMode );
666 
672  void setPriorityCall(bool);
673 
681  static DCOPClient* mainClient();
682 
690  static void setMainClient( DCOPClient* mainClient);
691 
697  static DCOPClient* findLocalClient( const TQCString &_appId );
698 
702  static void emergencyClose();
703 
709  static const char *postMortemSender();
711  static const char *postMortemObject();
713  static const char *postMortemFunction();
714 
722  static TQCString dcopServerFile(const TQCString &hostname=0);
723 
729  static TQCString dcopServerFileOld(const TQCString &hostname=0) KDE_DEPRECATED;
730 
734  static TQCString iceauthPath();
735 
736 signals:
745  void applicationRegistered( const TQCString& appId );
754  void applicationRemoved( const TQCString& appId );
755 
764  void attachFailed(const TQString &msg);
765 
783  void blockUserInput( bool block );
784 
794  void callBack(int, const TQCString&, const TQByteArray &);
795 
796 public slots:
801  void processSocketData(int socknum);
802 
803 protected slots:
804 
805 private slots:
806  void processPostedMessagesInternal();
807  void asyncReplyReady();
808  void eventLoopTimeout();
809 
810 public:
811  class ReplyStruct;
812 
816  void handleAsyncReply(ReplyStruct *replyStruct);
817 
818 private:
819 
820  bool isLocalTransactionFinished(TQ_INT32 id, TQCString &replyType, TQByteArray &replyData);
821 
822  bool attachInternal( bool registerAsAnonymous = true );
823 
824  bool callInternal(const TQCString &remApp, const TQCString &remObj,
825  const TQCString &remFun, const TQByteArray &data,
826  TQCString& replyType, TQByteArray &replyData,
827  bool useEventLoop, int timeout, int minor_opcode);
828 
829 
830  bool callInternal(const TQCString &remApp, const TQCString &remObjId,
831  const TQCString &remFun, const TQByteArray &data,
832  ReplyStruct *replyStruct,
833  bool useEventLoop, int timeout, int minor_opcode);
834 
835 protected:
836  virtual void virtual_hook( int id, void* data );
837 private:
838  DCOPClientPrivate *d;
839 };
840 
841 #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

dcop

Skip menu "dcop"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

dcop

Skip menu "dcop"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for dcop by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |