GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
|
Class for handling a single tab of the tabwidget. More...
#include <PlainTextEditorPage.h>
Public Member Functions | |
PlainTextEditorPage (QString file_path={}, QWidget *parent=nullptr) | |
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 () |
bool | ReadDone () const |
void | PrepareToDestroy () |
bool | WillCharsetChange () const |
detect if the charset of the file will change More... | |
void | NotifyFileSaved () |
notify the user that the file has been saved. More... | |
Private Slots | |
void | slot_format_gpg_header () |
void | slot_insert_text (const std::string &data) |
Private Member Functions | |
void | detect_encoding (const std::string &data) |
void | detect_cr_lf (const std::string &data) |
Private Attributes | |
std::shared_ptr< Ui_PlainTextEditor > | ui_ |
QString | full_file_path_ |
The path to the file handled in the tab. | |
bool | sign_marked_ {} |
true, if the signed header is marked, false if not | |
bool | read_done_ = false |
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 |
Class for handling a single tab of the tabwidget.
|
explicit |
Add layout and add plaintextedit
file_path | Path of the file handled in this tab |
parent | Pointer to the parent widget |
References full_file_path_.
void GpgFrontend::UI::PlainTextEditorPage::CloseNoteByClass | ( | const char * | className | ) |
Hide all widgets with the given className
className | The classname of the widgets to hide |
Referenced by GpgFrontend::UI::MainWindow::slot_find().
|
private |
data |
Referenced by slot_insert_text().
|
private |
data |
References GpgFrontend::CharsetOperator::Detect().
Referenced by slot_insert_text().
const QString & GpgFrontend::UI::PlainTextEditorPage::GetFilePath | ( | ) | const |
Get the filepath of the currently activated tab.
References full_file_path_.
Referenced by GpgFrontend::UI::TextEdit::maybe_save_current_tab(), GpgFrontend::UI::TextEdit::SlotSave(), and GpgFrontend::UI::TextEdit::SlotSaveAs().
QPlainTextEdit * GpgFrontend::UI::PlainTextEditorPage::GetTextPage | ( | ) |
Return pointer tp the textedit of the currently activated tab.
Referenced by GpgFrontend::UI::TextEdit::LoadFile(), GpgFrontend::UI::TextEdit::maybe_save_current_tab(), GpgFrontend::UI::TextEdit::save_file(), GpgFrontend::UI::FindWidget::set_background(), GpgFrontend::UI::MainWindow::slot_add_pgp_header(), GpgFrontend::UI::MainWindow::slot_append_selected_keys(), GpgFrontend::UI::MainWindow::slot_clean_double_line_breaks(), GpgFrontend::UI::MainWindow::slot_cut_pgp_header(), GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), slot_insert_text(), GpgFrontend::UI::MainWindow::slot_verify(), GpgFrontend::UI::TextEdit::SlotCloseTab(), GpgFrontend::UI::TextEdit::SlotCopy(), GpgFrontend::UI::TextEdit::SlotCut(), GpgFrontend::UI::TextEdit::SlotFillTextEditWithText(), GpgFrontend::UI::TextEdit::SlotPaste(), GpgFrontend::UI::TextEdit::SlotPrint(), GpgFrontend::UI::TextEdit::SlotRedo(), GpgFrontend::UI::TextEdit::SlotSelectAll(), and GpgFrontend::UI::TextEdit::SlotUndo().
void GpgFrontend::UI::PlainTextEditorPage::NotifyFileSaved | ( | ) |
notify the user that the file has been saved.
Referenced by GpgFrontend::UI::TextEdit::save_file().
|
inline |
Referenced by GpgFrontend::UI::TextEdit::maybe_save_current_tab().
void GpgFrontend::UI::PlainTextEditorPage::SetFilePath | ( | const QString & | filePath | ) |
Set filepath of currently activated tab.
filePath | The path to be set |
References full_file_path_.
Referenced by GpgFrontend::UI::TextEdit::LoadFile(), and GpgFrontend::UI::TextEdit::save_file().
void GpgFrontend::UI::PlainTextEditorPage::ShowNotificationWidget | ( | QWidget * | widget, |
const char * | className | ||
) |
Show additional widget at buttom of currently active tab
widget | The widget to be added |
className | The name to handle the added widget |
Referenced by GpgFrontend::UI::MainWindow::slot_find().
|
privateslot |
Format the gpg header in another font-style
References sign_marked_.
|
privateslot |
data |
References detect_cr_lf(), detect_encoding(), and GetTextPage().
bool GpgFrontend::UI::PlainTextEditorPage::WillCharsetChange | ( | ) | const |
detect if the charset of the file will change
Referenced by GpgFrontend::UI::TextEdit::save_file().