• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • xmlgui
kxmlguiclient.h
Go to the documentation of this file.
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 <kdeui_export.h>
23
24#include <QtCore/QMap>
25#include <QtCore/QStringList>
26
27class QDomDocument;
28class QDomElement;
29class QWidget;
30
31class QAction;
32class KActionCollection;
33class KComponentData;
34class KXMLGUIClientPrivate;
35class KXMLGUIFactory;
36class KXMLGUIBuilder;
37
38namespace KDEPrivate { class KEditToolBarWidget; }
39
46class KDEUI_EXPORT KXMLGUIClient
47{
48 friend class KDEPrivate::KEditToolBarWidget; // for setXMLFile(3 args)
49public:
55 KXMLGUIClient();
56
68 explicit KXMLGUIClient( KXMLGUIClient *parent );
69
79 virtual ~KXMLGUIClient();
80
86 QAction* action( const char* name ) const;
87
93 virtual QAction *action( const QDomElement &element ) const;
94
98 virtual KActionCollection* actionCollection() const;
99
103 virtual KComponentData componentData() const;
104
110 virtual QDomDocument domDocument() const;
111
125 virtual QString xmlFile() const;
126
127 virtual QString localXMLFile() const;
128
132 void setXMLGUIBuildDocument( const QDomDocument &doc );
136 QDomDocument xmlguiBuildDocument() const;
137
142 void setFactory( KXMLGUIFactory *factory );
148 KXMLGUIFactory *factory() const;
149
155 KXMLGUIClient *parentClient() const;
156
163 void insertChildClient( KXMLGUIClient *child );
164
168 void removeChildClient( KXMLGUIClient *child );
169
173 QList<KXMLGUIClient*> childClients();
174
183 void setClientBuilder( KXMLGUIBuilder *builder );
184
189 KXMLGUIBuilder *clientBuilder() const;
190
200 void reloadXML();
201
245 void plugActionList( const QString &name, const QList<QAction*> &actionList );
246
254 void unplugActionList( const QString &name );
255
256 static QString findMostRecentXMLFile( const QStringList &files, QString &doc );
257
258 void addStateActionEnabled(const QString& state, const QString& action);
259
260 void addStateActionDisabled(const QString& state, const QString& action);
261
262 enum ReverseStateChange { StateNoReverse, StateReverse };
263 struct StateChange
264 {
265 QStringList actionsToEnable;
266 QStringList actionsToDisable;
267 };
268
269 StateChange getActionsToChangeForState(const QString& state);
270
271 void beginXMLPlug( QWidget * );
272 void endXMLPlug();
273 void prepareXMLUnplug( QWidget * );
274
298 void replaceXMLFile( const QString& xmlfile, const QString& localxmlfile, bool merge = false );
299
300protected:
305 //bool addSuperClient( KXMLGUIClient * );
306
313 virtual void setComponentData(const KComponentData &componentData);
314
331 virtual void setXMLFile( const QString& file, bool merge = false, bool setXMLDoc = true );
332
337 void loadStandardsXmlFile();
338
344 virtual void setLocalXMLFile( const QString &file );
345
352 virtual void setXML( const QString &document, bool merge = false );
353
369 virtual void setDOMDocument( const QDomDocument &document, bool merge = false );
370
382 virtual void stateChanged(const QString &newstate, ReverseStateChange reverse = StateNoReverse);
383
384 // KDE5 TODO: virtual void loadActionLists() {}, called when the guiclient is added to the xmlgui factory
385
386protected:
387 virtual void virtual_hook( int id, void* data );
388
389private:
390 KXMLGUIClientPrivate * const d;
391};
392
393#endif
KActionCollection
A container for a set of QAction objects.
Definition: kactioncollection.h:57
KComponentData
KXMLGUIBuilder
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory.
Definition: kxmlguibuilder.h:42
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:47
KXMLGUIClient::ReverseStateChange
ReverseStateChange
Definition: kxmlguiclient.h:262
KXMLGUIFactory
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:66
QAction
QList
QWidget
kdeui_export.h
KDEPrivate
Definition: kcolorchoosermode.cpp:24
KXMLGUIClient::StateChange
Definition: kxmlguiclient.h:264
KXMLGUIClient::StateChange::actionsToEnable
QStringList actionsToEnable
Definition: kxmlguiclient.h:265
KXMLGUIClient::StateChange::actionsToDisable
QStringList actionsToDisable
Definition: kxmlguiclient.h:266
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal