# GpgFrontend Project: src/ui/widgets/TextEdit.h Source File

TextEdit.h
#ifndef __TEXTEDIT_H__
#define __TEXTEDIT_H__
#include "ui/dialog/QuitDialog.h"
#include "ui/widgets/FilePage.h"
#include "ui/widgets/HelpPage.h"
#include "ui/widgets/PlainTextEditorPage.h"
namespace GpgFrontend::UI {
class TextEdit : public QWidget {
Q_OBJECT
public:
TextEdit(QWidget* parent);
void LoadFile(const QString& fileName);
bool MaybeSaveAnyTab();
[[nodiscard]] int TabCount() const;
[[nodiscard]] PlainTextEditorPage* CurTextPage() const;
[[nodiscard]] FilePage* CurFilePage() const;
[[nodiscard]] QHash<int, QString> UnsavedDocuments() const;
QTabWidget* tab_widget_;
public slots:
PlainTextEditorPage* SlotCurPageTextEdit() const;
FilePage* SlotCurPageFileTreeView() const;
void SlotQuote() const;
void SlotFillTextEditWithText(const QString& text) const;
void SlotSave();
bool SlotSaveAs();
void SlotOpen();
void SlotPrint();
void SlotNewTab();
void SlotOpenFile(const QString& path);
void slotNewHelpTab(const QString& title, const QString& path) const;
void SlotNewFileTab() const;
void SlotShowModified(bool) const;
void SlotCloseTab();
void SlotSwitchTabUp() const;
void SlotSwitchTabDown() const;
private:
uint text_page_data_modified_count_ = 0;
static QString stripped_name(const QString& full_file_name);
bool maybe_save_current_tab(bool askToSave);
int count_page_;
private slots:
void slot_file_page_path_changed(const QString& path) const;
void slot_remove_tab(int index);
void slot_save_status_to_cache_for_revovery();
public slots:
void SlotCut() const;
void SlotCopy() const;
void SlotPaste() const;
void SlotUndo() const;
void SlotRedo() const;
void SlotZoomIn() const;
void SlotZoomOut() const;
void SlotSelectAll() const;
protected:
bool save_file(const QString& fileName);
};
} // namespace GpgFrontend::UI
#endif // __TEXTEDIT_H__
GpgFrontend::UI::FilePage
Definition: FilePage.h:43
GpgFrontend::UI::PlainTextEditorPage
Class for handling a single tab of the tabwidget.
Definition: PlainTextEditorPage.h:45
GpgFrontend::UI::TextEdit
TextEdit class.
Definition: TextEdit.h:41
GpgFrontend::UI::TextEdit::SlotSaveAs
bool SlotSaveAs()
Definition: TextEdit.cpp:201
GpgFrontend::UI::TextEdit::TabCount
int TabCount() const
Definition: TextEdit.cpp:372
GpgFrontend::UI::TextEdit::slot_remove_tab
void slot_remove_tab(int index)
Definition: TextEdit.cpp:225
GpgFrontend::UI::TextEdit::SlotOpen
void SlotOpen()
Definition: TextEdit.cpp:120
GpgFrontend::UI::TextEdit::slot_save_status_to_cache_for_revovery
void slot_save_status_to_cache_for_revovery()
Definition: TextEdit.cpp:601
GpgFrontend::UI::TextEdit::SlotCopy
void SlotCopy() const
Definition: TextEdit.cpp:527
GpgFrontend::UI::TextEdit::slotNewHelpTab
void slotNewHelpTab(const QString &title, const QString &path) const
Definition: TextEdit.cpp:73
GpgFrontend::UI::TextEdit::MaybeSaveAnyTab
bool MaybeSaveAnyTab()
Definition: TextEdit.cpp:304
GpgFrontend::UI::TextEdit::SlotCurPageTextEdit
PlainTextEditorPage * SlotCurPageTextEdit() const
Definition: TextEdit.cpp:374
GpgFrontend::UI::TextEdit::SlotUndo
void SlotUndo() const
Definition: TextEdit.cpp:545
GpgFrontend::UI::TextEdit::SlotSwitchTabDown
void SlotSwitchTabDown() const
Definition: TextEdit.cpp:489
GpgFrontend::UI::TextEdit::SlotNewTab
void SlotNewTab()
Definition: TextEdit.cpp:59
GpgFrontend::UI::TextEdit::SlotOpenFile
void SlotOpenFile(const QString &path)
Definition: TextEdit.cpp:89
GpgFrontend::UI::TextEdit::save_file
bool save_file(const QString &fileName)
Saves the content of currentTab to the file filename.
Definition: TextEdit.cpp:146
GpgFrontend::UI::TextEdit::SlotQuote
void SlotQuote() const
Definition: TextEdit.cpp:385
GpgFrontend::UI::TextEdit::SlotSelectAll
void SlotSelectAll() const
select all in current text page
Definition: TextEdit.cpp:581
GpgFrontend::UI::TextEdit::SlotCurPageFileTreeView
FilePage * SlotCurPageFileTreeView() const
Definition: TextEdit.cpp:380
GpgFrontend::UI::TextEdit::LoadFile
void LoadFile(const QString &fileName)
Definition: TextEdit.cpp:415
GpgFrontend::UI::TextEdit::count_page_
int count_page_
int containing the number of added tabs
Definition: TextEdit.h:213
GpgFrontend::UI::TextEdit::CurTextPage
PlainTextEditorPage * CurTextPage() const
Definition: TextEdit.cpp:359
GpgFrontend::UI::TextEdit::UnsavedDocuments
QHash< int, QString > UnsavedDocuments() const
Definition: TextEdit.cpp:500
GpgFrontend::UI::TextEdit::maybe_save_current_tab
bool maybe_save_current_tab(bool askToSave)
Definition: TextEdit.cpp:258
GpgFrontend::UI::TextEdit::SlotCloseTab
void SlotCloseTab()
Definition: TextEdit.cpp:218
GpgFrontend::UI::TextEdit::SlotPaste
void SlotPaste() const
Definition: TextEdit.cpp:537
GpgFrontend::UI::TextEdit::CurFilePage
FilePage * CurFilePage() const
Definition: TextEdit.cpp:363
GpgFrontend::UI::TextEdit::SlotShowModified
void SlotShowModified(bool) const
Definition: TextEdit.cpp:462
GpgFrontend::UI::TextEdit::SlotSave
void SlotSave()
Definition: TextEdit.cpp:130
GpgFrontend::UI::TextEdit::SlotPrint
void SlotPrint()
Definition: TextEdit.cpp:440
GpgFrontend::UI::TextEdit::SlotCut
void SlotCut() const
Definition: TextEdit.cpp:519
GpgFrontend::UI::TextEdit::SlotNewFileTab
void SlotNewFileTab() const
Definition: TextEdit.cpp:79
GpgFrontend::UI::TextEdit::SlotRedo
void SlotRedo() const
redo last change in current text page
Definition: TextEdit.cpp:553
GpgFrontend::UI::TextEdit::SlotSwitchTabUp
void SlotSwitchTabUp() const
Definition: TextEdit.cpp:482
GpgFrontend::UI::TextEdit::SlotFillTextEditWithText
void SlotFillTextEditWithText(const QString &text) const
Definition: TextEdit.cpp:407
GpgFrontend::UI::TextEdit::stripped_name
static QString stripped_name(const QString &full_file_name)
Definition: TextEdit.cpp:436
GpgFrontend::UI
Definition: FileReadTask.cpp:29