GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
TextEdit.h
1
29#ifndef __TEXTEDIT_H__
30#define __TEXTEDIT_H__
31
32#include "ui/dialog/QuitDialog.h"
33#include "ui/widgets/FilePage.h"
34#include "ui/widgets/HelpPage.h"
35#include "ui/widgets/PlainTextEditorPage.h"
36
37namespace GpgFrontend::UI {
41class TextEdit : public QWidget {
42 Q_OBJECT
43 public:
47 TextEdit(QWidget* parent);
48
55 void LoadFile(const QString& fileName);
56
64 bool MaybeSaveAnyTab();
65
71 [[nodiscard]] int TabCount() const;
72
78 [[nodiscard]] PlainTextEditorPage* CurTextPage() const;
79
85 [[nodiscard]] FilePage* CurFilePage() const;
86
91 [[nodiscard]] QHash<int, QString> UnsavedDocuments() const;
92
93 QTabWidget* tab_widget_;
95 public slots:
96
102
108
112 void SlotQuote() const;
113
118 void SlotFillTextEditWithText(const QString& text) const;
119
124 void SlotSave();
125
132 bool SlotSaveAs();
133
139 void SlotOpen();
140
144 void SlotPrint();
145
151 void SlotNewTab();
152
156 void SlotOpenFile(QString& path);
157
164 void slotNewHelpTab(const QString& title, const QString& path) const;
165
169 void SlotNewFileTab() const;
170
175 void SlotShowModified() const;
176
181 void SlotCloseTab();
182
187 void SlotSwitchTabUp() const;
188
193 void SlotSwitchTabDown() const;
194
195 private:
202 static QString stripped_name(const QString& full_file_name);
203
209 bool maybe_save_current_tab(bool askToSave);
210
212
213 private slots:
214
215 void slot_file_page_path_changed(const QString& path) const;
216
222 void slot_remove_tab(int index);
223
224 public slots:
225
229 void SlotCut() const;
230
234 void SlotCopy() const;
235
239 void SlotPaste() const;
240
245 void SlotUndo() const;
246
251 void SlotRedo() const;
252
257 void SlotZoomIn() const;
258
263 void SlotZoomOut() const;
264
269 void SlotSelectAll() const;
270
271 protected:
277 bool save_file(const QString& fileName);
278};
279
280} // namespace GpgFrontend::UI
281
282#endif // __TEXTEDIT_H__
Definition: FilePage.h:45
Class for handling a single tab of the tabwidget.
Definition: PlainTextEditorPage.h:43
TextEdit class.
Definition: TextEdit.h:41
bool SlotSaveAs()
Definition: TextEdit.cpp:199
int TabCount() const
Definition: TextEdit.cpp:372
void slot_remove_tab(int index)
Definition: TextEdit.cpp:223
void SlotOpen()
Definition: TextEdit.cpp:110
void SlotCopy() const
Definition: TextEdit.cpp:519
void slotNewHelpTab(const QString &title, const QString &path) const
Definition: TextEdit.cpp:66
bool MaybeSaveAnyTab()
Definition: TextEdit.cpp:304
PlainTextEditorPage * SlotCurPageTextEdit() const
Definition: TextEdit.cpp:374
void SlotUndo() const
Definition: TextEdit.cpp:537
void SlotSwitchTabDown() const
Definition: TextEdit.cpp:481
void SlotNewTab()
Definition: TextEdit.cpp:54
bool save_file(const QString &fileName)
Saves the content of currentTab to the file filename.
Definition: TextEdit.cpp:164
void SlotQuote() const
Definition: TextEdit.cpp:385
void SlotSelectAll() const
select all in current text page
Definition: TextEdit.cpp:573
void SlotOpenFile(QString &path)
Definition: TextEdit.cpp:82
FilePage * SlotCurPageFileTreeView() const
Definition: TextEdit.cpp:380
void LoadFile(const QString &fileName)
Definition: TextEdit.cpp:415
int count_page_
int containing the number of added tabs
Definition: TextEdit.h:211
void SlotShowModified() const
Definition: TextEdit.cpp:462
PlainTextEditorPage * CurTextPage() const
Definition: TextEdit.cpp:359
QHash< int, QString > UnsavedDocuments() const
Definition: TextEdit.cpp:492
bool maybe_save_current_tab(bool askToSave)
Definition: TextEdit.cpp:256
void SlotCloseTab()
Definition: TextEdit.cpp:216
void SlotPaste() const
Definition: TextEdit.cpp:529
FilePage * CurFilePage() const
Definition: TextEdit.cpp:363
void SlotSave()
Definition: TextEdit.cpp:148
void SlotPrint()
Definition: TextEdit.cpp:440
void SlotCut() const
Definition: TextEdit.cpp:511
void SlotNewFileTab() const
Definition: TextEdit.cpp:72
void SlotRedo() const
redo last change in current text page
Definition: TextEdit.cpp:545
void SlotSwitchTabUp() const
Definition: TextEdit.cpp:474
void SlotFillTextEditWithText(const QString &text) const
Definition: TextEdit.cpp:407
static QString stripped_name(const QString &full_file_name)
Definition: TextEdit.cpp:436
Definition: VerifyDetailsDialog.cpp:33