KXmlGui

kxmlguifactory.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Simon Hausmann <[email protected]>
3  Copyright (C) 2000 Kurt Granroth <[email protected]>
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 
20 #ifndef kxmlguifactory_h
21 #define kxmlguifactory_h
22 
23 #include <kxmlgui_export.h>
24 
25 #include <QObject>
26 
27 class QAction;
28 class KXMLGUIFactoryPrivate;
29 class KXMLGUIClient;
30 class KXMLGUIBuilder;
31 
32 class QDomAttr;
33 class QDomDocument;
34 class QDomElement;
35 class QDomNode;
36 class QDomNamedNodeMap;
37 
38 namespace KXMLGUI
39 {
40 struct MergingIndex;
41 struct ContainerNode;
42 struct ContainerClient;
43 class BuildHelper;
44 }
45 
65 class KXMLGUI_EXPORT KXMLGUIFactory : public QObject
66 {
67  friend class KXMLGUI::BuildHelper;
68  Q_OBJECT
69 public:
77  explicit KXMLGUIFactory(KXMLGUIBuilder *builder, QObject *parent = nullptr);
78 
82  ~KXMLGUIFactory();
83 
84  // XXX move to somewhere else? (Simon)
86  static QString readConfigFile(const QString &filename,
87  const QString &componentName = QString());
89  static bool saveConfigFile(const QDomDocument &doc, const QString &filename,
90  const QString &componentName = QString());
91 
96  static QDomElement actionPropertiesElement(QDomDocument &doc);
97 
103  static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create);
104 
115  void addClient(KXMLGUIClient *client);
116 
122  void removeClient(KXMLGUIClient *client);
123 
124  void plugActionList(KXMLGUIClient *client, const QString &name, const QList<QAction *> &actionList);
125  void unplugActionList(KXMLGUIClient *client, const QString &name);
126 
130  QList<KXMLGUIClient *> clients() const;
131 
152  QWidget *container(const QString &containerName, KXMLGUIClient *client, bool useTagName = false);
153 
154  QList<QWidget *> containers(const QString &tagName);
155 
164  void reset();
165 
175  void resetContainer(const QString &containerName, bool useTagName = false);
176 
181  void refreshActionProperties();
182 
183 public Q_SLOTS:
198  int configureShortcuts(bool bAllowLetterShortcuts = true, bool bSaveSettings = true);
199 
200  void changeShortcutScheme(const QString &scheme);
201 
202 Q_SIGNALS:
203  void clientAdded(KXMLGUIClient *client);
204  void clientRemoved(KXMLGUIClient *client);
205 
216  void makingChanges(bool);
217 
218 private:
219  friend class KXMLGUIClient;
221  void forgetClient(KXMLGUIClient *client);
222 
223  KXMLGUIFactoryPrivate *const d;
224 };
225 
226 #endif
227 
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:48
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory...
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 22:49:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.