haze-account-ui-plugin.cpp 3.6 KB
Newer Older
1 2 3
/*
 * This file is part of telepathy-accounts-kcm
 *
4
 * Copyright (C) 2011 Dominik Schmidt <kde@dominik-schmidt.de>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "haze-account-ui-plugin.h"

Lasath Fernando's avatar
Lasath Fernando committed
23
#include "haze-icq-account.h"
Björn Bidar's avatar
Björn Bidar committed
24
#include "haze-skypeweb-account.h"
25
#include "haze-myspaceim-account-ui.h"
26
#include "haze-skype-account-ui.h"
Lasath Fernando's avatar
Lasath Fernando committed
27
#include "haze-yahoo-account.h"
28
#include "haze-aim-account.h"
Francesco Nwokeka's avatar
Francesco Nwokeka committed
29
#include "haze-msn-account.h"
30
#include "haze-groupwise-account.h"
31
#include "haze-steam-account.h"
32
#include "haze-sipe-account.h"
33

34
#include <KPluginFactory>
35 36 37 38

#include <QtCore/QVariantList>

HazeAccountUiPlugin::HazeAccountUiPlugin(QObject *parent, const QVariantList &)
39
 : AbstractAccountUiPlugin(parent)
40 41
{
    // Register supported cm/protocol combinations
42 43 44 45 46 47
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("icq"));
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("myspace"));
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("bigbrownchunx-skype-dbus"));
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("yahoo"));
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("aim"));
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("msn"));
48
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("groupwise"));
49
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("steam-mobile"));
50
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("sipe"));
Björn Bidar's avatar
Björn Bidar committed
51
    registerProvidedProtocol(QLatin1String("haze"), QLatin1String("skypeweb"));
52 53 54 55 56 57
}

HazeAccountUiPlugin::~HazeAccountUiPlugin()
{
}

58
AbstractAccountUi* HazeAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName)
59
{
60 61
    Q_UNUSED(serviceName);

62 63
    if (connectionManager == QLatin1String("haze")) {
        if (protocol == QLatin1String("icq")) {
Francesco Nwokeka's avatar
Francesco Nwokeka committed
64
            return new HazeIcqAccountUi;
Björn Bidar's avatar
Björn Bidar committed
65 66
        } else if (protocol == QLatin1String("skypeweb")) {
            return new HazeSkypeWebAccountUi;
Francesco Nwokeka's avatar
Francesco Nwokeka committed
67 68 69 70 71 72 73 74 75 76
        } else if (protocol == QLatin1String("myspace")) {
            return new HazeMySpaceIMAccountUi;
        } else if (protocol == QLatin1String("bigbrownchunx-skype-dbus")) {
            return new HazeSkypeAccountUi;
        } else if (protocol == QLatin1String("yahoo")) {
            return new HazeYahooAccount;
        } else if (protocol == QLatin1String("aim")) {
            return new HazeAimAccount;
        } else if (protocol == QLatin1String("msn")) {
            return new HazeMsnAccountUi;
77 78
        } else if (protocol == QLatin1String("groupwise")) {
            return new HazeGroupWiseAccountUi;
79 80
        } else if (protocol == QLatin1String("steam-mobile")) {
            return new HazeSteamAccountUi;
81 82 83
        } else if (protocol == QLatin1String("sipe")) {
            return new HazeSipeAccountUi;
        }
Lasath Fernando's avatar
Lasath Fernando committed
84
    }
85 86 87 88 89

    return 0;
}


90
K_PLUGIN_FACTORY(factory, registerPlugin<HazeAccountUiPlugin>();)
91 92

#include "haze-account-ui-plugin.moc"