libqutim  0.3.1.0
rosterstorage.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef ROSTERSTORAGE_H
27 #define ROSTERSTORAGE_H
28 
29 #include "libqutim_global.h"
30 #include <QVariantMap>
31 
32 namespace qutim_sdk_0_3
33 {
34 class RosterStoragePrivate;
35 class Contact;
36 class Account;
37 
39 {
40 public:
41  virtual ~ContactsFactory();
42 
43  virtual Contact *addContact(const QString &id, const QVariantMap &data) = 0;
44  virtual void serialize(Contact *contact, QVariantMap &data) = 0;
45 };
46 
47 class LIBQUTIM_EXPORT RosterStorage : public QObject
48 {
49  Q_OBJECT
50  Q_DECLARE_PRIVATE(RosterStorage)
51  Q_CLASSINFO("Service", "RosterStorage")
52 public:
53  static RosterStorage *instance();
54 
55  virtual QString load(Account *account) = 0;
56  virtual void addContact(Contact *contact, const QString &version = QString()) = 0;
57  virtual void updateContact(Contact *contact, const QString &version = QString()) = 0;
58  virtual void removeContact(Contact *contact, const QString &version = QString()) = 0;
59 protected:
60  RosterStorage();
61  virtual ~RosterStorage();
62 private:
63  QScopedPointer<RosterStoragePrivate> d_ptr;
64 };
65 }
66 
67 Q_DECLARE_INTERFACE(qutim_sdk_0_3::ContactsFactory, "org.qutim.ContactsFactory")
68 
69 #endif // ROSTERSTORAGE_H
70 

Generated by Doxygen