OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Randomizer.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// Toolkit API header
10#include "OToolkitAPI/Tool.h"
11
12// OT header
13#include <OTWidgets/Dialog.h>
14
15// Qt header
16#include <QtCore/qobject.h>
17
18// std header
19#include <map>
20
21class QLabel;
22class QWidget;
23class QSpinBox;
24class QGroupBox;
25class QCheckBox;
26class QLineEdit;
27class QTabWidget;
28class QVBoxLayout;
29class QHBoxLayout;
30class QGridLayout;
31class QPushButton;
32class QRadioButton;
33class QPlainTextEdit;
34
35namespace ot { class BasicWidgetView; };
36
37class Randomizer : public QObject, public otoolkit::Tool {
38 Q_OBJECT
39public:
40 Randomizer();
41 virtual ~Randomizer();
42
43 // ###########################################################################################################################################################################################################################################################################################################################
44
45 // API base functions
46
49 virtual QString getToolName(void) const override { return QString("Randomizer"); };
50
52 virtual bool runTool(QMenu* _rootMenu, otoolkit::ToolWidgets& _content) override;
53
54 virtual void restoreToolSettings(QSettings& _settings) override;
55
57 virtual bool prepareToolShutdown(QSettings& _settings) override;
58
59 const std::map<QString, QPlainTextEdit*>& listEntries(void) const { return m_lists; };
60
61private Q_SLOTS:
62 void slotRunBool(void);
63 void slotRunText(void);
64 void slotRunList(void);
65 void slotAddList(void);
66
67private:
68
69 ot::WidgetView* m_root;
70 QVBoxLayout* m_rootLayout;
71 QLabel* m_leftTitle;
72
73 QGroupBox* m_boolGroup;
74 QVBoxLayout* m_boolLayout;
75 QHBoxLayout* m_boolTypeLayout;
76 QRadioButton* m_zeroOneRB;
77 QRadioButton* m_boolRB;
78 QRadioButton* m_yesNoRB;
79 QLabel* m_boolResult;
80 QPushButton* m_boolRun;
81
82 QGroupBox* m_textGroup;
83 QVBoxLayout* m_textLayout;
84 QHBoxLayout* m_textTopLayout;
85 QCheckBox* m_upperCaseCB;
86 QCheckBox* m_lowerCaseCB;
87 QCheckBox* m_numbersCB;
88 QCheckBox* m_symbolsCB;
89 QLineEdit* m_symbolsEdit;
90 QHBoxLayout* m_textBottomLayout;
91 QLabel* m_textLengthL;
92 QSpinBox* m_textLength;
93 QPushButton* m_textRun;
94 QLineEdit* m_textResult;
95
96 QGroupBox* m_listGroup;
97 QVBoxLayout* m_listLayout;
98 QTabWidget* m_listTabs;
99 std::map<QString, QPlainTextEdit*> m_lists;
100 QHBoxLayout* m_addListLayout;
101 QPushButton* m_addListBtn;
102 QPushButton* m_runList;
103 QLineEdit* m_listResult;
104
105};
106
108 Q_OBJECT
109public:
110 RandomizerDialog(Randomizer * _owner, QWidget* _widget);
111 virtual ~RandomizerDialog();
112
113 QString currentName(void) const;
114
115private Q_SLOTS:
116 void slotConfirm(void);
117 void slotCancel(void);
118
119private:
120 QVBoxLayout* m_centralLayout;
121 QHBoxLayout* m_nameLayout;
122 QLabel* m_nameLabel;
123 QLineEdit* m_nameEdit;
124 QHBoxLayout* m_buttonLayout;
125 QPushButton* m_confirmBtn;
126 QPushButton* m_cancelBtn;
127
128 Randomizer* m_owner;
129
130 RandomizerDialog() = delete;
131};
This file contains defines that may be used simplyfy class creation.
Definition Randomizer.h:107
QString currentName(void) const
Definition Randomizer.cpp:348
virtual ~RandomizerDialog()
Definition Randomizer.cpp:344
Definition Randomizer.h:37
virtual ~Randomizer()
Definition Randomizer.cpp:48
virtual bool runTool(QMenu *_rootMenu, otoolkit::ToolWidgets &_content) override
Create the central widget that will be displayed to the user in the main tab view.
Definition Randomizer.cpp:56
virtual QString getToolName(void) const override
Return the unique tool name The name will be used to create all required menu entries.
Definition Randomizer.h:49
const std::map< QString, QPlainTextEdit * > & listEntries(void) const
Definition Randomizer.h:59
Randomizer()
Definition Randomizer.cpp:44
virtual void restoreToolSettings(QSettings &_settings) override
Definition Randomizer.cpp:150
virtual bool prepareToolShutdown(QSettings &_settings) override
Stop all the logic of this tool.
Definition Randomizer.cpp:199
Definition Dialog.h:19
The WidgetView class is used to integrate the Qt-ADS functionallity into open twin.
Definition WidgetView.h:33
Definition Tool.h:27
Definition ToolWidgets.h:24
Definition Connector.h:8