KXmlGui

kxmlguiwindow.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Reginald Stadlbauer <[email protected]>
4  SPDX-FileCopyrightText: 1997 Stephan Kulow <[email protected]>
5  SPDX-FileCopyrightText: 1997-2000 Sven Radej <[email protected]>
6  SPDX-FileCopyrightText: 1997-2000 Matthias Ettrich <[email protected]>
7  SPDX-FileCopyrightText: 1999 Chris Schlaeger <[email protected]>
8  SPDX-FileCopyrightText: 2002 Joseph Wenninger <[email protected]>
9  SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <[email protected]>
10 
11  SPDX-License-Identifier: LGPL-2.0-only
12 */
13 
14 #ifndef KXMLGUIWINDOW_H
15 #define KXMLGUIWINDOW_H
16 
17 #include "kxmlguiclient.h"
18 #include "kxmlguibuilder.h"
19 #include "kmainwindow.h"
20 
21 class KMenu;
22 class KXMLGUIFactory;
23 class KConfig;
24 class KConfigGroup;
25 class KToolBar;
26 class KXmlGuiWindowPrivate;
27 
45 class KXMLGUI_EXPORT KXmlGuiWindow : public KMainWindow, public KXMLGUIBuilder, virtual public KXMLGUIClient
46 {
47  XMLGUI_DECLARE_PRIVATE(KXmlGuiWindow)
48  Q_OBJECT
49  Q_PROPERTY(bool hasMenuBar READ hasMenuBar)
50  Q_PROPERTY(bool autoSaveSettings READ autoSaveSettings)
51  Q_PROPERTY(QString autoSaveGroup READ autoSaveGroup)
52  Q_PROPERTY(bool standardToolBarMenuEnabled READ isStandardToolBarMenuEnabled WRITE setStandardToolBarMenuEnabled)
53 
54 public:
89  explicit KXmlGuiWindow(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
90 
97  ~KXmlGuiWindow() override;
98 
105  void setHelpMenuEnabled(bool showHelpMenu = true);
106 
110  bool isHelpMenuEnabled() const;
111 
112  virtual KXMLGUIFactory *guiFactory();
113 
127  void createGUI(const QString &xmlfile = QString());
128 
145  void setStandardToolBarMenuEnabled(bool enable);
146  bool isStandardToolBarMenuEnabled() const;
147 
168  void createStandardStatusBarAction();
169 
180  ToolBar = 1,
181 
185  Keys = 2,
186 
192  StatusBar = 4,
193 
204  Save = 8,
205 
217  Create = 16,
218 
223  Default = ToolBar | Keys | StatusBar | Save | Create
224  };
230 
247  void setupGUI(StandardWindowOptions options = Default, const QString &xmlfile = QString());
248 
266  void setupGUI(const QSize &defaultSize, StandardWindowOptions options = Default, const QString &xmlfile = QString());
267 
271  QAction *toolBarMenuAction();
272 
276  void setupToolbarMenuActions();
277 
278  // KDE5 TODO: change it to "using KXMLGUIBuilder::finalizeGUI;"
279  void finalizeGUI(KXMLGUIClient *client) override;
280 
284  void finalizeGUI(bool force);
285 
286  // reimplemented for internal reasons
287  void applyMainWindowSettings(const KConfigGroup &config) override;
288 
289 public Q_SLOTS:
300  virtual void configureToolbars();
301 
307  virtual void slotStateChanged(const QString &newstate);
308 
316  void slotStateChanged(const QString &newstate,
317  bool reverse);
318 
319 protected:
325  bool event(QEvent *event) override;
326 
332  void checkAmbiguousShortcuts();
333 
334 protected Q_SLOTS:
339  virtual void saveNewToolbarConfig();
340 
341 private:
342  Q_PRIVATE_SLOT(k_func(), void _k_slotFactoryMakingChanges(bool))
343 };
344 
345 Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions)
346 
347 #endif
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:38
Top level main window with predefined action layout.
Definition: kxmlguiwindow.h:45
Top level main window.
Definition: kmainwindow.h:96
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory...
Q_FLAG(...)
Q_PROPERTY(...)
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Floatable toolbar with auto resize.
Definition: ktoolbar.h:59
typedef WindowFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:50:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.