-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontacts.h
59 lines (47 loc) · 1.23 KB
/
contacts.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
#ifndef CONTACTS_H
#define CONTACTS_H
#include <QObject>
#include "contactmodel.h"
class Contacts : public QObject
{
Q_OBJECT
Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged)
Q_PROPERTY(int errorCode READ errorCode WRITE setErrorCode NOTIFY errorCodeChanged)
public:
explicit Contacts(QObject *parent = 0);
QList<ContactModel*> getContacts();
QString errorString() const
{
return m_errorString;
}
int errorCode() const
{
return m_errorCode;
}
private:
QList<ContactModel*> m_contactsList;
QString m_errorString;
int m_errorCode;
signals:
void contactsRetrieved(QList<ContactModel*>);
void error();
void errorStringChanged(QString errorString);
void errorCodeChanged(int errorCode);
public slots:
void nativeDataRetrieveCompleteWithList(QList<ContactModel*>);
void setErrorString(QString errorString)
{
if (m_errorString == errorString)
return;
m_errorString = errorString;
emit errorStringChanged(errorString);
}
void setErrorCode(int errorCode)
{
if (m_errorCode == errorCode)
return;
m_errorCode = errorCode;
emit errorCodeChanged(errorCode);
}
};
#endif // CONTACTS_H