-
Notifications
You must be signed in to change notification settings - Fork 0
/
passwordmanagementbuttons.h
80 lines (66 loc) · 2.64 KB
/
passwordmanagementbuttons.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
#ifndef PASSWORDMANAGEMENTBUTTONS_H
#define PASSWORDMANAGEMENTBUTTONS_H
#include <memory> // Required for smart pointers
#include <QDialog> // Required for QDialog
#include <QPointer>
// =====================
// Forward Declarations
// =====================
class PasswordGenerator; // Forward declaration for PasswordGenerator class
class resetPassword; // Forward declaration for resetPassword class
class storePassword; // Forward declaration for storePassword class
class retrievePassword;
class transferData;
namespace Ui {
class passwordManagementButtons;
}
// ====================
// Class Declaration
// ====================
class passwordManagementButtons : public QDialog
{
Q_OBJECT
public:
// =========================
// Constructor & Destructor
// =========================
explicit passwordManagementButtons(QWidget *parent = nullptr);
~passwordManagementButtons();
signals:
void updateTheme(QString selectedTheme);
private slots:
// ====================
// Button Click Handlers
// ====================
void on_genPass_clicked(); // Handles the 'Generate Password' button click
void onResetCanceled(); // Handles the reset process when canceled
void on_resetLoginButton_clicked(); // Handles the 'Reset Login' button click
void on_logoutButton_clicked(); // Handles the 'Logout' button click
void on_storePass_clicked(); // Handles the 'Store Password' button click
void handleRequestGenPassword(); // Handles password generation requests
void handleBackStorePassword(); // Handles user clicking 'Back' in the store password section
void handleBackRetrievePassword(); // Handles user clicking 'Back' in the store password section
void handleTransBackPressed();
void on_retrievePass_clicked();
void on_deleteAllButton_clicked();
void on_exportPassButton_clicked();
public slots:
void onThemeTextChanged(const QString &text);
private:
// =====================
// Private Members
// =====================
Ui::passwordManagementButtons *ui; // UI pointer for managing the interface
// Smart pointers to manage instances of related classes
std::unique_ptr<PasswordGenerator> myPassGen;
std::unique_ptr<resetPassword> resetPass;
std::unique_ptr<storePassword> storePass;
std::unique_ptr<transferData> tranData;
QPointer<retrievePassword> retrievePass;
void closeEvent(QCloseEvent *event);
void onThemeChanged(int index);
void exportPasswords();
void importPasswords();
void saveImportedPasswordToFile(const QString &passId, const QByteArray &encryptedData);
};
#endif // PASSWORDMANAGEMENTBUTTONS_H