Krita Source Code Documentation
Loading...
Searching...
No Matches
kxmlguiwindow.h
Go to the documentation of this file.
1/*
2 This file is part of the KDE libraries
3 Copyright
4 (C) 2000 Reginald Stadlbauer (reggie@kde.org)
5 (C) 1997 Stephan Kulow (coolo@kde.org)
6 (C) 1997-2000 Sven Radej (radej@kde.org)
7 (C) 1997-2000 Matthias Ettrich (ettrich@kde.org)
8 (C) 1999 Chris Schlaeger (cs@kde.org)
9 (C) 2002 Joseph Wenninger (jowenn@kde.org)
10 (C) 2005-2006 Hamish Rodda (rodda@kde.org)
11
12 SPDX-License-Identifier: LGPL-2.0-only
13
14*/
15
16#ifndef KisKXMLGUIWINDOW_H
17#define KisKXMLGUIWINDOW_H
18
19#include "kxmlguiclient.h"
20#include "kxmlguibuilder.h"
21#include "kmainwindow.h"
22#include <QMetaClassInfo>
23
24class KMenu;
26class KConfig;
27class KConfigGroup;
28class KisToolBar;
30
46class KRITAWIDGETUTILS_EXPORT KXmlGuiWindow : public KisKMainWindow, public KisKXMLGUIBuilder, virtual public KisKXMLGUIClient
47{
49 Q_OBJECT
50 Q_PROPERTY(bool hasMenuBar READ hasMenuBar)
51 Q_PROPERTY(bool autoSaveSettings READ autoSaveSettings)
52 Q_PROPERTY(QString autoSaveGroup READ autoSaveGroup)
53 Q_PROPERTY(bool standardToolBarMenuEnabled READ isStandardToolBarMenuEnabled WRITE setStandardToolBarMenuEnabled)
55
56public:
91 explicit KXmlGuiWindow(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
92
99 ~KXmlGuiWindow() override;
100
107 void setHelpMenuEnabled(bool showHelpMenu = true);
108
112 bool isHelpMenuEnabled() const;
113
114 virtual KisKXMLGUIFactory *guiFactory();
115
129 void createGUI(const QString &xmlfile = QString());
130
147 void setStandardToolBarMenuEnabled(bool enable);
148 bool isStandardToolBarMenuEnabled() const;
149
169 void createStandardStatusBarAction();
170
180 ToolBar = 1,
181
185 Keys = 2,
186
191 StatusBar = 4,
192
203 Save = 8,
204
215 Create = 16,
216
221 Default = ToolBar | Keys | StatusBar | Save | Create
222 };
223 Q_DECLARE_FLAGS(StandardWindowOptions, StandardWindowOption)
224
225
241 void setupGUI(StandardWindowOptions options = Default, const QString &xmlfile = QString());
242
260 void setupGUI(const QSize &defaultSize, StandardWindowOptions options = Default, const QString &xmlfile = QString());
261
265 QAction *toolBarMenuAction();
266
270 void setupToolbarMenuActions();
271
272 // KDE5 TODO: change it to "using KisKXMLGUIBuilder::finalizeGUI;"
273 void finalizeGUI(KisKXMLGUIClient *client) override;
274
278 void finalizeGUI(bool force);
279
280 // reimplemented for internal reasons
281 void applyMainWindowSettings(const KConfigGroup &config) override;
282
283public Q_SLOTS:
294 virtual void configureToolbars();
295
301 virtual void slotStateChanged(const QString &newstate);
302
310 void slotStateChanged(const QString &newstate,
311 bool reverse);
312
313protected:
319 bool event(QEvent *event) override;
320
321protected Q_SLOTS:
326 virtual void saveNewToolbarConfig();
327
328private:
329 Q_PRIVATE_SLOT(k_func(), void _k_slotFactoryMakingChanges(bool))
330};
331
332Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions)
333
334#endif
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)
KDE top level main window with predefined action layout
KDE top level main window
Definition kmainwindow.h:89
Q_PRIVATE_SLOT(k_func(), void _k_slotSettingsChanged(int)) Q_PRIVATE_SLOT(k_func()
virtual void applyMainWindowSettings(const KConfigGroup &config)
bool event(QEvent *event) override
virtual void finalizeGUI(KisKXMLGUIClient *client)
Floatable toolbar with auto resize.
Definition ktoolbar.h:47
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)
#define XMLGUI_DECLARE_PRIVATE(classname)
Definition kmainwindow.h:33