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

kutils

  • kutils
kcmoduleproxyIfaceImpl.cpp
1 /*
2  * Copyright (C) 2004 Frans Englich <frans.englich@telia.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License version 2 as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public License
14  * along with this library; see the file COPYING.LIB. If not, write to
15  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301, USA.
17  */
18 
19 #include <tqcstring.h>
20 #include <tqdatastream.h>
21 
22 #include <dcopclient.h>
23 
24 #include <kapplication.h>
25 #include <kcmoduleproxy.h>
26 #include <kdebug.h>
27 
28 #include "kcmoduleproxyIfaceImpl.h"
29 
30 
31 #include <tqmessagebox.h>
32 
33 KCModuleProxyIfaceImpl::KCModuleProxyIfaceImpl( const TQCString& name,
34  KCModuleProxy* const client )
35  : DCOPObject( name ), TQObject( 0, name ),
36  p( const_cast<KCModuleProxy *>( client ))
37 {
38  connect( p, TQT_SIGNAL( changed(bool)),
39  TQT_SLOT( changedRelay(bool)));
40  connect( p, TQT_SIGNAL( quickHelpChanged()),
41  TQT_SLOT( quickHelpRelay()));
42 }
43 
44 void KCModuleProxyIfaceImpl::save()
45 {
46  kdDebug(711) << k_funcinfo << endl;
47  p->save();
48 }
49 
50 void KCModuleProxyIfaceImpl::load()
51 {
52  kdDebug(711) << k_funcinfo << endl;
53  p->load();
54 }
55 
56 void KCModuleProxyIfaceImpl::defaults()
57 {
58  kdDebug(711) << k_funcinfo << endl;
59  p->defaults();
60 }
61 
62 TQString KCModuleProxyIfaceImpl::applicationName()
63 {
64  return kapp->caption();
65 }
66 
67 TQString KCModuleProxyIfaceImpl::quickHelp()
68 {
69  return p->quickHelp();
70 }
71 
72 bool KCModuleProxyIfaceImpl::changed()
73 {
74  return p->changed();
75 }
76 
77 void KCModuleProxyIfaceImpl::changedRelay( bool c )
78 {
79  TQByteArray data;
80  TQDataStream stream(data, IO_WriteOnly);
81  stream << c;
82  emitDCOPSignal( "changed(bool)", data );
83 }
84 
85 void KCModuleProxyIfaceImpl::quickHelpRelay()
86 {
87  TQByteArray data;
88  emitDCOPSignal( "quickHelpChanged()", data );
89 }
90 
91 /***************************************************************/
92 
93 
94 
95 
96 /***************************************************************/
97 KCModuleProxyRootCommunicatorImpl::KCModuleProxyRootCommunicatorImpl
98  ( const TQCString& name, KCModuleProxy* const client )
99  : DCOPObject( name ), TQObject( 0, name ),
100  p( const_cast<KCModuleProxy *>( client ))
101 {
102  /*
103  * Connect kcmshell's KCModuleProxy's change signal
104  * to us, such that we act as a proxy for
105  * KCModuleProxy's API.
106  */
107 
108  /* Note, we don't use KCModuleProxy::d->dcopClient */
109  kapp->dcopClient()->connectDCOPSignal( 0, p->dcopName(),
110  "changed(bool)", objId(), "changed(bool)", false );
111 
112  kapp->dcopClient()->connectDCOPSignal( 0, p->dcopName(),
113  "quickHelpChanged()", objId(), "quickHelpChanged()", false );
114 }
115 
116 /* Reimplementations of DCOP members */
117 void KCModuleProxyRootCommunicatorImpl::changed( bool c )
118 {
119  kdDebug(711) << k_funcinfo << endl;
120  p->moduleChanged( c );
121 }
122 
123 void KCModuleProxyRootCommunicatorImpl::quickHelpChanged()
124 {
125  kdDebug(711) << k_funcinfo << endl;
126  p->emitQuickHelpChanged();
127 }
128 
129 #include "kcmoduleproxyIfaceImpl.moc"
kdDebug
kdbgstream kdDebug(int area=0)
KCModuleProxyRootDispatcher::changed
virtual void changed(bool c)=0
KCModuleProxyIface::changed() gets connected to this.
KCModuleProxy
Encapsulates a KCModule for embedding.
Definition: kcmoduleproxy.h:68
endl
kndbgstream & endl(kndbgstream &s)

kutils

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

kutils

Skip menu "kutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kutils by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |