dcop Library: dcopstub.cpp Source File (dcop Library)

| # dcop Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# dcopstub.cpp

    00001 /*****************************************************************
    00002
    00003 Copyright (c) 1999 Preston Brown <pbrown@kde.org>
    00004 Copyright (c) 1999 Matthias Ettrich <ettrich@kde.org>
    00005
    00006 Permission is hereby granted, free of charge, to any person obtaining a copy
    00007 of this software and associated documentation files (the "Software"), to deal
    00008 in the Software without restriction, including without limitation the rights
    00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00010 copies of the Software, and to permit persons to whom the Software is
    00011 furnished to do so, subject to the following conditions:
    00012
    00013 The above copyright notice and this permission notice shall be included in
    00014 all copies or substantial portions of the Software.
    00015
    00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    00019 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00022
    00023 ******************************************************************/
    00024
    00025 #include "dcopstub.h"
    00026 #include "dcopclient.h"
    00027 #include "dcopref.h"
    00028
    00029 class DCOPStubPrivate
    00030 {
    00031 public:
    00032     DCOPStubPrivate():dcopClient(0){}
    00033     DCOPClient* dcopClient;
    00034 };
    00035
    00036 DCOPStub::DCOPStub( const QCString& app, const QCString& obj )
    00037     : m_app( app ), m_obj( obj ), m_status( CallSucceeded ),d(0)
    00038 {
    00039 }
    00040
    00041 DCOPStub::DCOPStub( DCOPClient* client, const QCString& app, const QCString& obj )
    00042     : m_app( app ), m_obj( obj ), m_status( CallSucceeded ),d(0)
    00043 {
    00044     if ( client ) {
    00045     d = new DCOPStubPrivate;
    00046     d->dcopClient = client;
    00047     }
    00048 }
    00049
    00050 DCOPStub::DCOPStub( const DCOPRef& ref )
    00051     : m_app( ref.app() ), m_obj( ref.obj() ), m_status( CallSucceeded ),d(0)
    00052 {
    00053 }
    00054
    00055 DCOPStub::~DCOPStub()
    00056 {
    00057     delete d;
    00058 }
    00059
    00060 DCOPClient* DCOPStub::dcopClient()
    00061 {
    00062     if ( d )
    00063     return d->dcopClient;
    00064     return DCOPClient::mainClient();
    00065 }
    00066
    00067 DCOPStub::Status DCOPStub::status() const
    00068 {
    00069     return m_status;
    00070 }
    00071
    00072 void DCOPStub::setStatus( Status _status )
    00073 {
    00074     m_status = _status;
    00075 }
    00076
    00077 bool DCOPStub::ok() const
    00078 {
    00079     return m_status != CallFailed;
    00080 }
    00081
    00082 void DCOPStub::callFailed()
    00083 {
    00084     setStatus( CallFailed );
    00085 }
    00086
    00087 QCString DCOPStub::app() const
    00088 {
    00089     return m_app;
    00090 }
    00091
    00092 QCString DCOPStub::obj() const
    00093 {
    00094     return m_obj;
    00095 }
    00096
    00097 void DCOPStub::virtual_hook( int, void* )
    00098 { /*BASE::virtual_hook( id, data );*/ }

This file is part of the documentation for dcop Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:16:55 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003