comparison contact.h @ 7:017925589d4c

Contact (formerly ContactT) now use shared data
author Goffi <goffi@goffi.org>
date Sun, 14 Aug 2011 18:03:54 +0200
parents 48045176d1c6
children
comparison
equal deleted inserted replaced
6:48045176d1c6 7:017925589d4c
17 */ 17 */
18 18
19 #ifndef CONTACT_H 19 #ifndef CONTACT_H
20 #define CONTACT_H 20 #define CONTACT_H
21 21
22 #include <QtGui> 22 #include <QSharedData>
23 #include <QString>
24 #include <QHash>
25 #include <QList>
23 #include "jid.h" 26 #include "jid.h"
24 27
25 class ContactT { 28 class ContactData: public QSharedData
29 {
26 public: 30 public:
27 ContactT(); 31 ContactData();
28 ~ContactT(); 32 ContactData(const ContactData& other);
33
34 Jid jid;
29 QList<QString> groups; 35 QList<QString> groups;
30 Jid jid;
31 void setProfile(const QString& profile);
32 const QString& getProfile() const;
33 void setAttributes(const QHash<QString, QString>& attr);
34 QHash<QString, QString> getAttributes() const;
35 const QString& getName() const;
36
37 bool isConnected();
38
39
40 private:
41 bool m_connected; 36 bool m_connected;
42 bool m_presence_to, m_presence_from, m_presence_ask; 37 bool m_presence_to, m_presence_from, m_presence_ask;
43 QString m_profile, m_name; 38 QString m_profile, m_name;
44 39
45 40
46 }; 41 };
47 42
43 class Contact {
44 public:
45 Contact();
46 Contact(const Contact &other);
47
48 Jid& getJid();
49 const Jid& getJid() const;
50 QList<QString>& getGroups();
51 const QList<QString>& getGroups() const;
52 void setProfile(const QString& profile);
53 const QString& getProfile() const;
54 void setAttributes(const QHash<QString, QString>& attr);
55 QHash<QString, QString> getAttributes() const;
56 const QString& getName() const;
57 void setName(const QString& name);
58 bool isConnected();
59
60 private:
61 QExplicitlySharedDataPointer<ContactData> d;
62 };
63
48 64
49 #endif 65 #endif