fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kparts / mainwindow.h
blob35772c846cd5e360c06982cb2c02fdc3232587fc
1 /* This file is part of the KDE project
2 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
3 (C) 1999 David Faure <faure@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
20 #ifndef __MAINWINDOW_H
21 #define __MAINWINDOW_H
23 #include <kaction.h>
25 #include <kxmlguiwindow.h>
27 #include <kparts/part.h>
29 class QString;
31 namespace KParts
34 class MainWindowPrivate;
36 /**
37 * A KPart-aware main window, whose user interface is described in XML.
39 * Inherit your main window from this class
40 * and don't forget to call setXMLFile() in the inherited constructor.
42 * It implements all internal interfaces in the case of a
43 * KMainWindow as host: the builder and servant interface (for menu
44 * merging).
46 class KPARTS_EXPORT MainWindow : public KXmlGuiWindow, virtual public PartBase
48 Q_OBJECT
49 public:
50 /**
51 * Constructor, same signature as KMainWindow.
53 explicit MainWindow( QWidget* parent = 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS );
54 /// @deprecated, remove the name argument and use setObjectName instead
55 KDE_CONSTRUCTOR_DEPRECATED explicit MainWindow( QWidget* parent, const char *name = 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS );
56 /**
57 * Destructor.
59 virtual ~MainWindow();
61 public Q_SLOTS:
62 virtual void configureToolbars();
64 protected Q_SLOTS:
66 /**
67 * Create the GUI (by merging the host's and the active part's)
68 * You _must_ call this in order to see any GUI being created.
70 * In a main window with multiple parts being shown (e.g. as in Konqueror)
71 * you need to connect this slot to the
72 * KPartManager::activePartChanged() signal
74 * @param part The active part (set to 0L if no part).
76 void createGUI( KParts::Part * part );
78 /**
79 * Called when the active part wants to change the statusbar message
80 * Reimplement if your mainwindow has a complex statusbar
81 * (with several items)
83 virtual void slotSetStatusBarText( const QString & );
85 /**
86 * Rebuilds the GUI after KEditToolbar changed the toolbar layout.
87 * @see configureToolbars()
88 * KDE4: make this virtual. (For now we rely on the fact that it's called
89 * as a slot, so the metaobject finds it here).
91 void saveNewToolbarConfig();
93 protected:
94 virtual void createShellGUI( bool create = true );
96 private:
97 MainWindowPrivate* const d;
102 #endif