summaryrefslogtreecommitdiff
path: root/metawatchwatchlets/metawatchwatchletsplugin.cpp
blob: 98c17136b0e7e10797eee1c8d3c986069dfdcfb4 (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
#include "metawatchfacewatchlet.h"
#include "metawatchnotificationwatchlet.h"
#include "metawatchwatchletsplugin.h"

using namespace sowatch;

MetaWatchWatchletsPlugin::MetaWatchWatchletsPlugin(QObject *parent) :
    QObject(parent)
{
}

MetaWatchWatchletsPlugin::~MetaWatchWatchletsPlugin()
{
}

QStringList MetaWatchWatchletsPlugin::watchlets()
{
	QStringList l;
	l << MetaWatchFaceWatchlet::myId << MetaWatchNotificationWatchlet::myId;
	return l;
}

WatchletPluginInterface::WatchletInfo MetaWatchWatchletsPlugin::describeWatchlet(const QString &id)
{
	WatchletInfo info;
	if (id == MetaWatchFaceWatchlet::myId) {
		info.name = "MetaWatch Face Watchlet";
		info.hidden = true;
	} else if (id == MetaWatchNotificationWatchlet::myId) {
		info.name = "MetaWatch Notification Watchlet";
		info.hidden = true;
	}
	return info;
}

Watchlet* MetaWatchWatchletsPlugin::getWatchlet(const QString& id, ConfigKey *settings, Watch *watch)
{
	Q_UNUSED(settings);
	if (id == MetaWatchFaceWatchlet::myId) {
		return new MetaWatchFaceWatchlet(watch);
	} else if (id == MetaWatchNotificationWatchlet::myId) {
		return new MetaWatchNotificationWatchlet(watch);
	}
}

Q_EXPORT_PLUGIN2(notificationswatchlet, MetaWatchWatchletsPlugin)