summaryrefslogtreecommitdiff
path: root/qmsgwatchlet/qmsgwatchletplugin.cpp
blob: f919138fa2b534c4a5b6f7182b0d25f6c2cd153e (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
#include "qmsgwatchlet.h"
#include "qmsgwatchletplugin.h"

#include <QtMessaging/QMessageManager>

using namespace sowatch;
QTM_USE_NAMESPACE

QMsgWatchletPlugin::QMsgWatchletPlugin(QObject *parent) :
    QObject(parent)
{
	qRegisterMetaType<QMessageManager::NotificationFilterIdSet>("QMessageManager::NotificationFilterIdSet");
}

QMsgWatchletPlugin::~QMsgWatchletPlugin()
{
}

QStringList QMsgWatchletPlugin::watchlets()
{
	QStringList l;
	l << "com.javispedro.sowatch.qmsg";
	return l;
}

WatchletPluginInterface::WatchletInfo QMsgWatchletPlugin::describeWatchlet(const QString &id, const QString &watchModel)
{
	WatchletInfo info;
	if (id != "com.javispedro.sowatch.qmsg") return info;
	info.name = "Inbox";
	info.icon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/qmsgwatchlet/" + watchModel + "-icon.png");
	info.phoneIcon = QUrl::fromLocalFile(SOWATCH_QML_DIR "/qmsgwatchlet/icon.png");
	info.visible = true;
	return info;
}

Watchlet* QMsgWatchletPlugin::getWatchlet(const QString &id, ConfigKey *config, Watch *watch)
{
	Q_UNUSED(config);
	if (id != "com.javispedro.sowatch.qmsg") return 0;
	return new QMsgWatchlet(watch);
}

Q_EXPORT_PLUGIN2(qmsgwatchlet, QMsgWatchletPlugin)