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

PlainTextEditorPage.h
#ifndef __EDITORPAGE_H__
#define __EDITORPAGE_H__
#include "core/GpgConstants.h"
#include "ui/GpgFrontendUI.h"
class Ui_PlainTextEditor;
namespace GpgFrontend::UI {
class PlainTextEditorPage : public QWidget {
Q_OBJECT
public:
explicit PlainTextEditorPage(QString file_path = "",
QWidget* parent = nullptr);
[[nodiscard]] const QString& GetFilePath() const;
void SetFilePath(const QString& filePath);
QPlainTextEdit* GetTextPage();
void ShowNotificationWidget(QWidget* widget, const char* className);
void CloseNoteByClass(const char* className);
void ReadFile();
[[nodiscard]] bool ReadDone() const { return this->read_done_; }
void PrepareToDestroy();
private:
std::shared_ptr<Ui_PlainTextEditor> ui_;
QString full_file_path_;
bool sign_marked_{};
bool read_done_ = false;
QThread* read_thread_ = nullptr;
bool binary_mode_ = false;
size_t read_bytes_ = 0;
void detect_encoding(const std::string& data);
void detect_cr_lf(const QString& data);
private slots:
void slot_format_gpg_header();
void slot_insert_text(const std::string& data);
};
} // namespace GpgFrontend::UI
#endif // __EDITORPAGE_H__
GpgFrontend::UI::PlainTextEditorPage::SetFilePath
void SetFilePath(const QString &filePath)
Definition: PlainTextEditorPage.cpp:78
GpgFrontend::UI
Definition: VerifyDetailsDialog.cpp:33
GpgFrontend::UI::PlainTextEditorPage::GetFilePath
const QString & GetFilePath() const
Definition: PlainTextEditorPage.cpp:72
GpgFrontend::UI::PlainTextEditorPage::ShowNotificationWidget
void ShowNotificationWidget(QWidget *widget, const char *className)
Definition: PlainTextEditorPage.cpp:82
GpgFrontend::UI::PlainTextEditorPage::slot_insert_text
void slot_insert_text(const std::string &data)
Definition: PlainTextEditorPage.cpp:184
GpgFrontend::UI::FileReadThread
Definition: FileReadThread.h:38
GpgFrontend::UI::PlainTextEditorPage::CloseNoteByClass
void CloseNoteByClass(const char *className)
Definition: PlainTextEditorPage.cpp:88
GpgFrontend::UI::PlainTextEditorPage::sign_marked_
bool sign_marked_
true, if the signed header is marked, false if not
Definition: PlainTextEditorPage.h:110
GpgFrontend::UI::PlainTextEditorPage::PlainTextEditorPage
PlainTextEditorPage(QString file_path="", QWidget *parent=nullptr)
Definition: PlainTextEditorPage.cpp:39
GpgFrontend::UI::PlainTextEditorPage::detect_cr_lf
void detect_cr_lf(const QString &data)
Definition: PlainTextEditorPage.cpp:248
GpgFrontend::UI::PlainTextEditorPage
Class for handling a single tab of the tabwidget.
Definition: PlainTextEditorPage.h:43
GpgFrontend::UI::PlainTextEditorPage::detect_encoding
void detect_encoding(const std::string &data)
Definition: PlainTextEditorPage.cpp:224
GpgFrontend::UI::FileReadThread::SignalSendReadBlock
void SignalSendReadBlock(const std::string &block)
GpgFrontend::UI::PlainTextEditorPage::slot_format_gpg_header
void slot_format_gpg_header()
Definition: PlainTextEditorPage.cpp:97
GpgFrontend::UI::PlainTextEditorPage::GetTextPage
QPlainTextEdit * GetTextPage()
Definition: PlainTextEditorPage.cpp:76
GpgFrontend::UI::PlainTextEditorPage::full_file_path_
QString full_file_path_
The path to the file handled in the tab.
Definition: PlainTextEditorPage.h:109
GpgFrontend::UI::PlainTextEditorPage::ReadDone
bool ReadDone() const
Definition: PlainTextEditorPage.h:99