forked from mika314/texteditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_window.hpp
37 lines (35 loc) · 950 Bytes
/
main_window.hpp
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
#pragma once
#include "tabs.hpp"
#include "screen.hpp"
#include "status_bar.hpp"
#include "layout.hpp"
#include "widget.hpp"
#include "dialog.hpp"
#include <string>
class OpenDialog;
class SaveDialog;
class TextFile;
class MainWindow: public Widget
{
public:
MainWindow(Widget *parent = nullptr);
protected:
virtual bool keyPressEvent(KeyEvent &);
private:
Screen *activeScreen_;
Layout layout_;
Tabs tabs_;
StatusBar statusBar_;
Layout screenLayout_;
void openFile(OpenDialog *, const std::string &);
void saveAs(SaveDialog *sender, TextFile *textFile, const std::string &fileName);
void saveAndClose(SaveDialog *sender, TextFile *textFile, const std::string &fileName);
void closeActiveTextBuffer(Dialog::Answer);
void save();
void wholeScreen();
void split(Layout::Style);
void switchToPrevScreen();
void switchToNextScreen();
void setTextBuffer(BaseTextBuffer *);
void deleteTextBuffer(BaseTextBuffer *);
};