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

tdeutils

tdecmoduleproxyIfaceImpl.cpp
00001 /*
00002  * Copyright (C) 2004 Frans Englich <frans.englich@telia.com>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License version 2 as published by the Free Software Foundation.
00007  *
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Library General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Library General Public License
00014  * along with this library; see the file COPYING.LIB.  If not, write to
00015  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #include <tqcstring.h>
00020 #include <tqdatastream.h>
00021 
00022 #include <dcopclient.h>
00023 
00024 #include <tdeapplication.h>
00025 #include <tdecmoduleproxy.h>
00026 #include <kdebug.h>
00027 
00028 #include "tdecmoduleproxyIfaceImpl.h"
00029 
00030 
00031 #include <tqmessagebox.h>
00032 
00033 TDECModuleProxyIfaceImpl::TDECModuleProxyIfaceImpl( const TQCString& name, 
00034         TDECModuleProxy* const client )
00035     : DCOPObject( name ), TQObject( 0, name ),
00036         p( const_cast<TDECModuleProxy *>( client ))
00037 { 
00038     connect( p, TQT_SIGNAL( changed(bool)), 
00039             TQT_SLOT( changedRelay(bool)));
00040     connect( p, TQT_SIGNAL( quickHelpChanged()), 
00041             TQT_SLOT( quickHelpRelay()));
00042 }
00043 
00044 void TDECModuleProxyIfaceImpl::save()
00045 {
00046     kdDebug(711) << k_funcinfo << endl;
00047     p->save();
00048 }
00049 
00050 void TDECModuleProxyIfaceImpl::load()
00051 {
00052     kdDebug(711) << k_funcinfo << endl;
00053     p->load();
00054 }
00055 
00056 void TDECModuleProxyIfaceImpl::defaults()
00057 {
00058     kdDebug(711) << k_funcinfo << endl;
00059     p->defaults();
00060 }
00061 
00062 TQString TDECModuleProxyIfaceImpl::applicationName()
00063 {
00064     return kapp->caption();
00065 }
00066 
00067 TQString TDECModuleProxyIfaceImpl::quickHelp()
00068 {
00069     return p->quickHelp();
00070 }
00071 
00072 bool TDECModuleProxyIfaceImpl::changed()
00073 {
00074     return p->changed();
00075 }
00076 
00077 void TDECModuleProxyIfaceImpl::changedRelay( bool c )
00078 {
00079     TQByteArray data;
00080     TQDataStream stream(data, IO_WriteOnly);
00081     stream << c;
00082     emitDCOPSignal( "changed(bool)", data );
00083 }
00084 
00085 void TDECModuleProxyIfaceImpl::quickHelpRelay()
00086 {
00087     TQByteArray data;
00088     emitDCOPSignal( "quickHelpChanged()", data );
00089 }
00090 
00091 /***************************************************************/
00092 
00093 
00094 
00095 
00096 /***************************************************************/
00097 TDECModuleProxyRootCommunicatorImpl::TDECModuleProxyRootCommunicatorImpl
00098         ( const TQCString& name, TDECModuleProxy* const client )
00099     : DCOPObject( name ), TQObject( 0, name ), 
00100         p( const_cast<TDECModuleProxy *>( client ))
00101 { 
00102     /*
00103      * Connect tdecmshell's TDECModuleProxy's change signal 
00104      * to us, such that we act as a proxy for 
00105      * TDECModuleProxy's API.
00106      */
00107 
00108     /* Note, we don't use TDECModuleProxy::d->dcopClient */
00109     kapp->dcopClient()->connectDCOPSignal( 0, p->dcopName(), 
00110             "changed(bool)", objId(), "changed(bool)", false );
00111 
00112     kapp->dcopClient()->connectDCOPSignal( 0, p->dcopName(), 
00113             "quickHelpChanged()", objId(), "quickHelpChanged()", false );
00114 }
00115 
00116 /* Reimplementations of DCOP members */
00117 void TDECModuleProxyRootCommunicatorImpl::changed( bool c )
00118 {
00119     kdDebug(711) << k_funcinfo << endl;
00120     p->moduleChanged( c );
00121 }
00122 
00123 void TDECModuleProxyRootCommunicatorImpl::quickHelpChanged()
00124 {
00125     kdDebug(711) << k_funcinfo << endl;
00126     p->emitQuickHelpChanged();
00127 }
00128 
00129 #include "tdecmoduleproxyIfaceImpl.moc"

tdeutils

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

tdeutils

Skip menu "tdeutils"
  • 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 tdeutils by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.