1 /*
2  * %kadu copyright begin%
3  * Copyright 2012 Piotr Dąbrowski (ultr@ultr.pl)
4  * Copyright 2011, 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/protocol-factory.h"
24 #include "status/status-adapter.h"
25 
26 #include <QtCore/QPointer>
27 #include <memory>
28 #include <injeqt/injeqt.h>
29 
30 class FacebookDepreceatedMessage;
31 class JabberProtocolMenuManager;
32 class PluginInjectedFactory;
33 
34 class JabberProtocolFactory : public ProtocolFactory
35 {
36 	Q_OBJECT
37 
38 public:
39 	Q_INVOKABLE explicit JabberProtocolFactory(QObject *parent = nullptr);
40 	virtual ~JabberProtocolFactory();
41 
42 	virtual Protocol * createProtocolHandler(Account account);
43 	virtual AccountDetails * createAccountDetails(AccountShared *accountShared);
44 	virtual AccountAddWidget * newAddAccountWidget(bool showButtons, QWidget *parent);
45 	virtual AccountCreateWidget * newCreateAccountWidget(bool showButtons, QWidget *parent);
46 	virtual AccountEditWidget* newEditAccountWidget(Account, QWidget*);
47 	virtual QWidget * newContactPersonalInfoWidget(Contact contact, QWidget *parent = nullptr);
48     virtual ProtocolMenuManager * protocolMenuManager();
49 	virtual QList<StatusType> supportedStatusTypes();
statusAdapter()50 	virtual StatusAdapter * statusAdapter() { return m_statusAdapter.get(); }
51 	virtual QString idLabel();
52 	virtual QValidator::State validateId(QString id);
53 	virtual bool canRegister();
54 
name()55 	virtual QString name() { return "jabber"; }
displayName()56 	virtual QString displayName() { return "Jabber/XMPP"; }
57 
58 	virtual KaduIcon icon();
59 
60 private:
61 	QPointer<FacebookDepreceatedMessage> m_facebookDepreceatedMessage;
62 	QPointer<JabberProtocolMenuManager> m_jabberProtocolMenuManager;
63 	QPointer<PluginInjectedFactory> m_pluginInjectedFactory;
64 
65 	QList<StatusType> m_supportedStatusTypes;
66 
67 	std::unique_ptr<StatusAdapter> m_statusAdapter;
68 
69 private slots:
70 	INJEQT_SET void setFacebookDepreceatedMessage(FacebookDepreceatedMessage *facebookDepreceatedMessage);
71 	INJEQT_SET void setJabberProtocolMenuManager(JabberProtocolMenuManager *jabberProtocolMenuManager);
72 	INJEQT_SET void setPluginInjectedFactory(PluginInjectedFactory *pluginInjectedFactory);
73 
74 };
75