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(QString& path);
void slotNewHelpTab(const QString& title, const QString& path) const;
void SlotNewFileTab() const;
void SlotShowModified() const;
void SlotCloseTab();
void SlotSwitchTabUp() const;
void SlotSwitchTabDown() const;
private:
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);
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::PlainTextEditorPage::SetFilePath
void SetFilePath(const QString &filePath)
Definition: PlainTextEditorPage.cpp:103
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::TextEdit::SlotCopy
void SlotCopy() const
Definition: TextEdit.cpp:537
GpgFrontend::UI::PlainTextEditorPage::GetFilePath
const QString & GetFilePath() const
Definition: PlainTextEditorPage.cpp:77
GpgFrontend::UI::TextEdit::CurFilePage
FilePage * CurFilePage() const
Definition: TextEdit.cpp:381
GpgFrontend::UI::TextEdit::slotNewHelpTab
void slotNewHelpTab(const QString &title, const QString &path) const
Definition: TextEdit.cpp:66
GpgFrontend::UI::FilePage::SignalPathChanged
void SignalPathChanged(const QString &path)
GpgFrontend::UI::TextEdit::LoadFile
void LoadFile(const QString &fileName)
Definition: TextEdit.cpp:433
GpgFrontend::UI::TextEdit::MaybeSaveAnyTab
bool MaybeSaveAnyTab()
Definition: TextEdit.cpp:322
GpgFrontend::UI::TextEdit::SlotOpenFile
void SlotOpenFile(QString &path)
Definition: TextEdit.cpp:82
GpgFrontend::UI::TextEdit::SlotOpen
void SlotOpen()
Definition: TextEdit.cpp:110
GpgFrontend::UI::TextEdit::count_page_
int count_page_
int containing the number of added tabs
Definition: TextEdit.h:211
GpgFrontend::UI::TextEdit::SlotCut
void SlotCut() const
Definition: TextEdit.cpp:529
GpgFrontend::UI::TextEdit::SlotCurPageTextEdit
PlainTextEditorPage * SlotCurPageTextEdit() const
Definition: TextEdit.cpp:392
GpgFrontend::UI::TextEdit::SlotRedo
void SlotRedo() const
redo last change in current text page
Definition: TextEdit.cpp:563
GpgFrontend::UI::TextEdit::SlotCurPageFileTreeView
FilePage * SlotCurPageFileTreeView() const
Definition: TextEdit.cpp:398
GpgFrontend::UI::TextEdit
TextEdit class.
Definition: TextEdit.h:41
GpgFrontend::UI::PlainTextEditorPage
Class for handling a single tab of the tabwidget.
Definition: PlainTextEditorPage.h:45
GpgFrontend::UI::TextEdit::SlotNewFileTab
void SlotNewFileTab() const
Definition: TextEdit.cpp:72
GpgFrontend::UI::TextEdit::SlotSelectAll
void SlotSelectAll() const
select all in current text page
Definition: TextEdit.cpp:591
GpgFrontend::UI::QuitDialog::IsDiscarded
bool IsDiscarded() const
Definition: QuitDialog.cpp:133
GpgFrontend::UI::TextEdit::SlotFillTextEditWithText
void SlotFillTextEditWithText(const QString &text) const
Definition: TextEdit.cpp:425
GpgFrontend::UI::TextEdit::SlotQuote
void SlotQuote() const
Definition: TextEdit.cpp:403
GpgFrontend::UI::TextEdit::SlotPaste
void SlotPaste() const
Definition: TextEdit.cpp:547
GpgFrontend::UI::HelpPage
Definition: HelpPage.h:40
GpgFrontend::UI::TextEdit::UnsavedDocuments
QHash< int, QString > UnsavedDocuments() const
Definition: TextEdit.cpp:510
GpgFrontend::UI::TextEdit::SlotSaveAs
bool SlotSaveAs()
Definition: TextEdit.cpp:219
GpgFrontend::UI::TextEdit::SlotShowModified
void SlotShowModified() const
Definition: TextEdit.cpp:480
GpgFrontend::UI::TextEdit::SlotSwitchTabUp
void SlotSwitchTabUp() const
Definition: TextEdit.cpp:492
GpgFrontend::UI::TextEdit::SlotPrint
void SlotPrint()
Definition: TextEdit.cpp:458
GpgFrontend::UI::TextEdit::slot_remove_tab
void slot_remove_tab(int index)
Definition: TextEdit.cpp:243
GpgFrontend::UI::TextEdit::SlotUndo
void SlotUndo() const
Definition: TextEdit.cpp:555
GpgFrontend::UI::FilePage
Definition: FilePage.h:43
GpgFrontend::UI::PlainTextEditorPage::GetTextPage
QPlainTextEdit * GetTextPage()
Definition: PlainTextEditorPage.cpp:81
GpgFrontend::UI::TextEdit::SlotSave
void SlotSave()
Definition: TextEdit.cpp:148
GpgFrontend::UI::PlainTextEditorPage::WillCharsetChange
bool WillCharsetChange() const
detect if the charset of the file will change
Definition: PlainTextEditorPage.cpp:83
GpgFrontend::UI::TextEdit::stripped_name
static QString stripped_name(const QString &full_file_name)
Definition: TextEdit.cpp:454
GpgFrontend::UI::TextEdit::save_file
bool save_file(const QString &fileName)
Saves the content of currentTab to the file filename.
Definition: TextEdit.cpp:164
GpgFrontend::UI::TextEdit::TabCount
int TabCount() const
Definition: TextEdit.cpp:390
GpgFrontend::UI::TextEdit::SlotCloseTab
void SlotCloseTab()
Definition: TextEdit.cpp:236
GpgFrontend::UI::PlainTextEditorPage::ReadDone
bool ReadDone() const
Definition: PlainTextEditorPage.h:101
GpgFrontend::UI::TextEdit::SlotNewTab
void SlotNewTab()
Definition: TextEdit.cpp:54
GpgFrontend::UI::TextEdit::maybe_save_current_tab
bool maybe_save_current_tab(bool askToSave)
Definition: TextEdit.cpp:276
GpgFrontend::UI::QuitDialog
Definition: QuitDialog.h:41
GpgFrontend::UI::QuitDialog::GetTabIdsToSave
QList< int > GetTabIdsToSave()
Get the Tab Ids To Save object.
Definition: QuitDialog.cpp:135
GpgFrontend::UI::TextEdit::SlotSwitchTabDown
void SlotSwitchTabDown() const
Definition: TextEdit.cpp:499
GpgFrontend::UI::PlainTextEditorPage::NotifyFileSaved
void NotifyFileSaved()
notify the user that the file has been saved.
Definition: PlainTextEditorPage.cpp:94
GpgFrontend::UI::TextEdit::CurTextPage
PlainTextEditorPage * CurTextPage() const
Definition: TextEdit.cpp:377