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

tdeui

  • tdeui
kxmlguiclient.h
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
3 Copyright (C) 2000 Kurt Granroth <granroth@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef _KXMLGUICLIENT_H
20#define _KXMLGUICLIENT_H
21
22#include <tqdom.h>
23#include <tqptrlist.h>
24#include <tqmap.h>
25#include <tqstringlist.h>
26
27#include <tdelibs_export.h>
28
29class TQWidget;
30class TDEAction;
31class TDEActionCollection;
32class TDEInstance;
33class KXMLGUIClientPrivate;
34class KXMLGUIFactory;
35class KXMLGUIBuilder;
36
43class TDEUI_EXPORT KXMLGUIClient
44{
45 friend class KEditToolbarWidget; // for setXMLFile(3 args)
46public:
52 KXMLGUIClient();
53
65 KXMLGUIClient( KXMLGUIClient *parent );
66
70 virtual ~KXMLGUIClient();
71
77 TDEAction* action( const char* name ) const;
78
84 virtual TDEAction *action( const TQDomElement &element ) const;
85
95 virtual TDEActionCollection* actionCollection() const;
96
100 virtual TDEInstance *instance() const;
101
107 virtual TQDomDocument domDocument() const;
108
122 virtual TQString xmlFile() const;
123
124 virtual TQString localXMLFile() const;
125
129 void setXMLGUIBuildDocument( const TQDomDocument &doc );
133 TQDomDocument xmlguiBuildDocument() const;
134
139 void setFactory( KXMLGUIFactory *factory );
145 KXMLGUIFactory *factory() const;
146
152 KXMLGUIClient *parentClient() const;
153
160 void insertChildClient( KXMLGUIClient *child );
161
165 void removeChildClient( KXMLGUIClient *child );
166
170 const TQPtrList<KXMLGUIClient> *childClients();
171
180 void setClientBuilder( KXMLGUIBuilder *builder );
181
186 KXMLGUIBuilder *clientBuilder() const;
187
195 void reloadXML();
196
237 void plugActionList( const TQString &name, const TQPtrList<TDEAction> &actionList );
238
242 void unplugActionList( const TQString &name );
243
244 static TQString findMostRecentXMLFile( const TQStringList &files, TQString &doc );
245
246 void addStateActionEnabled(const TQString& state, const TQString& action);
247
248 void addStateActionDisabled(const TQString& state, const TQString& action);
249
250 enum ReverseStateChange { StateNoReverse, StateReverse };
251 struct StateChange
252 {
253 TQStringList actionsToEnable;
254 TQStringList actionsToDisable;
255 };
256
257 StateChange getActionsToChangeForState(const TQString& state);
258
260 void beginXMLPlug( TQWidget * );
262 void endXMLPlug();
264 void prepareXMLUnplug( TQWidget * );
265
266protected:
271 //bool addSuperClient( KXMLGUIClient * );
272
279 virtual void setInstance( TDEInstance *instance );
280
294 virtual void setXMLFile( const TQString& file, bool merge = false, bool setXMLDoc = true );
295
296 virtual void setLocalXMLFile( const TQString &file );
297
304 virtual void setXML( const TQString &document, bool merge = false );
305
312 virtual void setDOMDocument( const TQDomDocument &document, bool merge = false );
313
319 virtual void conserveMemory();
320
332 virtual void stateChanged(const TQString &newstate, ReverseStateChange reverse = StateNoReverse);
333
334 // Use this one for KDE 4.0
335 //virtual void stateChanged(const TQString &newstate, bool reverse = false);
336
337private:
338 struct DocStruct
339 {
340 TQString file;
341 TQString data;
342 };
343
344 bool mergeXML( TQDomElement &base, const TQDomElement &additive,
345 TDEActionCollection *actionCollection );
346
347 TQDomElement findMatchingElement( const TQDomElement &base,
348 const TQDomElement &additive );
349
350 typedef TQMap<TQString, TQMap<TQString, TQString> > ActionPropertiesMap;
351
352 static ActionPropertiesMap extractActionProperties( const TQDomDocument &doc );
353
354 static void storeActionProperties( TQDomDocument &doc, const ActionPropertiesMap &properties );
355
356 static TQString findVersionNumber( const TQString &_xml );
357
358 // Actions to enable/disable on a state change
359 TQMap<TQString,StateChange> m_actionsStateMap;
360
361protected:
362 virtual void virtual_hook( int id, void* data );
363private:
364 KXMLGUIClientPrivate *d;
365};
366
367#endif
KEditToolbarWidget
A widget used to customize or configure toolbars.
Definition: kedittoolbar.h:270
KEditToolbarWidget::actionCollection
virtual TDEActionCollection * actionCollection() const
Definition: kedittoolbar.cpp:1062
KXMLGUIBuilder
Abstract interface for a "GUI builder", used by the GUIFactory This interface is implemented by TDEMa...
Definition: kxmlguibuilder.h:40
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:44
KXMLGUIClient::parentClient
KXMLGUIClient * parentClient() const
KXMLGUIClients can form a simple child/parent object tree.
Definition: kxmlguiclient.cpp:560
KXMLGUIClient::plugActionList
void plugActionList(const TQString &name, const TQPtrList< TDEAction > &actionList)
ActionLists are a way for XMLGUI to support dynamic lists of actions.
Definition: kxmlguiclient.cpp:605
KXMLGUIClient::xmlFile
virtual TQString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:133
KXMLGUIClient::unplugActionList
void unplugActionList(const TQString &name)
The complement of plugActionList() ...
Definition: kxmlguiclient.cpp:613
KXMLGUIClient::KXMLGUIClient
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and a...
Definition: kxmlguiclient.cpp:67
KXMLGUIClient::removeChildClient
void removeChildClient(KXMLGUIClient *child)
Removes the given child from the client's children list.
Definition: kxmlguiclient.cpp:573
KXMLGUIClient::instance
virtual TDEInstance * instance() const
Definition: kxmlguiclient.cpp:123
KXMLGUIClient::xmlguiBuildDocument
TQDomDocument xmlguiBuildDocument() const
Definition: kxmlguiclient.cpp:545
KXMLGUIClient::reloadXML
void reloadXML()
Forces this client to re-read its XML resource file.
Definition: kxmlguiclient.cpp:150
KXMLGUIClient::setXMLGUIBuildDocument
void setXMLGUIBuildDocument(const TQDomDocument &doc)
Definition: kxmlguiclient.cpp:540
KXMLGUIClient::factory
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the clien...
Definition: kxmlguiclient.cpp:555
KXMLGUIClient::~KXMLGUIClient
virtual ~KXMLGUIClient()
Destructs the KXMLGUIClient.
Definition: kxmlguiclient.cpp:78
KXMLGUIClient::setClientBuilder
void setClientBuilder(KXMLGUIBuilder *builder)
A client can have an own KXMLGUIBuilder.
Definition: kxmlguiclient.cpp:593
KXMLGUIClient::action
TDEAction * action(const char *name) const
Retrieves an action of the client by name.
Definition: kxmlguiclient.cpp:93
KXMLGUIClient::setFactory
void setFactory(KXMLGUIFactory *factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GU...
Definition: kxmlguiclient.cpp:550
KXMLGUIClient::clientBuilder
KXMLGUIBuilder * clientBuilder() const
Retrieves the client's GUI builder or 0L if no client specific builder has been assigned via setClien...
Definition: kxmlguiclient.cpp:600
KXMLGUIClient::childClients
const TQPtrList< KXMLGUIClient > * childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:588
KXMLGUIClient::insertChildClient
void insertChildClient(KXMLGUIClient *child)
Use this method to make a client a child client of another client.
Definition: kxmlguiclient.cpp:565
KXMLGUIClient::domDocument
virtual TQDomDocument domDocument() const
Definition: kxmlguiclient.cpp:128
KXMLGUIFactory
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:62
TDEActionCollection
A managed set of TDEAction objects.
Definition: tdeactioncollection.h:79
TDEAction
Class to encapsulate user-driven action or event.
Definition: tdeaction.h:203
TDEInstance

tdeui

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

tdeui

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