-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_win.h
83 lines (69 loc) · 2.48 KB
/
main_win.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* ----------------------------------------------------------------------------
* Copyright (C) 2007-2010,2020 Th. Zoerner
* ----------------------------------------------------------------------------
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ----------------------------------------------------------------------------
*/
#ifndef _MAIN_WIN_H
#define _MAIN_WIN_H
#include <QMainWindow>
class QApplication;
class QTimer;
class MainText;
class MainSearch;
class StatusLine;
class Highlighter;
class Bookmarks;
class LoadPipe;
// ----------------------------------------------------------------------------
class MainWin : public QMainWindow
{
Q_OBJECT
public:
MainWin(QApplication * app);
~MainWin();
QWidget * focusWidget() const;
const QString& getFilename() const { return m_curFileName; }
StatusLine * mainStatusLine() const { return m_stline; }
void startLoading(const char * fileName);
signals:
void documentNameChanged();
private:
void closeEvent(QCloseEvent *event);
void discardContent();
void populateMenus();
void menuCmdReload(bool checked);
void menuCmdFileOpen(bool checked);
void menuCmdFileQuit(bool checked);
void menuCmdDiscard(bool is_fwd);
void menuCmdSelectFont(bool checked);
void menuCmdToggleLineWrap(bool checked);
void menuCmdGotoLine(bool checked);
void menuCmdBookmarkDeleteAll(bool checked);
void menuCmdAbout(bool checked);
void loadFromFile(const QString& fileName);
void loadFromPipe();
void loadPipeDone();
private:
QApplication* const m_mainApp;
MainText * m_mainText = nullptr;
StatusLine * m_stline = nullptr;
MainSearch * m_search = nullptr;
Highlighter * m_higl = nullptr;
Bookmarks * m_bookmarks = nullptr;
LoadPipe * m_loadPipe = nullptr;
QAction * m_actFileReload = nullptr;
QString m_curFileName;
};
#endif // _MAIN_WIN_H