diff options
Diffstat (limited to 'src/ui/widgets/PlainTextEditorPage.h')
-rw-r--r-- | src/ui/widgets/PlainTextEditorPage.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ui/widgets/PlainTextEditorPage.h b/src/ui/widgets/PlainTextEditorPage.h index e76c11e3..0009b7d6 100644 --- a/src/ui/widgets/PlainTextEditorPage.h +++ b/src/ui/widgets/PlainTextEditorPage.h @@ -29,6 +29,8 @@ #ifndef __EDITORPAGE_H__ #define __EDITORPAGE_H__ +#include <string> + #include "core/GpgConstants.h" #include "ui/GpgFrontendUI.h" @@ -49,7 +51,7 @@ class PlainTextEditorPage : public QWidget { * @param file_path Path of the file handled in this tab * @param parent Pointer to the parent widget */ - explicit PlainTextEditorPage(QString file_path = "", + explicit PlainTextEditorPage(QString file_path = {}, QWidget* parent = nullptr); /** @@ -104,6 +106,18 @@ class PlainTextEditorPage : public QWidget { */ void PrepareToDestroy(); + /** + * @brief detect if the charset of the file will change + * + */ + bool WillCharsetChange() const; + + /** + * @brief notify the user that the file has been saved. + * + */ + void NotifyFileSaved(); + private: std::shared_ptr<Ui_PlainTextEditor> ui_; ///< QString full_file_path_; ///< The path to the file handled in the tab @@ -112,6 +126,10 @@ class PlainTextEditorPage : public QWidget { QThread* read_thread_ = nullptr; ///< bool binary_mode_ = false; ///< size_t read_bytes_ = 0; ///< + std::string charset_name_; ///< + std::string language_name_; ///< + int32_t charset_confidence_; ///< + bool is_crlf_ = false; ///< /** * @brief @@ -125,7 +143,7 @@ class PlainTextEditorPage : public QWidget { * * @param data */ - void detect_cr_lf(const QString& data); + void detect_cr_lf(const std::string& data); private slots: |