-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy patheditors.h
103 lines (86 loc) · 2.96 KB
/
editors.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef Header_Editors
#define Header_Editors
#include "mostQtHeaders.h"
class TxsTabWidget;
class LatexEditorView;
class EditorChangeProxy;
class Editors : public QWidget
{
Q_OBJECT
public:
explicit Editors(QWidget *parent = nullptr);
void addTabWidget(TxsTabWidget *w);
void addEditor(LatexEditorView *edView, bool asCurrent = true);
void insertEditor(LatexEditorView *edView, int index, bool asCurrent = true);
enum Position {AbsoluteFront, AbsoluteEnd, GroupFront, GroupEnd};
void moveEditor(LatexEditorView *edView, Position pos);
public slots:
void requestCloseEditor(LatexEditorView *edView);
void removeEditor(LatexEditorView *edView);
protected:
void insertEditor(LatexEditorView *edView, TxsTabWidget *tabWidget=nullptr /*current*/, int pos=-1 /*append*/, bool asCurrent = true);
void removeEditor(LatexEditorView *edView, TxsTabWidget *tabWidget);
public:
bool containsEditor(LatexEditorView *edView) const;
TxsTabWidget * currentTabWidget() const;
LatexEditorView * currentEditor() const;
void setCurrentEditor(LatexEditorView *edView, bool setFocus = true);
QList<LatexEditorView *> editors();
int tabGroupIndexFromEditor(LatexEditorView *edView) const;
void moveToTabGroup(LatexEditorView *edView, int groupIndex, int targetIndex);
void moveAllToGroupZeroifEmpty();
bool getSplitVertical();
signals:
void currentEditorChanged();
void editorAboutToChangeByTabClick(LatexEditorView *from, LatexEditorView *to);
void closeCurrentEditorRequested();
void listOfEditorsChanged();
void editorsReordered();
public slots:
void setCurrentEditorFromAction();
void setCurrentEditorFromSender();
void closeEditorFromAction();
void closeOtherEditorsFromAction();
void toggleReadOnlyFromAction();
bool activateNextEditor();
bool activatePreviousEditor();
void changeSplitOrientation();
protected slots:
void setCurrentGroup(int index);
bool activateTabWidgetFromSender();
void tabBarContextMenu(const QPoint &point);
void onEditorChangeByTabClick(LatexEditorView *from, LatexEditorView *to);
void moveToOtherTabGroup();
void moveAllToOtherTabGroup();
void moveAllOthersToOtherTabGroup();
void moveToTabGroup(LatexEditorView *edView, TxsTabWidget *target, int targetIndex);
void showInGraphicalShell_();
void copyFilePath();
protected:
TxsTabWidget *tabWidgetFromEditor(LatexEditorView *edView) const;
private:
QSplitter *splitter;
QList<TxsTabWidget *> tabGroups;
int currentGroupIndex;
EditorChangeProxy *changes;
};
class EditorChangeProxy : public QObject
{
Q_OBJECT
public:
EditorChangeProxy(Editors *e);
bool block();
void release();
signals:
void currentEditorChanged();
void listOfEditorsChanged();
public slots:
void currentEditorChange();
void listOfEditorsChange();
private:
Editors *editors;
LatexEditorView *currentEditorAtBlock;
QList<LatexEditorView *> listOfEditorsAtBlock;
bool blocked;
};
#endif // EDITORS_H