GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::UI::PlainTextEditorPage Class Reference

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

#include <PlainTextEditorPage.h>

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

Signals

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

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
 
void NotifyFileSaved ()
 notify the user that the file has been saved.
 

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_pathPath of the file handled in this tab
parentPointer to the parent widget

References GpgFrontend::UI::SettingsObject::Check(), and full_file_path_.

Member Function Documentation

◆ CloseNoteByClass()

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

Hide all widgets with the given className

Parameters
classNameThe 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(), and GpgFrontend::UI::TextEdit::SlotSaveAs().

◆ GetTextPage()

◆ 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
filePathThe path to be set

References full_file_path_.

Referenced by 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
widgetThe widget to be added
classNameThe name to handle the added widget

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

◆ 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

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