KDEUI
kxmlguiwindow.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
00290 virtual void finalizeGUI( KXMLGUIClient *client );
00291
00295 void finalizeGUI( bool force );
00296
00297
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