GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
PlainTextEditorPage.h
1 
29 #pragma once
30 
31 class Ui_PlainTextEditor;
32 
33 namespace GpgFrontend::UI {
34 
39 class PlainTextEditorPage : public QWidget {
40  Q_OBJECT
41  public:
48  explicit PlainTextEditorPage(QString file_path = {},
49  QWidget* parent = nullptr);
50 
54  [[nodiscard]] const QString& GetFilePath() const;
55 
61  void SetFilePath(const QString& filePath);
62 
66  QPlainTextEdit* GetTextPage();
67 
74  void ShowNotificationWidget(QWidget* widget, const char* className);
75 
81  void CloseNoteByClass(const char* className);
82 
87  void ReadFile();
88 
95  [[nodiscard]] bool ReadDone() const { return this->read_done_; }
96 
101  void NotifyFileSaved();
102 
103  signals:
104 
110 
111  private:
112  std::shared_ptr<Ui_PlainTextEditor> ui_;
113  QString full_file_path_;
114  bool sign_marked_{};
115  bool read_done_ = false;
116  size_t read_bytes_ = 0;
117  bool is_crlf_ = false;
118 
119  private slots:
120 
124  void slot_format_gpg_header();
125 
131  void slot_insert_text(QByteArray bytes_data);
132 };
133 
134 } // namespace GpgFrontend::UI
Class for handling a single tab of the tabwidget.
Definition: PlainTextEditorPage.h:39
void slot_insert_text(QByteArray bytes_data)
Definition: PlainTextEditorPage.cpp:188
void NotifyFileSaved()
notify the user that the file has been saved.
Definition: PlainTextEditorPage.cpp:83
void slot_format_gpg_header()
Definition: PlainTextEditorPage.cpp:109
bool sign_marked_
true, if the signed header is marked, false if not
Definition: PlainTextEditorPage.h:114
QPlainTextEdit * GetTextPage()
Definition: PlainTextEditorPage.cpp:81
PlainTextEditorPage(QString file_path={}, QWidget *parent=nullptr)
Definition: PlainTextEditorPage.cpp:39
void SetFilePath(const QString &filePath)
Definition: PlainTextEditorPage.cpp:90
bool ReadDone() const
Definition: PlainTextEditorPage.h:95
QString full_file_path_
The path to the file handled in the tab.
Definition: PlainTextEditorPage.h:113
void CloseNoteByClass(const char *className)
Definition: PlainTextEditorPage.cpp:100
void ShowNotificationWidget(QWidget *widget, const char *className)
Definition: PlainTextEditorPage.cpp:94
void SignalUIBytesDisplayed()
this signal is emitted when the bytes has been append in texteditor.
const QString & GetFilePath() const
Definition: PlainTextEditorPage.cpp:77
Definition: FileReadTask.cpp:31