#ifndef TABWIDGETSELECTALGORITHM_H #define TABWIDGETSELECTALGORITHM_H #include #include "cipherssingleton.h" #include "tabsymmetric.h" #include "tabasymmetric.h" #include "tabhybrid.h" /** * \class TabWidgetSelectAlgorithm * \brief Subclassed TabWidget for Algorithm-Selection. * * SubClass of QTabWidget with added functionality for exclusive selection of an algorithm for de/encryption, * sorted by the kind of algorithm (NullCipher, Symmetric, Asymmetric, Hybrid) * For each kind of algorithm, a special TabWidget has been implemented. * \author Uwe Gogolin [Gogolin.Uwe@FH-SWF.de] * \version 0.1 * \date 28.02.2013 */ class TabWidgetSelectAlgorithm : public QTabWidget { Q_OBJECT public: //Methods /** * \brief Class Constructor. * * Class Constructor. Initializes the four different TabWidgets and adds them as Tabs to itself. * Connects the Signal "currentChanged(int)" with the Slot "oncurrentChanged_triggered(int)", which * after checking which is the new current Widget, sends that info via the Signal "currentTabChanged(QString)" * [This is needed to keep the corresponding option in the Menu up to date] * \param QWidget* parent The QWidget the used instance of this class is subordinated to. */ TabWidgetSelectAlgorithm(QWidget *parent = 0); public slots: /** * \brief Slot called to set Tab for NullCipher active. * * Changes the current Tab to the NullCipher-Tab. */ void onNullCipher_selected(); /** * \brief Slot called to set Tab for Symmetric Ciphers active. * * Changes the current Tab to the Symmetric Ciphers-Tab. */ void onSymmetric_selected(); /** * \brief Slot called to set Tab for Asymmetric Ciphers active. * * Changes the current Tab to the Asymmetric Ciphers-Tab. */ void onAsymmetric_selected(); /** * \brief Slot called to set Tab for Hybrid Ciphers active. * * Changes the current Tab to the Hybrid Ciphers-Tab. */ void onHybrid_selected(); signals: /** * \brief SIGNAL to inform other Classes when another Tab becomes active. * * This Signal is used to inform other Classes when a new Tab becomes active. * [NOTE: Will be modified to use NameSpaceCryptEngine::CryptAlgorithm in the future] * \param QString currentTabName string containing the Name of the newly active Tab. */ void currentTabChanged(QString currentTabName); /** * \brief SIGNAL to inform other Classes when a Cipher gets selected. * * This Signal is used to inform other Classes when a Cipher gets selected. * \param int cipher The Integer referencing the selected Cipher according to the Class CiphersSingleton. */ void cipherChanged(int cipher); /** * \brief SIGNAL to inform other Classes when the Keylength is changed. * * This Signal is used to inform other Classes when the Keylength is changed. * \param int keyLength The new Keylength. * \param bool symmetric True if Length for Symmetric Cipher, false if for asymmetric Cipher. */ void keyLengthChanged(int keyLength, bool symmetric); private slots: /** * \brief Slot needed to get the pointer to the newly active Tab from its index. * * This slot is called when the currently active Tab changes. This Tab, however, is only referenced by index * by the Signal "currentChanged", which is fine for reference inside this Class. * For Classes outside, a better description is needed. Currently, a QString is used. * [NOTE: Will be modified to use NameSpaceCryptEngine::CryptAlgorithm in the future] * \param int index Index of the newly active Tab */ void oncurrentChanged_triggered(int index); private: //Attributes /** * \brief Pointer to the TabWidget for NullCipher. * * \attention This Tab is supposed to be empty, since there no settings for the NullCipher. */ QWidget* m_nullCipher; /** * \brief Pointer to the TabWidget for Symmetric Ciphers. */ QWidget* m_symmetric; /** * \brief Pointer to the TabWidget for Asymmetric Ciphers. */ QWidget* m_asymmetric; /** * \brief Pointer to the TabWidget for Hybrid Ciphers. */ QWidget* m_hybrid; }; #endif // TABWIDGETSELECTALGORITHM_H