-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.hh
76 lines (65 loc) · 1.77 KB
/
window.hh
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
#pragma once
#include <QAction>
#include <QFileSystemWatcher>
#include <QList>
#include <QMainWindow>
#include "buffer.hh"
#include "buffer-model.hh"
#include "frame.hh"
class Window : public QMainWindow
{
Q_OBJECT
public:
Window();
virtual ~Window() = default;
public slots:
void set_font_point_size(int);
private slots:
void horizontal_split_frame();
void vertical_split_frame();
void remove_this_frame();
void remove_other_frames();
void move_to_next_frame();
void move_to_previous_frame();
void new_buffer();
void open_buffer();
bool save_buffer();
bool save_buffer_as();
bool save_all_buffers();
void switch_buffer();
void close_buffer();
void externally_modified_buffer(QString const&);
void undo();
void redo();
void copy();
void cut();
void paste();
void zoom_in();
void zoom_out();
void reset_zoom();
signals:
void font_point_size_changed(int);
protected:
virtual void closeEvent(QCloseEvent*) override;
virtual void wheelEvent(QWheelEvent*) override;
private:
QString create_untitled_name() const;
void update_window_title();
void enable_frame_actions(bool enabled = true);
void connect_buffer(Buffer*);
Frame* create_frame();
void replace_buffers_in_frames(Buffer*, Buffer*);
QString unwatched_buffer_write(Buffer*);
void set_active_frame(Frame*);
void set_active_buffer(Buffer*);
Buffer* m_active_buffer;
Frame* m_active_frame;
BufferModel* m_buffer_model;
QList<Frame*> m_frames;
QFileSystemWatcher* m_watcher;
int m_font_point_size { 12 };
QAction* m_remove_other_frames_action;
QAction* m_remove_this_frame_action;
QAction* m_move_to_next_frame_action;
QAction* m_move_to_previous_frame_action;
};