-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpasswordgenerator.h
107 lines (90 loc) · 3.19 KB
/
passwordgenerator.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef PASSWORDGENERATOR_H
#define PASSWORDGENERATOR_H
#include <QDialog>
#include <vector>
#include <random>
#include <QCheckBox>
#include <QString>
#include <QWidget>
#include <QClipboard>
#include <QApplication>
namespace Ui {
class PasswordGenerator;
}
// ====================
// Class Declaration
// ====================
class PasswordGenerator : public QDialog
{
Q_OBJECT
public:
// ====================
// Constructor & Destructor
// ====================
explicit PasswordGenerator(QWidget *parent = nullptr);
~PasswordGenerator();
// ====================
// Public Methods
// ====================
// Generates a password based on length and complexity
char* createPassword(int len, int comp);
// Updates the vector of symbols based on checkbox selection
void updateSymbols(bool checked, char symbol);
private slots:
// ====================
// Slots for UI Interaction
// ====================
// Slider moved events
void on_PassLengthSlider_sliderMoved(int position);
void on_PassCompSlider_sliderMoved(int position);
// Button clicked events
void on_GenPass_clicked(); // Generate password button
void on_CopyButton_clicked(); // Copy password button
// Checkbox state changed events
void on_checkBox_1_stateChanged(int arg1);
void on_checkBox_2_stateChanged(int arg1);
void on_checkBox_3_stateChanged(int arg1);
void on_checkBox_4_stateChanged(int arg1);
void on_checkBox_5_stateChanged(int arg1);
void on_checkBox_6_stateChanged(int arg1);
void on_checkBox_7_stateChanged(int arg1);
void on_checkBox_8_stateChanged(int arg1);
void on_checkBox_9_stateChanged(int arg1);
void on_checkBox_10_stateChanged(int arg1);
void on_checkBox_11_stateChanged(int arg1);
void on_checkBox_12_stateChanged(int arg1);
void on_checkBox_13_stateChanged(int arg1);
void on_checkBox_14_stateChanged(int arg1);
void on_checkBox_15_stateChanged(int arg1);
void on_checkBox_16_stateChanged(int arg1);
void on_checkBox_17_stateChanged(int arg1);
void on_checkBox_18_stateChanged(int arg1);
void on_checkBox_19_stateChanged(int arg1);
void on_checkBox_20_stateChanged(int arg1);
void on_checkBox_21_stateChanged(int arg1);
void on_checkBox_22_stateChanged(int arg1);
void on_checkBox_23_stateChanged(int arg1);
void on_checkBox_24_stateChanged(int arg1);
void on_checkBox_25_stateChanged(int arg1);
void on_checkBox_26_stateChanged(int arg1);
void on_checkBox_27_stateChanged(int arg1);
void on_checkBox_28_stateChanged(int arg1);
// Exit button clicked event
void on_exitButton_clicked();
private:
// ====================
// Private Members
// ====================
Ui::PasswordGenerator *ui;
int *_passLength; // Pointer to store password length
int *_passComp; // Pointer to store password complexity
// Vectors to store characters, numbers, and symbols
std::vector<char> *_letters;
std::vector<char> *_numbers;
std::vector<char> *_symbols;
// ====================
// Private Methods
// ====================
// Event triggered when the window is closed
};
#endif // PASSWORDGENERATOR_H