KDEUI
kxmlguiwindow.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the KDE libraries 00003 Copyright 00004 (C) 2000 Reginald Stadlbauer (reggie@kde.org) 00005 (C) 1997 Stephan Kulow (coolo@kde.org) 00006 (C) 1997-2000 Sven Radej (radej@kde.org) 00007 (C) 1997-2000 Matthias Ettrich (ettrich@kde.org) 00008 (C) 1999 Chris Schlaeger (cs@kde.org) 00009 (C) 2002 Joseph Wenninger (jowenn@kde.org) 00010 (C) 2005-2006 Hamish Rodda (rodda@kde.org) 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Library General Public 00014 License version 2 as published by the Free Software Foundation. 00015 00016 This library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Library General Public License for more details. 00020 00021 You should have received a copy of the GNU Library General Public License 00022 along with this library; see the file COPYING.LIB. If not, write to 00023 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00024 Boston, MA 02110-1301, USA. 00025 00026 00027 */ 00028 00029 #ifndef KXMLGUIWINDOW_H 00030 #define KXMLGUIWINDOW_H 00031 00032 #include "kxmlguiclient.h" 00033 #include "kxmlguibuilder.h" 00034 #include <kmainwindow.h> 00035 #include <QtCore/QMetaClassInfo> 00036 00037 class KMenu; 00038 class KXMLGUIFactory; 00039 class KConfig; 00040 class KConfigGroup; 00041 class KToolBar; 00042 class KXmlGuiWindowPrivate; 00043 00044 #define KDE_DEFAULT_WINDOWFLAGS 0 00045 00061 class KDEUI_EXPORT KXmlGuiWindow : public KMainWindow, public KXMLGUIBuilder, virtual public KXMLGUIClient 00062 { 00063 KDEUI_DECLARE_PRIVATE(KXmlGuiWindow) 00064 Q_OBJECT 00065 Q_PROPERTY( bool hasMenuBar READ hasMenuBar ) 00066 Q_PROPERTY( bool autoSaveSettings READ autoSaveSettings ) 00067 Q_PROPERTY( QString autoSaveGroup READ autoSaveGroup ) 00068 Q_PROPERTY( bool standardToolBarMenuEnabled READ isStandardToolBarMenuEnabled WRITE setStandardToolBarMenuEnabled ) 00069 Q_FLAGS( StandardWindowOption ) 00070 Q_PROPERTY( bool initialGeometrySet READ initialGeometrySet ) 00071 00072 public: 00107 explicit KXmlGuiWindow( QWidget* parent = 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS ); 00108 00115 virtual ~KXmlGuiWindow(); 00116 00123 void setHelpMenuEnabled(bool showHelpMenu = true); 00124 00128 bool isHelpMenuEnabled() const; 00129 00130 virtual KXMLGUIFactory *guiFactory(); 00131 00143 void createGUI( const QString &xmlfile = QString() ); 00144 00145 00162 void setStandardToolBarMenuEnabled( bool enable ); 00163 bool isStandardToolBarMenuEnabled() const; 00164 00165 00185 void createStandardStatusBarAction(); 00186 00190 enum StandardWindowOption 00191 { 00197 ToolBar = 1, 00198 00202 Keys = 2, 00203 00208 StatusBar = 4, 00209 00220 Save = 8, 00221 00232 Create = 16, 00233 00238 Default = ToolBar | Keys | StatusBar | Save | Create 00239 }; 00240 Q_DECLARE_FLAGS(StandardWindowOptions, StandardWindowOption) 00241 00242 00258 void setupGUI( StandardWindowOptions options = Default, const QString& xmlfile = QString() ); 00259 00277 void setupGUI( const QSize& defaultSize, StandardWindowOptions options = Default, const QString& xmlfile = QString() ); 00278 00282 QAction *toolBarMenuAction(); 00283 00287 void setupToolbarMenuActions(); 00288 00289 // KDE5 TODO: change it to "using KXMLGUIBuilder::finalizeGUI;" 00290 virtual void finalizeGUI( KXMLGUIClient *client ); 00291 00295 void finalizeGUI( bool force ); 00296 00297 // reimplemented for internal reasons 00298 virtual void applyMainWindowSettings(const KConfigGroup &config, bool force = false); 00299 00300 public Q_SLOTS: 00311 virtual void configureToolbars(); 00312 00318 virtual void slotStateChanged(const QString &newstate); 00319 00327 void slotStateChanged(const QString &newstate, 00328 bool reverse); 00329 00330 protected: 00336 virtual bool event( QEvent * event ); 00337 00338 protected Q_SLOTS: 00343 virtual void saveNewToolbarConfig(); 00344 00345 private: 00346 Q_PRIVATE_SLOT(k_func(), void _k_slotFactoryMakingChanges(bool)) 00347 }; 00348 00349 Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions) 00350 00351 #endif
KDE 4.6 API Reference