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
00252 void setupGUI( StandardWindowOptions options = Default, const QString& xmlfile = QString() );
00253
00265 void setupGUI( const QSize& defaultSize, StandardWindowOptions options = Default, const QString& xmlfile = QString() );
00266
00270 QAction *toolBarMenuAction();
00271
00275 void setupToolbarMenuActions();
00276
00277
00278 virtual void finalizeGUI( KXMLGUIClient *client );
00279
00283 void finalizeGUI( bool force );
00284
00285
00286 virtual void applyMainWindowSettings(const KConfigGroup &config, bool force = false);
00287
00288 public Q_SLOTS:
00299 virtual void configureToolbars();
00300
00306 virtual void slotStateChanged(const QString &newstate);
00307
00315 void slotStateChanged(const QString &newstate,
00316 bool reverse);
00317
00318 protected:
00324 virtual bool event( QEvent * event );
00325
00326
00327 protected Q_SLOTS:
00332 virtual void saveNewToolbarConfig();
00333 };
00334
00335 Q_DECLARE_OPERATORS_FOR_FLAGS(KXmlGuiWindow::StandardWindowOptions)
00336
00337 #endif