summaryrefslogtreecommitdiffstats
path: root/src/spinboxciphers.h
blob: f0732920edb10adb3174142020d8292bdfe5504a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef SPINBOXCIPHERS_H
#define SPINBOXCIPHERS_H

#include <QSpinBox>

#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