PictureCrypt  1.4.1
An image-steganography project
Public Slots | Signals | Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | List of all members
ViewPC Class Reference

The ViewPC class View layer of the app. Controls EncryptDialog and ProgressDialog. More...

#include <viewpc.h>

Inheritance diagram for ViewPC:
Inheritance graph
[legend]
Collaboration diagram for ViewPC:
Collaboration graph
[legend]

Public Slots

void alert (QString message, bool isWarning=false)
 ViewPC::alert Slot to create QMessageBox with message. More...
 
void saveData (QByteArray Edata)
 ViewPC::saveData Slot to be called to save data using QFileDialog. More...
 
void saveImage (QImage *image)
 ViewPC::saveImage Slot to be called to save image using QFileDialog. More...
 
void setProgress (int val)
 ViewPC::setProgress Slot to set the value of the ProgressDialog (ViewPC::dialog). More...
 
void abortCircuit ()
 ViewPC::abortCircuit Slot to close ProgressDialog (ViewPC::dialog) More...
 
void setEncryptMode (bool encr)
 ViewPC::setEncryptMode Set the encrpt mode (ViewPC::isEncrypt) More...
 
void setVersion (QString version)
 ViewPC::setVersion Set the version of the app from ControllerPC. More...
 

Signals

void encrypt (QByteArray data, QImage *image, int mode, QString key, int bitsUsed)
 encrypt Signal calling ModelPC::encrypt More...
 
void inject (QByteArray data, QImage *image, int mode, int bitsUsed)
 inject Signal calling ModelPC::inject More...
 
void decrypt (QImage *_image, QString key, int mode)
 decrypt Signal calling ModelPC::decrypt More...
 
void abortModel ()
 abortModel Signal calling to stop ModelPC::circuit More...
 
void setJPHSDir (QString dir)
 setJPHSPath Sets the default JPHS directory More...
 

Public Member Functions

 ViewPC (QWidget *parent=nullptr)
 
 ~ViewPC ()
 ViewPC::~ViewPC Simple destructor for this layer. More...
 

Public Attributes

QProgressDialog * dialog
 dialog ProgressDialog used. More...
 
bool progressDialogClosed
 progressDialogClosed Flag, if dialog is closed. More...
 
QMap< QString, QString > errorsDict
 errorsDict QMap - Errors dictionary More...
 

Protected Slots

void on_fileButton_clicked ()
 ViewPC::on_fileButton_clicked Slot to be called, when according button is pressed. More...
 
void on_startButton_clicked ()
 ViewPC::on_startButton_clicked Slot to be called, when Start Button is pressed. More...
 
void on_actionAbout_triggered ()
 ViewPC::on_actionAbout_triggered Opens about page. More...
 
void on_actionHelp_triggered ()
 ViewPC::on_actionHelp_triggered Opens online documentation. More...
 
void setupErrorsDict ()
 ViewPC::setupErrorsDict Setups errorsDict from strings.xml. More...
 

Protected Member Functions

QString requestKey ()
 ViewPC::requestKey Request keyphrase from user using InputDialog. More...
 

Detailed Description

The ViewPC class View layer of the app. Controls EncryptDialog and ProgressDialog.

See also
ControllerPC, ModelPC, EncryptDialog

Definition at line 35 of file viewpc.h.

Constructor & Destructor Documentation

ViewPC::ViewPC ( QWidget *  parent = nullptr)
explicit

Definition at line 4 of file viewpc.cpp.

Here is the call graph for this function:

ViewPC::~ViewPC ( )

ViewPC::~ViewPC Simple destructor for this layer.

Definition at line 19 of file viewpc.cpp.

Here is the call graph for this function:

Member Function Documentation

void ViewPC::abortCircuit ( )
slot

ViewPC::abortCircuit Slot to close ProgressDialog (ViewPC::dialog)

Definition at line 211 of file viewpc.cpp.

Here is the caller graph for this function:

void ViewPC::abortModel ( )
signal

abortModel Signal calling to stop ModelPC::circuit

Here is the caller graph for this function:

void ViewPC::alert ( QString  message,
bool  isWarning = false 
)
slot

ViewPC::alert Slot to create QMessageBox with message.

Parameters
messageMessage to be shown
isWarningFlag, if message is critical.

Definition at line 125 of file viewpc.cpp.

Here is the caller graph for this function:

void ViewPC::decrypt ( QImage *  _image,
QString  key,
int  mode 
)
signal

decrypt Signal calling ModelPC::decrypt

Parameters
_imageImage for decryption
keyencryption key
modeMode of decryption
See also
ModelPC::decrypt, ModelPC::CryptMode

