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

dcop

  • dcop
dcopclient.h
1/*
2Copyright (c) 1999 Preston Brown <pbrown@kde.org>
3Copyright (c) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION 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 <tdelibs_export.h>
32
33class DCOPObjectProxy;
34class DCOPClientPrivate;
35class DCOPClientTransaction;
36
37typedef TQValueList<TQCString> QCStringList;
38
68class DCOP_EXPORT DCOPClient : public TQObject
69{
70 TQ_OBJECT
71
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
303
304 bool call(const TQCString &remApp, const TQCString &remObj,
305 const TQCString &remFun, const TQByteArray &data,
306 TQCString& replyType, TQByteArray &replyData,
307 bool useEventLoop/*=false*/, int timeout/*=-1*/,
308 bool forceRemote/*=false*/);
309
313 // KDE4 merge with above
314 bool call(const TQCString &remApp, const TQCString &remObj,
315 const TQCString &remFun, const TQByteArray &data,
316 TQCString& replyType, TQByteArray &replyData,
317 bool useEventLoop/*=false*/, int timeout/*=-1*/);
321 // KDE4 merge with above
322 bool call(const TQCString &remApp, const TQCString &remObj,
323 const TQCString &remFun, const TQByteArray &data,
324 TQCString& replyType, TQByteArray &replyData,
325 bool useEventLoop=false);
326
355 int callAsync(const TQCString &remApp, const TQCString &remObj,
356 const TQCString &remFun, const TQByteArray &data,
357 TQObject *callBackObj, const char *callBackSlot);
358
395 bool findObject(const TQCString &remApp, const TQCString &remObj,
396 const TQCString &remFun, const TQByteArray &data,
397 TQCString &foundApp, TQCString &foundObj,
398 bool useEventLoop/*=false*/, int timeout/*=-1*/);
399
403 // KDE4 merge with above
404 bool findObject(const TQCString &remApp, const TQCString &remObj,
405 const TQCString &remFun, const TQByteArray &data,
406 TQCString &foundApp, TQCString &foundObj,
407 bool useEventLoop=false);
408
409
414 void emitDCOPSignal( const TQCString &object, const TQCString &signal,
415 const TQByteArray &data);
416
417 /* For backwards compatibility */
418 void emitDCOPSignal( const TQCString &signal, const TQByteArray &data);
419
440 bool connectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
441 const TQCString &signal,
442 const TQCString &receiverObj, const TQCString &slot,
443 bool Volatile);
444
449 bool connectDCOPSignal( const TQCString &sender, const TQCString &signal,
450 const TQCString &receiverObj, const TQCString &slot,
451 bool Volatile) TDE_DEPRECATED;
452
470 bool disconnectDCOPSignal( const TQCString &sender, const TQCString &senderObj,
471 const TQCString &signal,
472 const TQCString &receiverObj, const TQCString &slot);
473
478 bool disconnectDCOPSignal( const TQCString &sender, const TQCString &signal,
479 const TQCString &receiverObj, const TQCString &slot) TDE_DEPRECATED;
480
496 virtual bool process(const TQCString &fun, const TQByteArray &data,
497 TQCString& replyType, TQByteArray &replyData);
498
508 DCOPClientTransaction *beginTransaction( );
509
517 void endTransaction( DCOPClientTransaction *t, TQCString& replyType, TQByteArray &replyData);
518
528 TQ_INT32 transactionId() const;
529
535 bool isApplicationRegistered( const TQCString& remApp);
536
542 QCStringList registeredApplications();
543
551 QCStringList remoteObjects( const TQCString& remApp, bool *ok = 0 );
552
562 QCStringList remoteInterfaces( const TQCString& remApp, const TQCString& remObj , bool *ok = 0 );
563
573 QCStringList remoteFunctions( const TQCString& remApp, const TQCString& remObj , bool *ok = 0 );
574
589 bool receive(const TQCString &app, const TQCString &obj,
590 const TQCString &fun, const TQByteArray& data,
591 TQCString& replyType, TQByteArray &replyData);
592
606 bool find(const TQCString &app, const TQCString &obj,
607 const TQCString &fun, const TQByteArray& data,
608 TQCString& replyType, TQByteArray &replyData);
609
627 static TQCString normalizeFunctionSignature( const TQCString& fun );
628
629
635 TQCString senderId() const;
636
637
645 void setDefaultObject( const TQCString& objId );
646
655 TQCString defaultObject() const;
656
668 void setNotifications( bool enabled );
669
678 void setDaemonMode( bool daemonMode );
679
685 void setPriorityCall(bool);
686
694 static DCOPClient* mainClient();
695
703 static void setMainClient( DCOPClient* mainClient);
704
710 static DCOPClient* findLocalClient( const TQCString &_appId );
711
715 static void emergencyClose();
716
722 static const char *postMortemSender();
724 static const char *postMortemObject();
726 static const char *postMortemFunction();
727
735 static TQCString dcopServerFile(const TQCString &hostname=0);
736
742 static TQCString dcopServerFileOld(const TQCString &hostname=0) TDE_DEPRECATED;
743
747 static TQCString iceauthPath();
748
749signals:
758 void applicationRegistered( const TQCString& appId );
767 void applicationRemoved( const TQCString& appId );
768
777 void attachFailed(const TQString &msg);
778
796 void blockUserInput( bool block );
797
807 void callBack(int, const TQCString&, const TQByteArray &);
808
809public slots:
814 void processSocketData(int socknum);
815
816protected slots:
817
818private slots:
819 void processPostedMessagesInternal();
820 void asyncReplyReady();
821 void eventLoopTimeout();
822
823public:
824 class ReplyStruct;
825
829 void handleAsyncReply(ReplyStruct *replyStruct);
830
831private:
832
833 bool isLocalTransactionFinished(TQ_INT32 id, TQCString &replyType, TQByteArray &replyData);
834
835 bool attachInternal( bool registerAsAnonymous = true );
836
837 bool callInternal(const TQCString &remApp, const TQCString &remObj,
838 const TQCString &remFun, const TQByteArray &data,
839 TQCString& replyType, TQByteArray &replyData,
840 bool useEventLoop, int timeout, int minor_opcode);
841
842
843 bool callInternal(const TQCString &remApp, const TQCString &remObjId,
844 const TQCString &remFun, const TQByteArray &data,
845 ReplyStruct *replyStruct,
846 bool useEventLoop, int timeout, int minor_opcode);
847
848protected:
849 virtual void virtual_hook( int id, void* data );
850private:
851 DCOPClientPrivate *d;
852};
853
854#endif
DCOPClient::setDaemonMode
void setDaemonMode(bool daemonMode)
Tells the dcopserver to treat the client as daemon client, not as regular client.
Definition dcopclient.cpp:1348
DCOPClient::remoteFunctions
QCStringList remoteFunctions(const TQCString &remApp, const TQCString &remObj, bool *ok=0)
Retrieves the list of functions of the remote object remObj of application remApp.
Definition dcopclient.cpp:1320
DCOPClient::endTransaction
void endTransaction(DCOPClientTransaction *t, TQCString &replyType, TQByteArray &replyData)
Sends the delayed reply of a function call.
Definition dcopclient.cpp:2129
DCOPClient::appId
TQCString appId() const
Returns the current app id or a null string if the application hasn't yet been registered.
Definition dcopclient.cpp:1036
DCOPClient::detach
bool detach()
Detaches from the DCOP server.
Definition dcopclient.cpp:926
DCOPClient::setQtBridgeEnabled
void setQtBridgeEnabled(bool b)
Specify whether Qt objects of the application should be accessible via DCOP.
Definition dcopclient.cpp:978
DCOPClient::beginTransaction
DCOPClientTransaction * beginTransaction()
Delays the reply of the current function call until endTransaction() is called.
Definition dcopclient.cpp:2099
DCOPClient::isApplicationRegistered
bool isApplicationRegistered(const TQCString &remApp)
Checks whether remApp is registered with the DCOP server.
Definition dcopclient.cpp:1262
DCOPClient::emitDCOPSignal
void emitDCOPSignal(const TQCString &object, const TQCString &signal, const TQByteArray &data)
Emits signal as DCOP signal from object object with data as arguments.
Definition dcopclient.cpp:2179
DCOPClient::registeredApplications
QCStringList registeredApplications()
Retrieves the list of all currently registered applications from dcopserver.
Definition dcopclient.cpp:1276
DCOPClient::disconnectDCOPSignal
bool disconnectDCOPSignal(const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot)
Disconnects a DCOP signal.
Definition dcopclient.cpp:2227
DCOPClient::remoteInterfaces
QCStringList remoteInterfaces(const TQCString &remApp, const TQCString &remObj, bool *ok=0)
Retrieves the list of interfaces of the remote object remObj of application remApp.
Definition dcopclient.cpp:1304
DCOPClient::transactionId
TQ_INT32 transactionId() const
Test whether the current function call is delayed.
Definition dcopclient.cpp:2120
DCOPClient::dcopServerFileOld
static TQCString dcopServerFileOld(const TQCString &hostname=0) TDE_DEPRECATED
Definition dcopclient.cpp:323
DCOPClient::attach
bool attach()
Attaches to the DCOP server.
Definition dcopclient.cpp:679
DCOPClient::send
bool send(const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data)
Sends a data block to the server.
Definition dcopclient.cpp:1089
DCOPClient::isRegistered
bool isRegistered() const
Returns whether or not the client is registered at the server.
Definition dcopclient.cpp:1030
DCOPClient::resume
void resume()
Resumes the processing of DCOP events.
Definition dcopclient.cpp:711
DCOPClient::isAttachedToForeignServer
bool isAttachedToForeignServer() const
Returns whether the client is attached to a server owned by another user.
Definition dcopclient.cpp:957
DCOPClient::senderId
TQCString senderId() const
Returns the appId of the last application that talked to us.
Definition dcopclient.cpp:1083
DCOPClient::findLocalClient
static DCOPClient * findLocalClient(const TQCString &_appId)
Look for the given client only in this process.
Definition dcopclient.cpp:99
DCOPClient::qtBridgeEnabled
bool qtBridgeEnabled()
Returns whether the DCOP - Qt bridge is enabled.
Definition dcopclient.cpp:973
DCOPClient::callAsync
int callAsync(const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQObject *callBackObj, const char *callBackSlot)
Performs a asynchronous send with receive callback.
Definition dcopclient.cpp:1830
DCOPClient::isAttached
bool isAttached() const
Returns whether or not the client is attached to the server.
Definition dcopclient.cpp:949
DCOPClient::acceptCalls
bool acceptCalls() const
Returns whether the client handles incoming calls.
Definition dcopclient.cpp:962
DCOPClient::call
bool call(const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData, bool useEventLoop, int timeout, bool forceRemote)
Performs a synchronous send and receive.
Definition dcopclient.cpp:1786
DCOPClient::socket
int socket() const
Returns the socket fd that is used for communication with the server.
Definition dcopclient.cpp:1042
DCOPClient::setNotifications
void setNotifications(bool enabled)
Enables / disables the applicationRegistered() / applicationRemoved() signals.
Definition dcopclient.cpp:1336
DCOPClient::setMainClient
static void setMainClient(DCOPClient *mainClient)
Sets the application's main dcop client.
Definition dcopclient.cpp:604
DCOPClient::blockUserInput
void blockUserInput(bool block)
Indicates that user input shall be blocked or released, depending on the argument.
DCOPClient::setServerAddress
static void setServerAddress(const TQCString &addr)
Sets the address of a server to use upon attaching.
Definition dcopclient.cpp:671
DCOPClient::applicationRegistered
void applicationRegistered(const TQCString &appId)
Indicates that the application appId has been registered with the server we are attached to.
DCOPClient::mainClient
static DCOPClient * mainClient()
Returns the application's main dcop client.
Definition dcopclient.cpp:599
DCOPClient::applicationRemoved
void applicationRemoved(const TQCString &appId)
Indicates that the formerly registered application appId has been removed.
DCOPClient::findObject
bool findObject(const TQCString &remApp, const TQCString &remObj, const TQCString &remFun, const TQByteArray &data, TQCString &foundApp, TQCString &foundObj, bool useEventLoop, int timeout)
Searches for an object which matches a criteria.
Definition dcopclient.cpp:1160
DCOPClient::defaultObject
TQCString defaultObject() const
Returns the current default object or an empty string if no object is installed as default object.
Definition dcopclient.cpp:2079
DCOPClient::DCOPClient
DCOPClient()
Constructs a new DCOP client, but does not attach to any server.
Definition dcopclient.cpp:610
DCOPClient::attachFailed
void attachFailed(const TQString &msg)
Indicates that the process of establishing DCOP communications failed in some manner.
DCOPClient::remoteObjects
QCStringList remoteObjects(const TQCString &remApp, bool *ok=0)
Retrieves the list of objects of the remote application remApp.
Definition dcopclient.cpp:1288
DCOPClient::process
virtual bool process(const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData)
Reimplement this function to handle app-wide function calls unassociated w/an object.
Definition dcopclient.cpp:1256
DCOPClient::connectDCOPSignal
bool connectDCOPSignal(const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &receiverObj, const TQCString &slot, bool Volatile)
Connects to a DCOP signal.
Definition dcopclient.cpp:2192
DCOPClient::suspend
void suspend()
Temporarily suspends processing of DCOP events.
Definition dcopclient.cpp:701
DCOPClient::registerAs
TQCString registerAs(const TQCString &appId, bool addPID=true)
Registers at the DCOP server.
Definition dcopclient.cpp:983
DCOPClient::processSocketData
void processSocketData(int socknum)
Process data from the socket.
Definition dcopclient.cpp:2037
DCOPClient::isSuspended
bool isSuspended() const
Returns whether DCOP events are being processed.
Definition dcopclient.cpp:721
DCOPClient::dcopServerFile
static TQCString dcopServerFile(const TQCString &hostname=0)
File with information how to reach the dcopserver.
Definition dcopclient.cpp:316
DCOPClient::normalizeFunctionSignature
static TQCString normalizeFunctionSignature(const TQCString &fun)
Normalizes the function signature fun.
Definition dcopclient.cpp:1055
DCOPClient::setAcceptCalls
void setAcceptCalls(bool b)
Specify whether the client should accept incoming calls.
Definition dcopclient.cpp:967
DCOPClient::setDefaultObject
void setDefaultObject(const TQCString &objId)
Installs object objId as application-wide default object.
Definition dcopclient.cpp:2073
DCOPClient::iceauthPath
static TQCString iceauthPath()
Return the path of iceauth or an empty string if not found.
Definition dcopclient.cpp:214
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:353

dcop

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

dcop

Skip menu "dcop"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for dcop by doxygen 1.15.0
This website is maintained by Timothy Pearson.