~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to maliit-settings/settingsentry.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* * This file is part of Maliit framework *
2
 
 *
3
 
 * Copyright (C) 2012 Mattia Barbon <mattia@develer.com>
4
 
 *
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
9
 
 * of this file.
10
 
 */
11
 
 
12
 
#ifndef MALIIT_SETTINGSENTRY_H
13
 
#define MALIIT_SETTINGSENTRY_H
14
 
 
15
 
#include <QScopedPointer>
16
 
#include <QSharedPointer>
17
 
#include <QVariant>
18
 
#include <maliit/namespace.h>
19
 
 
20
 
class MImPluginSettingsEntry;
21
 
 
22
 
namespace Maliit {
23
 
 
24
 
class SettingsEntryPrivate;
25
 
class AttributeExtension;
26
 
 
27
 
 
28
 
/*!
29
 
 * \brief Configuration entry for an input method plugin
30
 
 */
31
 
class SettingsEntry : public QObject
32
 
{
33
 
    Q_OBJECT
34
 
 
35
 
public:
36
 
    virtual ~SettingsEntry();
37
 
 
38
 
    /*!
39
 
     * \brief Returns the current value of this item, as a QVariant.
40
 
     */
41
 
    QVariant value() const;
42
 
 
43
 
    /*!
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.
46
 
     */
47
 
    QVariant value(const QVariant &def) const;
48
 
 
49
 
    //! Sets a new value for this configuration entry
50
 
    void set(const QVariant &val);
51
 
 
52
 
    //! Checks whether \val is a valid value for this configuration entry
53
 
    bool isValid(const QVariant &val);
54
 
 
55
 
    QString key() const;
56
 
 
57
 
    //! Human-readable description for this configuration entry
58
 
    QString description() const;
59
 
 
60
 
    //! Value type for this configuration entry
61
 
    SettingEntryType type() const;
62
 
 
63
 
    /*!
64
 
     * \brief Metadata for this configuration entry; keys can be:
65
 
     *
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
70
 
     *
71
 
     * \sa Maliit::SettingEntryAttributes
72
 
     */
73
 
    QVariantMap attributes() const;
74
 
 
75
 
Q_SIGNALS:
76
 
    void valueChanged();
77
 
 
78
 
private:
79
 
    SettingsEntry(QSharedPointer<AttributeExtension> extension, const MImPluginSettingsEntry &info);
80
 
 
81
 
    Q_SLOT void valueChanged(const QString &key);
82
 
 
83
 
    QScopedPointer<SettingsEntryPrivate> d_ptr;
84
 
 
85
 
    Q_DISABLE_COPY(SettingsEntry)
86
 
    Q_DECLARE_PRIVATE(SettingsEntry)
87
 
 
88
 
    friend class PluginSettings;
89
 
};
90
 
 
91
 
}
92
 
 
93
 
#endif // MALIIT_SETTINGSENTRY_H