summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/sms/serviceloader.cpp
blob: d242e30012a5592c3b9d9db99afb4e8c7a959b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*  *************************************************************************
    *   copyright: (C) 2003 Richard Lärkäng <nouseforaname@home.se>         *
    *   copyright: (C) 2003 Gav Wood <gav@kde.org>                          *
    *************************************************************************
*/

/*  *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#include "config.h"

#include <tdemessagebox.h>
#include <tdelocale.h>
#include <kdebug.h>

#include "serviceloader.h"
#include "smssend.h"
#include "smsclient.h"
#ifdef INCLUDE_SMSGSM
#	include "gsmlib.h"
#endif
#include "kopeteuiglobal.h"

SMSService* ServiceLoader::loadService(const TQString& name, Kopete::Account* account)
{
	kdWarning( 14160 ) << k_funcinfo << endl;

	SMSService* s;
	if (name == "SMSSend")
		s = new SMSSend(account);
	else if (name == "SMSClient")
		s = new SMSClient(account);
#ifdef INCLUDE_SMSGSM
	else if (name == "GSMLib")
		s = new GSMLib(account);
#endif
	else
	{
		KMessageBox::sorry(Kopete::UI::Global::mainWidget(), i18n("Could not load service %1.").arg(name),
			i18n("Error Loading Service"));
		s = 0L;
	}

	return s;
}

TQStringList ServiceLoader::services()
{
	TQStringList toReturn;
	toReturn.append("SMSSend");
	toReturn.append("SMSClient");
#ifdef INCLUDE_SMSGSM
	toReturn.append("GSMLib");
#endif	
	return toReturn;
}