Mercurial > octave-nkf
comparison gui/octave-gui/src/MainWindow.h @ 14240:a9992bc3c3f7 gui
GUI: Added qtermwidget snapshot as a subproject to build as a library that links with Octave GUI.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sat, 21 Jan 2012 11:26:36 +0100 |
parents | gui/src/MainWindow.h@d80086a9880e |
children | 7ede35410aa5 |
comparison
equal
deleted
inserted
replaced
14239:7ecaa8a66d5a | 14240:a9992bc3c3f7 |
---|---|
1 /* OctaveGUI - A graphical user interface for Octave | |
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com) | |
3 * | |
4 * This program is free software: you can redistribute it and/or modify | |
5 * it under the terms of the GNU Affero General Public License as | |
6 * published by the Free Software Foundation, either version 3 of the | |
7 * License, or (at your option) any later version. | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU Affero General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU Affero General Public License | |
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 */ | |
17 | |
18 #ifndef MAINWINDOW_H | |
19 #define MAINWINDOW_H | |
20 | |
21 #include <QtGui/QMainWindow> | |
22 #include <QThread> | |
23 #include <QTabWidget> | |
24 #include <QMdiArea> | |
25 #include <QStatusBar> | |
26 #include <QToolBar> | |
27 #include <QQueue> | |
28 #include <Qsci/qsciapis.h> | |
29 #include <QMdiSubWindow> | |
30 #include "ResourceManager.h" | |
31 #include "AbstractTerminalView.h" | |
32 #include "OctaveLink.h" | |
33 #include "WorkspaceView.h" | |
34 #include "HistoryDockWidget.h" | |
35 #include "FilesDockWidget.h" | |
36 #include "BrowserWidget.h" | |
37 #include "irc/IRCWidget.h" | |
38 #include "lexer/lexeroctavegui.h" | |
39 | |
40 class NonClosableMdiSubWindow : public QMdiSubWindow | |
41 { | |
42 Q_OBJECT | |
43 public: | |
44 explicit NonClosableMdiSubWindow (QWidget *parent = 0) | |
45 : QMdiSubWindow (parent) { } | |
46 virtual ~NonClosableMdiSubWindow () { } | |
47 protected: | |
48 void closeEvent (QCloseEvent *closeEvent) | |
49 { | |
50 closeEvent->ignore (); | |
51 } | |
52 }; | |
53 | |
54 /** | |
55 * \class MainWindow | |
56 * | |
57 * Represents the main window. | |
58 */ | |
59 class MainWindow:public QMainWindow | |
60 { | |
61 Q_OBJECT public: | |
62 MainWindow (QWidget * parent = 0); | |
63 ~MainWindow (); | |
64 | |
65 AbstractTerminalView *terminalView () | |
66 { | |
67 return m_terminalView; | |
68 } | |
69 | |
70 HistoryDockWidget *historyDockWidget () | |
71 { | |
72 return m_historyDockWidget; | |
73 } | |
74 FilesDockWidget *filesDockWidget () | |
75 { | |
76 return m_filesDockWidget; | |
77 } | |
78 bool isCloseApplication () | |
79 { | |
80 return m_closeApplication; | |
81 } | |
82 | |
83 signals: | |
84 void settingsChanged (); | |
85 | |
86 public slots: | |
87 void handleOpenFileRequest (QString fileName); | |
88 void reportStatusMessage (QString statusMessage); | |
89 void openWebPage (QString url); | |
90 void handleSaveWorkspaceRequest (); | |
91 void handleLoadWorkspaceRequest (); | |
92 void handleClearWorkspaceRequest (); | |
93 void handleCommandDoubleClicked (QString command); | |
94 void handleUnreadMessages (bool yes); | |
95 void alignMdiWindows (); | |
96 void openEditor (); | |
97 void openEditorFile (QString fileName); | |
98 void openBugTrackerPage (); | |
99 void openAgoraPage (); | |
100 void openOctaveForgePage (); | |
101 void processSettingsDialogRequest (); | |
102 void showAboutOctave (); | |
103 void showAboutQt (); | |
104 | |
105 protected: | |
106 void closeEvent (QCloseEvent * closeEvent); | |
107 void readSettings (); | |
108 void writeSettings (); | |
109 | |
110 private: | |
111 void construct (); | |
112 void establishOctaveLink (); | |
113 QMdiArea *m_centralMdiArea; | |
114 | |
115 // Mdi sub windows. | |
116 AbstractTerminalView *m_terminalView; | |
117 BrowserWidget *m_documentationWidget; | |
118 IRCWidget *m_ircWidget; | |
119 | |
120 NonClosableMdiSubWindow *m_terminalViewSubWindow; | |
121 NonClosableMdiSubWindow *m_documentationWidgetSubWindow; | |
122 NonClosableMdiSubWindow *m_ircWidgetSubWindow; | |
123 | |
124 // Dock widgets. | |
125 WorkspaceView *m_workspaceView; | |
126 HistoryDockWidget *m_historyDockWidget; | |
127 FilesDockWidget *m_filesDockWidget; | |
128 | |
129 // Editor's lexer | |
130 LexerOctaveGui *m_lexer; | |
131 QsciAPIs *m_lexerAPI; | |
132 | |
133 // Toolbars. | |
134 QStatusBar *m_statusBar; | |
135 | |
136 // Flag for closing whole application | |
137 bool m_closeApplication; | |
138 | |
139 }; | |
140 | |
141 #endif // MAINWINDOW_H |