GpgFrontend::UI::PlainTextEditorPage Class Reference

Class for handling a single tab of the tabwidget. More...

`#include <PlainTextEditorPage.h>`

Inheritance diagram for GpgFrontend::UI::PlainTextEditorPage:
Collaboration diagram for GpgFrontend::UI::PlainTextEditorPage:

## Signals

void | SignalUIBytesDisplayed ()
| this signal is emitted when the bytes has been append in texteditor. More...

## 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
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 (QByteArray bytes_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
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

## Detailed Description

Class for handling a single tab of the tabwidget.

## Constructor & Destructor Documentation

## PlainTextEditorPage()

GpgFrontend::UI::PlainTextEditorPage::PlainTextEditorPage | ( | QString | file_path = `{}`,
|  | QWidget * | parent = `nullptr`
| ) |  |

explicit

Add layout and add plaintextedit

Parameters

  file_path | Path of the file handled in this tab
  parent | Pointer to the parent widget

References full_file_path_.

## Member Function Documentation

## CloseNoteByClass()

void GpgFrontend::UI::PlainTextEditorPage::CloseNoteByClass | ( | const char * | className | ) |

Hide all widgets with the given className

Parameters

  className | The classname of the widgets to hide

Referenced by GpgFrontend::UI::MainWindow::slot_find().

## detect_cr_lf()

void GpgFrontend::UI::PlainTextEditorPage::detect_cr_lf | ( | const std::string & | data | ) |

private

Parameters

  data |

Referenced by slot_insert_text().

## detect_encoding()

void GpgFrontend::UI::PlainTextEditorPage::detect_encoding | ( | const std::string & | data | ) |

private

Parameters

  data |

References GpgFrontend::CharsetOperator::Detect().

Referenced by slot_insert_text().

## GetFilePath()

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().

## GetTextPage()

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_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), slot_insert_text(), GpgFrontend::UI::MainWindow::slot_sign(), 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().

## NotifyFileSaved()

void GpgFrontend::UI::PlainTextEditorPage::NotifyFileSaved | ( |  | ) |

notify the user that the file has been saved.

Referenced by GpgFrontend::UI::TextEdit::save_file().

## ReadDone()

bool GpgFrontend::UI::PlainTextEditorPage::ReadDone | ( |  | ) | const

inline

Returns
  true
  false

Referenced by GpgFrontend::UI::TextEdit::maybe_save_current_tab().

## SetFilePath()

void GpgFrontend::UI::PlainTextEditorPage::SetFilePath | ( | const QString & | filePath | ) |

Set filepath of currently activated tab.

Parameters

  filePath | The path to be set

References full_file_path_.

Referenced by GpgFrontend::UI::TextEdit::LoadFile(), and GpgFrontend::UI::TextEdit::save_file().

## ShowNotificationWidget()

void GpgFrontend::UI::PlainTextEditorPage::ShowNotificationWidget | ( | QWidget * | widget,
|  | const char * | className
| ) |  |

Show additional widget at buttom of currently active tab

Parameters

  widget | The widget to be added
  className | The name to handle the added widget

Referenced by GpgFrontend::UI::MainWindow::slot_find().

## SignalUIBytesDisplayed

void GpgFrontend::UI::PlainTextEditorPage::SignalUIBytesDisplayed | ( |  | ) |

signal

this signal is emitted when the bytes has been append in texteditor.

Referenced by slot_insert_text().

## slot_format_gpg_header

void GpgFrontend::UI::PlainTextEditorPage::slot_format_gpg_header | ( |  | ) |

privateslot

Format the gpg header in another font-style

References sign_marked_.

## slot_insert_text

void GpgFrontend::UI::PlainTextEditorPage::slot_insert_text | ( | QByteArray | bytes_data | ) |

privateslot

Parameters

  data |

References detect_cr_lf(), detect_encoding(), GetTextPage(), and SignalUIBytesDisplayed().

## WillCharsetChange()

bool GpgFrontend::UI::PlainTextEditorPage::WillCharsetChange | ( |  | ) | const

detect if the charset of the file will change

Referenced by GpgFrontend::UI::TextEdit::save_file().

The documentation for this class was generated from the following files:

- src/ui/widgets/PlainTextEditorPage.h
- src/ui/widgets/PlainTextEditorPage.cpp