1 /*
2  * %kadu copyright begin%
3  * Copyright 2014 Bartosz Brachaczek (b.brachaczek@gmail.com)
4  * Copyright 2011, 2012, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com)
5  * %kadu copyright end%
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #pragma once
22 
23 #include "protocols/services/contact-personal-info-service.h"
24 
25 #include <QtCore/QPointer>
26 #include <injeqt/injeqt.h>
27 
28 class BuddyStorage;
29 class JabberVCardService;
30 
31 class QXmppVCardIq;
32 
33 class JabberContactPersonalInfoService : public ContactPersonalInfoService
34 {
35 	Q_OBJECT
36 
37 public:
38 	explicit JabberContactPersonalInfoService(Account account, QObject *parent = nullptr);
39 	virtual ~JabberContactPersonalInfoService();
40 
41 	void setVCardService(JabberVCardService *vCardService);
42 
43 	virtual void fetchPersonalInfo(Contact contact);
44 
45 private:
46 	QPointer<BuddyStorage> m_buddyStorage;
47 	QPointer<JabberVCardService> VCardService;
48 	Buddy CurrentBuddy;
49 
50 private slots:
51 	INJEQT_SET void setBuddyStorage(BuddyStorage *buddyStorage);
52 
53 	void vCardDownloaded(bool ok, const QXmppVCardIq &vCard);
54 
55 };
56