summaryrefslogtreecommitdiffstats
path: root/src/spinboxciphers.h
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 10:15:50 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 10:33:32 +0100
commita1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 (patch)
tree859befb5df101432b7388e1562f90a01c6d8e238 /src/spinboxciphers.h
downloadIT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.tar.gz
IT-Sicherheit-a1e3d36dca9c6abf235c7ddf47ab9185c4b748d5.zip
First commit of IT-Sicherheit
Diffstat (limited to 'src/spinboxciphers.h')
-rw-r--r--src/spinboxciphers.h70
1 files changed, 70 insertions, 0 deletions
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 <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