From a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Wed, 25 Mar 2015 10:15:50 +0100 Subject: First commit of IT-Sicherheit --- src/spinboxciphers.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/spinboxciphers.h (limited to 'src/spinboxciphers.h') diff --git a/src/spinboxciphers.h b/src/spinboxciphers.h new file mode 100644 index 0000000..f073292 --- /dev/null +++ b/src/spinboxciphers.h @@ -0,0 +1,70 @@ +#ifndef SPINBOXCIPHERS_H +#define SPINBOXCIPHERS_H + +#include + +#include "cipherssingleton.h" + + +/** +* \class SpinBoxCiphers +* \brief SpinBox-Widget to enable Selection of Ciphers. +* +* This Class provides specialized SpinBox able to display strings to make for an +* easier Selection of Algorithms +* \author Uwe Gogolin [Gogolin.Uwe@FH-SWF.de] +* \version 0.1 +* \date 28.02.2013 +*/ +class SpinBoxCiphers : public QSpinBox +{ + Q_OBJECT + +public: //Methods + /** + * \brief Class Constructor. + * + * Class Constructor. Gets the instance of the CiphersSingleton-Class. + * \param QWidget* parent The QWidget the used instance of this class is subordinated to. + */ + SpinBoxCiphers( QWidget* parent = 0 ); + + + +protected: //Methods + /** + * \brief Method to fetch a QString corresponding with the given Integer. + * + * For the given value, looks up what QString corresponds to it according to the definition + * in the Class CipherSingleton and returns it. + * \param int value integer representing an algorithm + * \see QSpinBox-Documentation + * \see Class CipherSingleton for assignments of Strings to Integers (and vice versa). + * \returns QString corresponding to the given integer. + */ + QString textFromValue ( int value ) const; + + + /** + * \brief Method to fetch an Integer corresponding with the given QString. + * + * For the given QString, looks up what Integer corresponds to it according to the definition + * in the Class CipherSingleton and returns it. + * \param QString& text QString representing an algorithm + * \see QSpinBox-Documentation + * \see Class CipherSingleton for assignments of Strings to Integers (and vice versa). + * \returns Integer corresponding to the given QString. + */ + int valueFromText ( const QString & text ) const; + + +private: //Attributes + /** + * \brief Instance of the Class used to assign an integer to a String for each Cipher (and vice versa). + * + * \attention These Strings are used throughout the entire program to reference ciphers! + */ + CiphersSingleton* m_cipherStrings; +}; + +#endif // SPINBOXCIPHERS_H -- cgit v1.2.3-70-g09d2