-
Notifications
You must be signed in to change notification settings - Fork 0
/
addorremove.h
104 lines (75 loc) · 2.49 KB
/
addorremove.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
#ifndef ADDORREMOVE_H
#define ADDORREMOVE_H
#include "contact.h"
#include <QMainWindow>
#include <QGridLayout>
#include <QWidget>
#include <QFormLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
#include <iostream>
using namespace std;
class AddOrRemove : public QMainWindow
{
Q_OBJECT
public:
explicit AddOrRemove(QWidget *parent = 0);
// Layouts //
QWidget * arwidget;
QGridLayout * argrid;
QFormLayout * arform;
// -------- //
QMessageBox * warning;
QMessageBox * SuccessMessage;
// Buttons //
QPushButton * CLOSE;
QPushButton * ADDButton;
QPushButton * REMOVEButton;
// ------- //
// labels //
QLabel * firstnamelabel;
QLabel * lastnamelabel;
QLabel * phonenumberlabel;
QLabel * groupnamelabel;
// ------- //
// LineEdits //
QLineEdit * firstnameLine;
QLineEdit * lastnameLine;
QLineEdit * PhoneNumberLine;
QLineEdit * GroupNameLine;
// ---------- //
// public functions //
void CreateLineEdits();
void CreateLabels();
// QMessageBox methods //
void CreateWarning();
void ShowWarning();
void CreateSuccessMessage();
void SetDataForRemovetMessage();
void SetDataForAddMessage();
void RepeatitiveContactMessage();
// ------------------ //
void InsertInfoReceiversTools();
bool SearchContact(Contact & c);
void CreateARButtons();
void ConnectButtons();
void InsertButtonsInLayout();
void InsertLayouts();
bool LoadContactFromFile(QList<Contact> &clist);
bool SaveContactsInFile(QList<Contact> &clist);
void SaveContactWithGroupsInFile(QString groupname);
QStringList getAllGroupsName();
void FillGroupsInFile(QMap<QString,QList<Contact>> & GroupsList);
void LoadGroupsFromFile(QMap<QString,QList<Contact>> & GroupsList);
bool RemoveContactFromBook(Contact & c);
bool RemoveContactFromGroup(Contact & c, QString groupname) ;
QString getContactGroupname(Contact & target);
// ------------------------------- //
signals:
public slots:
bool AddContactToBook();
void DeleteContact();
};
#endif // ADDORREMOVE_H