1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2012 Mattia Barbon <mattia@develer.com>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License version 2.1 as published by the Free Software Foundation
8
* and appearing in the file LICENSE.LGPL included in the packaging
12
#ifndef MALIIT_SETTINGSMANAGER_H
13
#define MALIIT_SETTINGSMANAGER_H
15
#include <QScopedPointer>
16
#include <QSharedPointer>
19
class MImServerConnection;
20
class MImPluginSettingsInfo;
24
class SettingsManagerPrivate;
26
class AttributeExtension;
30
* \brief Entry point to the settings API
32
* Retrieves the list of server/plugin settings from maliit-server
34
class SettingsManager : public QObject
40
* \brief Creates a new settings instance,
42
* Uses QT_IM_MODULE to determine the connection type (direct, DBus, ...) to maliit-server
44
static SettingsManager *create(QObject *parent = 0);
46
virtual ~SettingsManager();
48
//! Request the list of settings from maliit-server
49
Q_SLOT void loadPluginSettings() const;
51
//! Sets the preferred locale for human-readable description
52
static void setPreferredDescriptionLocale(const QString &localeName);
54
//! Gets the preferred locale for human-readable description
55
static QString preferredDescriptionLocale();
58
//! Emitted after \a loadPluginSettings() and when the plugin list changes on the server.
59
void pluginSettingsReceived(const QList<QSharedPointer<Maliit::PluginSettings> > &settings);
65
SettingsManager(QSharedPointer<MImServerConnection> connection, QObject *parent);
67
Q_SLOT void onPluginSettingsReceived(const QList<MImPluginSettingsInfo> &settings);
69
static QString preferred_description_locale;
71
QScopedPointer<SettingsManagerPrivate> d_ptr;
73
Q_DISABLE_COPY(SettingsManager)
74
Q_DECLARE_PRIVATE(SettingsManager)
79
#endif // MALIIT_SETTINGSMANAGER_H