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_SETTINGSENTRY_H
13
#define MALIIT_SETTINGSENTRY_H
15
#include <QScopedPointer>
16
#include <QSharedPointer>
18
#include <maliit/namespace.h>
20
class MImPluginSettingsEntry;
24
class SettingsEntryPrivate;
25
class AttributeExtension;
29
* \brief Configuration entry for an input method plugin
31
class SettingsEntry : public QObject
36
virtual ~SettingsEntry();
39
* \brief Returns the current value of this item, as a QVariant.
41
QVariant value() const;
44
* \brief Returns the current value of this item, as a QVariant. If
45
* there is no value for this item, return \a def instead.
47
QVariant value(const QVariant &def) const;
49
//! Sets a new value for this configuration entry
50
void set(const QVariant &val);
52
//! Checks whether \val is a valid value for this configuration entry
53
bool isValid(const QVariant &val);
57
//! Human-readable description for this configuration entry
58
QString description() const;
60
//! Value type for this configuration entry
61
SettingEntryType type() const;
64
* \brief Metadata for this configuration entry; keys can be:
66
* - valueDomain: list of allowed values for the entry
67
* - valueDomainDescriptions: list of descriptions for the values in valueDomain
68
* - valueRangeMin: minimum integer value (inclusive) for the entry
69
* - valueRangeMax: maximum integer value (inclusive) for the entry
71
* \sa Maliit::SettingEntryAttributes
73
QVariantMap attributes() const;
79
SettingsEntry(QSharedPointer<AttributeExtension> extension, const MImPluginSettingsEntry &info);
81
Q_SLOT void valueChanged(const QString &key);
83
QScopedPointer<SettingsEntryPrivate> d_ptr;
85
Q_DISABLE_COPY(SettingsEntry)
86
Q_DECLARE_PRIVATE(SettingsEntry)
88
friend class PluginSettings;
93
#endif // MALIIT_SETTINGSENTRY_H