KXmlGui

kxmlguifactory.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: 2000 Kurt Granroth <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-only
7 */
8 
9 #ifndef kxmlguifactory_h
10 #define kxmlguifactory_h
11 
12 #include <kxmlgui_export.h>
13 
14 #include <QObject>
15 #include <memory>
16 
17 class QAction;
18 class KXMLGUIFactoryPrivate;
19 class KXMLGUIClient;
20 class KXMLGUIBuilder;
21 
22 class QDomAttr;
23 class QDomDocument;
24 class QDomElement;
25 class QDomNode;
26 class QDomNamedNodeMap;
27 
28 namespace KXMLGUI
29 {
30 struct MergingIndex;
31 struct ContainerNode;
32 struct ContainerClient;
33 class BuildHelper;
34 }
35 
55 class KXMLGUI_EXPORT KXMLGUIFactory : public QObject
56 {
57  friend class KXMLGUI::BuildHelper;
58  Q_OBJECT
59 public:
67  explicit KXMLGUIFactory(KXMLGUIBuilder *builder, QObject *parent = nullptr);
68 
72  ~KXMLGUIFactory();
73 
74  // XXX move to somewhere else? (Simon)
76  static QString readConfigFile(const QString &filename,
77  const QString &componentName = QString());
79  static bool saveConfigFile(const QDomDocument &doc, const QString &filename,
80  const QString &componentName = QString());
81 
86  static QDomElement actionPropertiesElement(QDomDocument &doc);
87 
93  static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create);
94 
105  void addClient(KXMLGUIClient *client);
106 
112  void removeClient(KXMLGUIClient *client);
113 
114  void plugActionList(KXMLGUIClient *client, const QString &name, const QList<QAction *> &actionList);
115  void unplugActionList(KXMLGUIClient *client, const QString &name);
116 
120  QList<KXMLGUIClient *> clients() const;
121 
142  QWidget *container(const QString &containerName, KXMLGUIClient *client, bool useTagName = false);
143 
144  QList<QWidget *> containers(const QString &tagName);
145 
154  void reset();
155 
165  void resetContainer(const QString &containerName, bool useTagName = false);
166 
171  void refreshActionProperties();
172 
173 public Q_SLOTS:
188  int configureShortcuts(bool bAllowLetterShortcuts = true, bool bSaveSettings = true);
189 
190  void changeShortcutScheme(const QString &scheme);
191 
192 Q_SIGNALS:
193  void clientAdded(KXMLGUIClient *client);
194  void clientRemoved(KXMLGUIClient *client);
195 
206  void makingChanges(bool);
207 
215  void shortcutsSaved();
216 
217 private:
219  void forgetClient(KXMLGUIClient *client);
220 
221 private:
222  friend class KXMLGUIClient;
223  std::unique_ptr<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:39
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-2021 The KDE developers.
Generated on Wed Jan 27 2021 22:50:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.