#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