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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • 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 
37 class KMenu;
38 class KXMLGUIFactory;
39 class KConfig;
40 class KConfigGroup;
41 class KToolBar;
42 class KXmlGuiWindowPrivate;
43 
44 #define KDE_DEFAULT_WINDOWFLAGS 0
45 
61 class 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 
72 public:
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 
302 public 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 
332 protected:
338  virtual bool event( QEvent * event );
339 
340 protected Q_SLOTS:
345  virtual void saveNewToolbarConfig();
346 
347 private:
348  Q_PRIVATE_SLOT(k_func(), void _k_slotFactoryMakingChanges(bool))
349 };
350 
351 Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions)
352 
353 #endif
QEvent
QWidget
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:46
KMenu
A menu with keyboard searching.
Definition: kmenu.h:42
kxmlguibuilder.h
KXmlGuiWindow::StandardWindowOption
StandardWindowOption
Definition: kxmlguiwindow.h:192
KXmlGuiWindow
KDE top level main window with predefined action layout
Definition: kxmlguiwindow.h:61
KMainWindow
KDE top level main window
Definition: kmainwindow.h:106
KXMLGUIBuilder
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory...
Definition: kxmlguibuilder.h:41
QString
KStandardAction::Save
Definition: kstandardaction.h:129
QSize
KXMLGUIFactory
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:65
kmainwindow.h
KConfigGroup
kxmlguiclient.h
KConfig
KDE_DEFAULT_WINDOWFLAGS
#define KDE_DEFAULT_WINDOWFLAGS
Definition: kxmlguiwindow.h:44
KToolBar
Floatable toolbar with auto resize.
Definition: ktoolbar.h:53
QAction
KStandardAction::configureToolbars
KAction * configureToolbars(const QObject *recvr, const char *slot, QObject *parent)
The Customize Toolbar dialog.
Definition: kstandardaction.cpp:586
KDEUI_DECLARE_PRIVATE
#define KDEUI_DECLARE_PRIVATE(classname)
Definition: kmainwindow.h:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 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
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs 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

Search



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