dcopstub.cpp
/*****************************************************************
Copyright (c) 1999 Preston Brown <pbrown@kde.org>
Copyright (c) 1999 Matthias Ettrich <ettrich@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#include "dcopstub.h"
#include "dcopclient.h"
#include "dcopref.h"
class DCOPStubPrivate
{
public:
DCOPStubPrivate():dcopClient(0){}
DCOPClient* dcopClient;
};
DCOPStub::DCOPStub( const QCString& app, const QCString& obj )
: m_app( app ), m_obj( obj ), m_status( CallSucceeded ),d(0)
{
}
DCOPStub::DCOPStub( DCOPClient* client, const QCString& app, const QCString& obj )
: m_app( app ), m_obj( obj ), m_status( CallSucceeded ),d(0)
{
if ( client ) {
d = new DCOPStubPrivate;
d->dcopClient = client;
}
}
DCOPStub::DCOPStub( const DCOPRef& ref )
: m_app( ref.app() ), m_obj( ref.obj() ), m_status( CallSucceeded ),d(0)
{
}
DCOPStub::~DCOPStub()
{
delete d;
}
DCOPClient* DCOPStub::dcopClient()
{
if ( d )
return d->dcopClient;
return DCOPClient::mainClient();
}
DCOPStub::Status DCOPStub::status() const
{
return m_status;
}
void DCOPStub::setStatus( Status _status )
{
m_status = _status;
}
bool DCOPStub::ok() const
{
return m_status != CallFailed;
}
void DCOPStub::callFailed()
{
setStatus( CallFailed );
}
QCString DCOPStub::app() const
{
return m_app;
}
QCString DCOPStub::obj() const
{
return m_obj;
}
void DCOPStub::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ }
DCOPStub::obj
QCString obj() const
Return the object id.
Definition: dcopstub.cpp:92
DCOPStub::setStatus
void setStatus(Status _status)
Sets the status to status.
Definition: dcopstub.cpp:72
DCOPClient::mainClient
static DCOPClient * mainClient()
Returns the application's main dcop client.
Definition: dcopclient.cpp:583
DCOPRef
A DCOPRef(erence) encapsulates a remote DCOP object as a triple <app,obj,type> where type is optional...
Definition: dcopref.h:278
DCOPStub::ok
bool ok() const
Return whether no error occurred,.
Definition: dcopstub.cpp:77
DCOPClient
Inter-process communication and remote procedure calls for KDE applications.
Definition: dcopclient.h:68
DCOPStub::dcopClient
DCOPClient * dcopClient()
The dcopClient this stub operates on.
Definition: dcopstub.cpp:60
DCOPStub::DCOPStub
DCOPStub(const QCString &app, const QCString &obj)
Creates a DCOPStub for application app and object obj.
Definition: dcopstub.cpp:36
DCOPStub::status
Status status() const
Return the status of the last call, either CallSucceeded or CallFailed.
Definition: dcopstub.cpp:67
DCOPStub::app
QCString app() const
Return the application id.
Definition: dcopstub.cpp:87
DCOPStub::callFailed
virtual void callFailed()
Invoked whenever a call fails.
Definition: dcopstub.cpp:82

KDE Home | KDE Accessibility Home | Description of Access Keys