Here is the caller graph for this function:

void ViewPC::encrypt ( QByteArray  data,
QImage *  image,
int  mode,
QString  key,
int  bitsUsed 
)
signal

encrypt Signal calling ModelPC::encrypt

Parameters
dataData to write
imageImage to be encrypted into
modeMode of encryption
keyKey of encryption
bitsUsedBits used per byte

Here is the caller graph for this function:

void ViewPC::inject ( QByteArray  data,
QImage *  image,
int  mode,
int  bitsUsed 
)
signal

inject Signal calling ModelPC::inject

Parameters
dataData to write
imageImage to be encrypted into.
modeMode of encryption
bitsUsedBits used per byte
void ViewPC::on_actionAbout_triggered ( )
protectedslot

ViewPC::on_actionAbout_triggered Opens about page.

Definition at line 268 of file viewpc.cpp.

Here is the call graph for this function:

void ViewPC::on_actionHelp_triggered ( )
protectedslot

ViewPC::on_actionHelp_triggered Opens online documentation.

Definition at line 278 of file viewpc.cpp.

void ViewPC::on_fileButton_clicked ( )
protectedslot

ViewPC::on_fileButton_clicked Slot to be called, when according button is pressed.

Definition at line 38 of file viewpc.cpp.

void ViewPC::on_startButton_clicked ( )
protectedslot

ViewPC::on_startButton_clicked Slot to be called, when Start Button is pressed.

Encrypting

If Encrypting mode is active the data from text browser or from file from file selector will be opened and checked in size.

Note
File size limit is 16MB

Then the EncryptDialog opens and image and key is selected. Then the ViewPC::encrypt signal is called to start ModelPC::encrypt

Decrypting

Else, the image from file selector is transmitted to ModelPC::decrypt

Definition at line 60 of file viewpc.cpp.

Here is the call graph for this function:

QString ViewPC::requestKey ( )
protected

ViewPC::requestKey Request keyphrase from user using InputDialog.

Returns
Returns keyphrase

Definition at line 248 of file viewpc.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ViewPC::saveData ( QByteArray  Edata)
slot

ViewPC::saveData Slot to be called to save data using QFileDialog.

Parameters
EdataEncrypted data to be saved.
See also
ModelPC::encrypt

Definition at line 146 of file viewpc.cpp.

Here is the call graph for this function:

void ViewPC::saveImage ( QImage *  image)
slot

ViewPC::saveImage Slot to be called to save image using QFileDialog.

Parameters
imageImage to be saved.
See also
ModelPC::decrypt

Definition at line 167 of file viewpc.cpp.

Here is the call graph for this function:

void ViewPC::setEncryptMode ( bool  encr)
slot

ViewPC::setEncryptMode Set the encrpt mode (ViewPC::isEncrypt)

Parameters
encr= isEncrypt, true if encrypting, false if decrypting

Definition at line 224 of file viewpc.cpp.

Here is the caller graph for this function:

void ViewPC::setJPHSDir ( QString  dir)
signal

setJPHSPath Sets the default JPHS directory

Parameters
dirDirectory

Here is the caller graph for this function:

void ViewPC::setProgress ( int  val)
slot

ViewPC::setProgress Slot to set the value of the ProgressDialog (ViewPC::dialog).

Parameters
valNew value of the dialog. If -1, creates ProgressDialog, if 101 closes the dialog.
See also
ViewPC::abortCircuit(), ModelPC::setProgress()

Definition at line 185 of file viewpc.cpp.

Here is the call graph for this function:

void ViewPC::setupErrorsDict ( )
protectedslot

ViewPC::setupErrorsDict Setups errorsDict from strings.xml.

Definition at line 286 of file viewpc.cpp.

Here is the caller graph for this function:

void ViewPC::setVersion ( QString  version)
slot

ViewPC::setVersion Set the version of the app from ControllerPC.

Parameters
versionVersion as QString

Definition at line 239 of file viewpc.cpp.

Here is the caller graph for this function:

Member Data Documentation

QProgressDialog* ViewPC::dialog

dialog ProgressDialog used.

See also
ViewPC::setProgress, ViewPC::cancel, ModelPC::setProgress

Definition at line 111 of file viewpc.h.

QMap<QString, QString> ViewPC::errorsDict

errorsDict QMap - Errors dictionary

Definition at line 120 of file viewpc.h.

bool ViewPC::progressDialogClosed

progressDialogClosed Flag, if dialog is closed.

See also
ViewPC::abortCircuit, ViewPC::setProgress

Definition at line 116 of file viewpc.h.


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