summaryrefslogtreecommitdiff
path: root/interchange/member.hxx
blob: 57467de774a913f9efd2b3745a3dc08d0f343eda (plain)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#ifndef INTERCHANGE_MEMBER_HXX
#define INTERCHANGE_MEMBER_HXX

#include <QObject>
#include <interchange/member.h>

struct interchange_member;

namespace QInterchange {

	class Member : public QObject
	{
		Q_OBJECT
		Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged)
		Q_PROPERTY(QString userNick READ userNick WRITE setUserNick NOTIFY userNickChanged)
		Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
		Q_PROPERTY(QString expiration READ expiration WRITE setExpiration NOTIFY expirationChanged)
		Q_PROPERTY(QString acl READ acl WRITE setAcl NOTIFY aclChanged)
		Q_PROPERTY(QString modTime READ modTime WRITE setModTime NOTIFY modTimeChanged)
		Q_PROPERTY(QString sNickName READ sNickName WRITE setSNickName NOTIFY sNickNameChanged)
		Q_PROPERTY(QString company READ company WRITE setCompany NOTIFY companyChanged)
		Q_PROPERTY(QString fName READ fName WRITE setFName NOTIFY fNameChanged)
		Q_PROPERTY(QString lName READ lName WRITE setLName NOTIFY lNameChanged)
		Q_PROPERTY(QString address1 READ address1 WRITE setAddress1 NOTIFY address1Changed)
		Q_PROPERTY(QString address2 READ address2 WRITE setAddress2 NOTIFY address2Changed)
		Q_PROPERTY(QString address3 READ address3 WRITE setAddress3 NOTIFY address3Changed)
		Q_PROPERTY(QString city READ city WRITE setCity NOTIFY cityChanged)
		Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
		Q_PROPERTY(QString zip READ zip WRITE setZip NOTIFY zipChanged)
		Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged)
		Q_PROPERTY(QString phoneDay READ phoneDay WRITE setPhoneDay NOTIFY phoneDayChanged)
		Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)

		public:
			explicit Member(QObject* parent = nullptr);
			~Member() {}

			QString const& userName() const { return m_userName; }
			QString const& userNick() const { return m_userNick; }
			QString const& password() const { return m_password; }
			QString const& expiration() const { return m_expiration; }
			QString const& acl() const { return m_acl; }
			QString const& modTime() const { return m_modTime; }
			QString const& sNickName() const { return m_sNickName; }
			QString const& company() const { return m_company; }
			QString const& fName() const { return m_fName; }
			QString const& lName() const { return m_lName; }
			QString const& address1() const { return m_address1; }
			QString const& address2() const { return m_address2; }
			QString const& address3() const { return m_address3; }
			QString const& city() const { return m_city; }
			QString const& state() const { return m_state; }
			QString const& zip() const { return m_zip; }
			QString const& country() const { return m_country; }
			QString const& phoneDay() const { return m_phoneDay; }
			QString const& email() const { return m_email; }
			interchange_member* data() { return m_data; }

			void setUserName(QString const& userName);
			void setUserNick(QString const& userNick);
			void setPassword(QString const& password);
			void setExpiration(QString const& expiration);
			void setAcl(QString const& acl);
			void setModTime(QString const& modTime);
			void setSNickName(QString const& sNickName);
			void setCompany(QString const& company);
			void setFName(QString const& fName);
			void setLName(QString const& lName);
			void setAddress1(QString const& address1);
			void setAddress2(QString const& address2);
			void setAddress3(QString const& address3);
			void setCity(QString const& city);
			void setState(QString const& state);
			void setZip(QString const& zip);
			void setCountry(QString const& country);
			void setPhoneDay(QString const& phoneDay);
			void setEmail(QString const& email);
			void setData(interchange_member* data);

		public slots:
			void newAccount(QString const& username,
					QString const& password,
					QString const& confirm,
					QString const& failPage = nullptr);
			void logIn(QString const& username,
					QString const& password,
					QString const& failPage = nullptr);
			void account();
			void setAccount(QString const& firstName,
					QString const& lastName,
					QString const& address1,
					QString const& address2,
					QString const& city,
					QString const& state,
					QString const& zip,
					QString const& email,
					QString const& phoneDay);
			void changePassword(QString const& passwordOld,
					QString const& password, QString const& verify);
			void logOut();

		signals:
			void created(QString const& response);
			void loggedIn(QString const& response);
			void setAccount(QString const& response);
			void gotAccount(QString const& response);
			void userNameChanged();
			void userNickChanged();
			void passwordChanged();
			void expirationChanged();
			void aclChanged();
			void modTimeChanged();
			void sNickNameChanged();
			void companyChanged();
			void fNameChanged();
			void lNameChanged();
			void address1Changed();
			void address2Changed();
			void address3Changed();
			void cityChanged();
			void stateChanged();
			void zipChanged();
			void countryChanged();
			void phoneDayChanged();
			void emailChanged();

		protected:
			void emitCreation(QString const& response);
			void emitLogin(QString const& response);
			void emitSetAccount(QString const& response);
			void emitAccount(QString const& response);

		private:
			QString m_userName;
			QString m_userNick;
			QString m_password;
			QString m_expiration;
			QString m_acl;
			QString m_modTime;
			QString m_sNickName;
			QString m_company;
			QString m_fName;
			QString m_lName;
			QString m_address1;
			QString m_address2;
			QString m_address3;
			QString m_city;
			QString m_state;
			QString m_zip;
			QString m_country;
			QString m_phoneDay;
			QString m_email;
			interchange_member* m_data;
	};

}

#endif