• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KUtils

kcmoduleproxyIfaceImpl.cpp

Go to the documentation of this file.
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 <qcstring.h>
00020 #include <qdatastream.h>
00021 
00022 #include <dcopclient.h>
00023 
00024 #include <kapplication.h>
00025 #include <kcmoduleproxy.h>
00026 #include <kdebug.h>
00027 
00028 #include "kcmoduleproxyIfaceImpl.h"
00029 
00030 
00031 #include <qmessagebox.h>
00032 
00033 KCModuleProxyIfaceImpl::KCModuleProxyIfaceImpl( const QCString& name, 
00034         KCModuleProxy* const client )
00035     : DCOPObject( name ), QObject( 0, name ),
00036         p( const_cast<KCModuleProxy *>( client ))
00037 { 
00038     connect( p, SIGNAL( changed(bool)), 
00039             SLOT( changedRelay(bool)));
00040     connect( p, SIGNAL( quickHelpChanged()), 
00041             SLOT( quickHelpRelay()));
00042 }
00043 
00044 void KCModuleProxyIfaceImpl::save()
00045 {
00046     kdDebug(711) << k_funcinfo << endl;
00047     p->save();
00048 }
00049 
00050 void KCModuleProxyIfaceImpl::load()
00051 {
00052     kdDebug(711) << k_funcinfo << endl;
00053     p->load();
00054 }
00055 
00056 void KCModuleProxyIfaceImpl::defaults()
00057 {
00058     kdDebug(711) << k_funcinfo << endl;
00059     p->defaults();
00060 }
00061 
00062 QString KCModuleProxyIfaceImpl::applicationName()
00063 {
00064     return kapp->caption();
00065 }
00066 
00067 QString KCModuleProxyIfaceImpl::quickHelp()
00068 {
00069     return p->quickHelp();
00070 }
00071 
00072 bool KCModuleProxyIfaceImpl::changed()
00073 {
00074     return p->changed();
00075 }
00076 
00077 void KCModuleProxyIfaceImpl::changedRelay( bool c )
00078 {
00079     QByteArray data;
00080     QDataStream stream(data, IO_WriteOnly);
00081     stream << c;
00082     emitDCOPSignal( "changed(bool)", data );
00083 }
00084 
00085 void KCModuleProxyIfaceImpl::quickHelpRelay()
00086 {
00087     QByteArray data;
00088     emitDCOPSignal( "quickHelpChanged()", data );
00089 }
00090 
00091 /***************************************************************/
00092 
00093 
00094 
00095 
00096 /***************************************************************/
00097 KCModuleProxyRootCommunicatorImpl::KCModuleProxyRootCommunicatorImpl
00098         ( const QCString& name, KCModuleProxy* const client )
00099     : DCOPObject( name ), QObject( 0, name ), 
00100         p( const_cast<KCModuleProxy *>( client ))
00101 { 
00102     /*
00103      * Connect kcmshell's KCModuleProxy's change signal 
00104      * to us, such that we act as a proxy for 
00105      * KCModuleProxy's API.
00106      */
00107 
00108     /* Note, we don't use KCModuleProxy::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 KCModuleProxyRootCommunicatorImpl::changed( bool c )
00118 {
00119     kdDebug(711) << k_funcinfo << endl;
00120     p->moduleChanged( c );
00121 }
00122 
00123 void KCModuleProxyRootCommunicatorImpl::quickHelpChanged()
00124 {
00125     kdDebug(711) << k_funcinfo << endl;
00126     p->emitQuickHelpChanged();
00127 }
00128 
00129 #include "kcmoduleproxyIfaceImpl.moc"

KUtils

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal