| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-06-17 00:01:27 +10:00
										 |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Commercial Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Licensees holding valid Qt Commercial licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the Qt Commercial License Agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and Nokia. | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
					
						
							|  |  |  | ** General Public License version 2.1 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
					
						
							|  |  |  | ** packaging of this file.  Please review the following information to | 
					
						
							|  |  |  | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
					
						
							|  |  |  | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** If you are unsure which license is appropriate for your use, please | 
					
						
							| 
									
										
										
										
											2009-06-17 00:01:27 +10:00
										 |  |  | ** contact the sales department at http://www.qtsoftware.com/contact.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | **************************************************************************/ | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | #ifndef MAINWINDOW_H
 | 
					
						
							|  |  |  | #define MAINWINDOW_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-23 13:03:36 +01:00
										 |  |  | #include "core_global.h"
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <QtGui/QMainWindow>
 | 
					
						
							|  |  |  | #include <QtCore/QMap>
 | 
					
						
							|  |  |  | #include <QtCore/QList>
 | 
					
						
							|  |  |  | #include <QtCore/QSet>
 | 
					
						
							|  |  |  | #include <QtCore/QPointer>
 | 
					
						
							|  |  |  | #include <QtGui/QPrinter>
 | 
					
						
							|  |  |  | #include <QtGui/QToolButton>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QT_BEGIN_NAMESPACE | 
					
						
							|  |  |  | class QSettings; | 
					
						
							|  |  |  | class QShortcut; | 
					
						
							|  |  |  | QT_END_NAMESPACE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Core { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-13 13:39:31 +01:00
										 |  |  | class ActionManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class BaseMode; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class BaseView; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class EditorManager; | 
					
						
							|  |  |  | class FileManager; | 
					
						
							|  |  |  | class IContext; | 
					
						
							| 
									
										
										
										
											2009-01-23 13:03:36 +01:00
										 |  |  | class IWizard; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class MessageManager; | 
					
						
							|  |  |  | class MimeDatabase; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class ModeManager; | 
					
						
							| 
									
										
										
										
											2009-01-13 14:16:36 +01:00
										 |  |  | class ProgressManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class RightPaneWidget; | 
					
						
							| 
									
										
										
										
											2009-01-13 16:43:11 +01:00
										 |  |  | class ScriptManager; | 
					
						
							| 
									
										
										
										
											2009-05-19 19:20:53 +02:00
										 |  |  | class SettingsDatabase; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class UniqueIDManager; | 
					
						
							|  |  |  | class VariableManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class VCSManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class ViewManagerInterface; | 
					
						
							| 
									
										
										
										
											2009-04-01 18:18:26 +02:00
										 |  |  | class IMode; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Internal { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-13 13:07:29 +01:00
										 |  |  | class ActionManagerPrivate; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class CoreImpl; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class FancyTabWidget; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class GeneralSettings; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | class NavigationWidget; | 
					
						
							| 
									
										
										
										
											2009-01-13 13:54:45 +01:00
										 |  |  | class ProgressManagerPrivate; | 
					
						
							| 
									
										
										
										
											2008-12-02 14:09:21 +01:00
										 |  |  | class ShortcutSettings; | 
					
						
							|  |  |  | class ViewManager; | 
					
						
							| 
									
										
										
										
											2008-12-03 17:38:53 +01:00
										 |  |  | class VersionDialog; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-26 14:13:15 +01:00
										 |  |  | class CORE_EXPORT MainWindow : public QMainWindow | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     MainWindow(); | 
					
						
							|  |  |  |     ~MainWindow(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-26 14:25:03 +01:00
										 |  |  |     bool init(QString *errorMessage); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     void extensionsInitialized(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     IContext *contextObject(QWidget *widget); | 
					
						
							|  |  |  |     void addContextObject(IContext *contex); | 
					
						
							|  |  |  |     void removeContextObject(IContext *contex); | 
					
						
							|  |  |  |     void resetContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void openFiles(const QStringList &fileNames); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-13 13:39:31 +01:00
										 |  |  |     Core::ActionManager *actionManager() const; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     Core::FileManager *fileManager() const; | 
					
						
							|  |  |  |     Core::UniqueIDManager *uniqueIDManager() const; | 
					
						
							|  |  |  |     Core::MessageManager *messageManager() const; | 
					
						
							|  |  |  |     Core::EditorManager *editorManager() const; | 
					
						
							| 
									
										
										
										
											2009-01-13 14:16:36 +01:00
										 |  |  |     Core::ProgressManager *progressManager() const; | 
					
						
							| 
									
										
										
										
											2009-01-13 16:43:11 +01:00
										 |  |  |     Core::ScriptManager *scriptManager() const; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     Core::VariableManager *variableManager() const; | 
					
						
							|  |  |  |     Core::ModeManager *modeManager() const; | 
					
						
							|  |  |  |     Core::MimeDatabase *mimeDatabase() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     VCSManager *vcsManager() const; | 
					
						
							|  |  |  |     inline QSettings *settings() const { return m_settings; } | 
					
						
							| 
									
										
										
										
											2009-05-19 19:20:53 +02:00
										 |  |  |     inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     virtual QPrinter *printer() const; | 
					
						
							|  |  |  |     IContext * currentContextObject() const; | 
					
						
							|  |  |  |     QStatusBar *statusBar() const; | 
					
						
							|  |  |  |     void addAdditionalContext(int context); | 
					
						
							|  |  |  |     void removeAdditionalContext(int context); | 
					
						
							|  |  |  |     bool hasContext(int context) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void updateContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void setSuppressNavigationWidget(bool suppress); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | signals: | 
					
						
							|  |  |  |     void windowActivated(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public slots: | 
					
						
							|  |  |  |     void newFile(); | 
					
						
							|  |  |  |     void openFileWith(); | 
					
						
							|  |  |  |     void exit(); | 
					
						
							| 
									
										
										
										
											2009-01-19 14:12:39 +01:00
										 |  |  |     void setFullScreen(bool on); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     QStringList showNewItemDialog(const QString &title, | 
					
						
							|  |  |  |                                   const QList<IWizard *> &wizards, | 
					
						
							|  |  |  |                                   const QString &defaultLocation = QString()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-18 16:43:01 +01:00
										 |  |  |     bool showOptionsDialog(const QString &category = QString(), | 
					
						
							|  |  |  |                            const QString &page = QString(), | 
					
						
							|  |  |  |                            QWidget *parent = 0); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							| 
									
										
										
										
											2009-02-10 10:56:22 +01:00
										 |  |  |     virtual void changeEvent(QEvent *e); | 
					
						
							|  |  |  |     virtual void closeEvent(QCloseEvent *event); | 
					
						
							|  |  |  |     virtual void dragEnterEvent(QDragEnterEvent *event); | 
					
						
							|  |  |  |     virtual void dropEvent(QDropEvent *event); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							|  |  |  |     void openFile(); | 
					
						
							|  |  |  |     void aboutToShowRecentFiles(); | 
					
						
							|  |  |  |     void openRecentFile(); | 
					
						
							|  |  |  |     void setFocusToEditor(); | 
					
						
							|  |  |  |     void saveAll(); | 
					
						
							|  |  |  |     void aboutQtCreator(); | 
					
						
							|  |  |  |     void aboutPlugins(); | 
					
						
							|  |  |  |     void updateFocusWidget(QWidget *old, QWidget *now); | 
					
						
							| 
									
										
										
										
											2009-01-20 15:38:51 +01:00
										 |  |  |     void setSidebarVisible(bool visible); | 
					
						
							| 
									
										
										
										
											2008-12-03 17:38:53 +01:00
										 |  |  |     void destroyVersionDialog(); | 
					
						
							| 
									
										
										
										
											2009-04-01 18:18:26 +02:00
										 |  |  |     void modeChanged(Core::IMode *mode); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     void updateContextObject(IContext *context); | 
					
						
							|  |  |  |     void registerDefaultContainers(); | 
					
						
							|  |  |  |     void registerDefaultActions(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void readSettings(); | 
					
						
							|  |  |  |     void writeSettings(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     CoreImpl *m_coreImpl; | 
					
						
							|  |  |  |     UniqueIDManager *m_uniqueIDManager; | 
					
						
							|  |  |  |     QList<int> m_globalContext; | 
					
						
							|  |  |  |     QList<int> m_additionalContexts; | 
					
						
							|  |  |  |     QSettings *m_settings; | 
					
						
							| 
									
										
										
										
											2009-05-19 19:20:53 +02:00
										 |  |  |     SettingsDatabase *m_settingsDatabase; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     mutable QPrinter *m_printer; | 
					
						
							| 
									
										
										
										
											2009-01-13 13:07:29 +01:00
										 |  |  |     ActionManagerPrivate *m_actionManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     EditorManager *m_editorManager; | 
					
						
							|  |  |  |     FileManager *m_fileManager; | 
					
						
							|  |  |  |     MessageManager *m_messageManager; | 
					
						
							| 
									
										
										
										
											2009-01-13 13:54:45 +01:00
										 |  |  |     ProgressManagerPrivate *m_progressManager; | 
					
						
							| 
									
										
										
										
											2009-01-13 16:43:11 +01:00
										 |  |  |     ScriptManager *m_scriptManager; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     VariableManager *m_variableManager; | 
					
						
							|  |  |  |     VCSManager *m_vcsManager; | 
					
						
							|  |  |  |     ViewManager *m_viewManager; | 
					
						
							|  |  |  |     ModeManager *m_modeManager; | 
					
						
							|  |  |  |     MimeDatabase *m_mimeDatabase; | 
					
						
							|  |  |  |     FancyTabWidget *m_modeStack; | 
					
						
							|  |  |  |     NavigationWidget *m_navigationWidget; | 
					
						
							|  |  |  |     RightPaneWidget *m_rightPaneWidget; | 
					
						
							|  |  |  |     Core::BaseView *m_outputView; | 
					
						
							| 
									
										
										
										
											2008-12-03 17:38:53 +01:00
										 |  |  |     VersionDialog *m_versionDialog; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     IContext * m_activeContext; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QMap<QWidget *, IContext *> m_contextWidgets; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     BaseMode *m_outputMode; | 
					
						
							|  |  |  |     GeneralSettings *m_generalSettings; | 
					
						
							|  |  |  |     ShortcutSettings *m_shortcutSettings; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // actions
 | 
					
						
							|  |  |  |     QShortcut *m_focusToEditor; | 
					
						
							|  |  |  |     QAction *m_newAction; | 
					
						
							|  |  |  |     QAction *m_openAction; | 
					
						
							|  |  |  |     QAction *m_openWithAction; | 
					
						
							|  |  |  |     QAction *m_saveAllAction; | 
					
						
							|  |  |  |     QAction *m_exitAction; | 
					
						
							|  |  |  |     QAction *m_optionsAction; | 
					
						
							|  |  |  |     QAction *m_toggleSideBarAction; | 
					
						
							| 
									
										
										
										
											2009-01-19 14:12:39 +01:00
										 |  |  |     QAction *m_toggleFullScreenAction; | 
					
						
							| 
									
										
										
										
											2009-06-03 20:45:49 +02:00
										 |  |  | #ifdef Q_WS_MAC
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     QAction *m_minimizeAction; | 
					
						
							|  |  |  |     QAction *m_zoomAction; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QToolButton *m_toggleSideBarButton; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace Internal
 | 
					
						
							|  |  |  | } // namespace Core
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // MAINWINDOW_H
 |