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

KDEUI

  • kdeui
  • xmlgui
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 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License version 2 as published by the Free Software Foundation.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
20
21 You should have received a copy of the GNU Library General Public License
22 along with this library; see the file COPYING.LIB. If not, write to
23 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25
26
27*/
28
29#ifndef KXMLGUIWINDOW_H
30#define KXMLGUIWINDOW_H
31
32#include "kxmlguiclient.h"
33#include "kxmlguibuilder.h"
34#include <kmainwindow.h>
35#include <QtCore/QMetaClassInfo>
36
37class KMenu;
38class KXMLGUIFactory;
39class KConfig;
40class KConfigGroup;
41class KToolBar;
42class KXmlGuiWindowPrivate;
43
44#define KDE_DEFAULT_WINDOWFLAGS 0
45
60
61class KDEUI_EXPORT KXmlGuiWindow : public KMainWindow, public KXMLGUIBuilder, virtual public KXMLGUIClient
62{
63 KDEUI_DECLARE_PRIVATE(KXmlGuiWindow)
64 Q_OBJECT
65 Q_PROPERTY( bool hasMenuBar READ hasMenuBar )
66 Q_PROPERTY( bool autoSaveSettings READ autoSaveSettings )
67 Q_PROPERTY( QString autoSaveGroup READ autoSaveGroup )
68 Q_PROPERTY( bool standardToolBarMenuEnabled READ isStandardToolBarMenuEnabled WRITE setStandardToolBarMenuEnabled )
69 Q_FLAGS( StandardWindowOption )
70 Q_PROPERTY( bool initialGeometrySet READ initialGeometrySet )
71
72public:
107 explicit KXmlGuiWindow( QWidget* parent = 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS );
108
115 virtual ~KXmlGuiWindow();
116
123 void setHelpMenuEnabled(bool showHelpMenu = true);
124
128 bool isHelpMenuEnabled() const;
129
130 virtual KXMLGUIFactory *guiFactory();
131
145 void createGUI( const QString &xmlfile = QString() );
146
147
164 void setStandardToolBarMenuEnabled( bool enable );
165 bool isStandardToolBarMenuEnabled() const;
166
167
187 void createStandardStatusBarAction();
188
192 enum StandardWindowOption
193 {
199 ToolBar = 1,
200
204 Keys = 2,
205
210 StatusBar = 4,
211
222 Save = 8,
223
234 Create = 16,
235
240 Default = ToolBar | Keys | StatusBar | Save | Create
241 };
242 Q_DECLARE_FLAGS(StandardWindowOptions, StandardWindowOption)
243
244
260 void setupGUI( StandardWindowOptions options = Default, const QString& xmlfile = QString() );
261
279 void setupGUI( const QSize& defaultSize, StandardWindowOptions options = Default, const QString& xmlfile = QString() );
280
284 QAction *toolBarMenuAction();
285
289 void setupToolbarMenuActions();
290
291 // KDE5 TODO: change it to "using KXMLGUIBuilder::finalizeGUI;"
292 virtual void finalizeGUI( KXMLGUIClient *client );
293
297 void finalizeGUI( bool force );
298
299 // reimplemented for internal reasons
300 virtual void applyMainWindowSettings(const KConfigGroup &config, bool force = false);
301
302public Q_SLOTS:
313 virtual void configureToolbars();
314
320 virtual void slotStateChanged(const QString &newstate);
321
329 void slotStateChanged(const QString &newstate,
330 bool reverse);
331
332protected:
338 virtual bool event( QEvent * event );
339
340protected Q_SLOTS:
345 virtual void saveNewToolbarConfig();
346
347private:
348 Q_PRIVATE_SLOT(k_func(), void _k_slotFactoryMakingChanges(bool))
349};
350
351Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions)
352
353#endif
KConfigGroup
KConfig
KMainWindow::applyMainWindowSettings
virtual void applyMainWindowSettings(const KConfigGroup &config, bool forceGlobal=false)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
Definition kmainwindow.cpp:746
KMainWindow::event
virtual bool event(QEvent *event)
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition kmainwindow.cpp:1061
KMainWindow::KMainWindow
KMainWindow(QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
Construct a main window.
Definition kmainwindow.cpp:217
KMenu
A menu with keyboard searching.
Definition kmenu.h:42
KToolBar
Floatable toolbar with auto resize.
Definition ktoolbar.h:54
KXMLGUIBuilder::finalizeGUI
virtual void finalizeGUI(KXMLGUIClient *client)
Definition kxmlguibuilder.cpp:402
KXMLGUIBuilder::KXMLGUIBuilder
KXMLGUIBuilder(QWidget *widget)
Definition kxmlguibuilder.cpp:79
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition kxmlguiclient.h:47
KXMLGUIClient::KXMLGUIClient
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and a...
Definition kxmlguiclient.cpp:82
KXMLGUIFactory
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition kxmlguifactory.h:66
KXmlGuiWindow::createGUI
void createGUI(const QString &xmlfile=QString())
Create a GUI given a local XML file.
Definition kxmlguiwindow.cpp:232
KXmlGuiWindow::createStandardStatusBarAction
void createStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KT...
Definition kxmlguiwindow.cpp:321
KXmlGuiWindow::guiFactory
virtual KXMLGUIFactory * guiFactory()
Definition kxmlguiwindow.cpp:150
KXmlGuiWindow::autoSaveSettings
bool autoSaveSettings
Definition kxmlguiwindow.h:66
KXmlGuiWindow::hasMenuBar
bool hasMenuBar
Definition kxmlguiwindow.h:65
KXmlGuiWindow::setStandardToolBarMenuEnabled
void setStandardToolBarMenuEnabled(bool enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( us...
Definition kxmlguiwindow.cpp:292
KXmlGuiWindow::initialGeometrySet
bool initialGeometrySet
Definition kxmlguiwindow.h:70
KXmlGuiWindow::isStandardToolBarMenuEnabled
bool isStandardToolBarMenuEnabled() const
Definition kxmlguiwindow.cpp:315
KXmlGuiWindow::standardToolBarMenuEnabled
bool standardToolBarMenuEnabled
Definition kxmlguiwindow.h:68
KXmlGuiWindow::StandardWindowOption
StandardWindowOption
Definition kxmlguiwindow.h:193
KXmlGuiWindow::StatusBar
@ StatusBar
adds action to show/hide the statusbar if the statusbar exists.
Definition kxmlguiwindow.h:210
KXmlGuiWindow::Save
@ Save
auto-saves (and loads) the toolbar/menubar/statusbar settings and window size using the default name.
Definition kxmlguiwindow.h:222
KXmlGuiWindow::ToolBar
@ ToolBar
adds action to show/hide the toolbar(s) and adds action to configure the toolbar(s).
Definition kxmlguiwindow.h:199
KXmlGuiWindow::Default
@ Default
All the above option (this is the default)
Definition kxmlguiwindow.h:240
KXmlGuiWindow::Create
@ Create
calls createGUI() once ToolBar, Keys and Statusbar have been taken care of.
Definition kxmlguiwindow.h:234
KXmlGuiWindow::Keys
@ Keys
adds action to show the key configure action.
Definition kxmlguiwindow.h:204
KXmlGuiWindow::KXmlGuiWindow
KXmlGuiWindow(QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
Construct a main window.
Definition kxmlguiwindow.cpp:88
KXmlGuiWindow::autoSaveGroup
QString autoSaveGroup
Definition kxmlguiwindow.h:67
KXmlGuiWindow::setHelpMenuEnabled
void setHelpMenuEnabled(bool showHelpMenu=true)
Enables the build of a standard help menu when calling createGUI/setupGUI().
Definition kxmlguiwindow.cpp:138
KXmlGuiWindow::isHelpMenuEnabled
bool isHelpMenuEnabled() const
Return true when the help menu is enabled.
Definition kxmlguiwindow.cpp:144
QAction
QWidget
kmainwindow.h
KDEUI_DECLARE_PRIVATE
#define KDEUI_DECLARE_PRIVATE(classname)
Definition kmainwindow.h:48
kxmlguibuilder.h
kxmlguiclient.h
KDE_DEFAULT_WINDOWFLAGS
#define KDE_DEFAULT_WINDOWFLAGS
Definition kxmlguiwindow.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 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
  • 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