Mercurial > bellaciao
annotate contact.h @ 9:0d7875c26974
layout designer: hints on widget placement during drag and drop
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 26 Aug 2011 12:15:21 +0200 |
parents | 017925589d4c |
children |
rev | line source |
---|---|
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 /* |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 Bellaciao: a Salut à Toi frontend |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 it under the terms of the GNU Affero General Public License as published by |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 the Free Software Foundation, either version 3 of the License, or |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 (at your option) any later version. |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 GNU Affero General Public License for more details. |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Affero General Public License |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 */ |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 #ifndef CONTACT_H |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 #define CONTACT_H |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 |
7
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
22 #include <QSharedData> |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
23 #include <QString> |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
24 #include <QHash> |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
25 #include <QList> |
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
26 #include "jid.h" |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
27 |
7
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
28 class ContactData: public QSharedData |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
29 { |
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
30 public: |
7
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
31 ContactData(); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
32 ContactData(const ContactData& other); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
33 |
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 Jid jid; |
7
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
35 QList<QString> groups; |
6 | 36 bool m_connected; |
37 bool m_presence_to, m_presence_from, m_presence_ask; | |
38 QString m_profile, m_name; | |
39 | |
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
40 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
41 }; |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
42 |
7
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
43 class Contact { |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
44 public: |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
45 Contact(); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
46 Contact(const Contact &other); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
47 |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
48 Jid& getJid(); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
49 const Jid& getJid() const; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
50 QList<QString>& getGroups(); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
51 const QList<QString>& getGroups() const; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
52 void setProfile(const QString& profile); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
53 const QString& getProfile() const; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
54 void setAttributes(const QHash<QString, QString>& attr); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
55 QHash<QString, QString> getAttributes() const; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
56 const QString& getName() const; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
57 void setName(const QString& name); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
58 bool isConnected(); |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
59 |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
60 private: |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
61 QExplicitlySharedDataPointer<ContactData> d; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
62 }; |
017925589d4c
Contact (formerly ContactT) now use shared data
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
63 |
4
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
64 |
220e5619bf87
Profiles selection now fill contact list + new Jid class
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
65 #endif |