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

« back to all changes in this revision

Viewing changes to src/maliit/plugins/keyoverride.h

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-01-31 13:26:48 UTC
  • Revision ID: package-import@ubuntu.com-20130131132648-w1u9d2279tppxcft
Tags: upstream-0.94.1
ImportĀ upstreamĀ versionĀ 0.94.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * This file is part of Maliit framework *
 
2
 *
 
3
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 
4
 * All rights reserved.
 
5
 *
 
6
 * Contact: maliit-discuss@lists.maliit.org
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License version 2.1 as published by the Free Software Foundation
 
11
 * and appearing in the file LICENSE.LGPL included in the packaging
 
12
 * of this file.
 
13
 */
 
14
 
 
15
 
 
16
 
 
17
#ifndef MKEYOVERRIDE_H
 
18
#define MKEYOVERRIDE_H
 
19
 
 
20
#include <QObject>
 
21
#include <QList>
 
22
#include <QString>
 
23
#include <QStringList>
 
24
 
 
25
class MKeyOverridePrivate;
 
26
 
 
27
/*! \ingroup maliitserver
 
28
 * \brief MKeyOverride is used to store key attribute overrides for virtual keyboard.
 
29
 */
 
30
class MKeyOverride : public QObject
 
31
{
 
32
    Q_OBJECT
 
33
    Q_PROPERTY(QString label  READ label    WRITE setLabel NOTIFY labelChanged)
 
34
    Q_PROPERTY(QString icon   READ icon    WRITE setIcon NOTIFY iconChanged)
 
35
    Q_PROPERTY(bool highlighted   READ highlighted WRITE setHighlighted NOTIFY highlightedChanged)
 
36
    Q_PROPERTY(bool enabled   READ enabled WRITE setEnabled NOTIFY enabledChanged)
 
37
 
 
38
public:
 
39
    //! Defines all the attributes of an key override.
 
40
    enum KeyOverrideAttribute {
 
41
        Label = 0x1,
 
42
        Icon  = 0x2,
 
43
        Highlighted = 0x4,
 
44
        Enabled = 0x8,
 
45
        All = Label | Icon | Highlighted | Enabled
 
46
    };
 
47
    Q_DECLARE_FLAGS(KeyOverrideAttributes, KeyOverrideAttribute)
 
48
 
 
49
    /*!
 
50
    * \brief Constructor
 
51
    */
 
52
    explicit MKeyOverride(const QString &keyId);
 
53
 
 
54
    /*!
 
55
     * \brief Copy constructor
 
56
     */
 
57
    MKeyOverride(const MKeyOverride&);
 
58
 
 
59
    /*!
 
60
    * \brief Destructor
 
61
    */
 
62
    virtual ~MKeyOverride();
 
63
 
 
64
    /*
 
65
     * \brief Assignment operator
 
66
     */
 
67
    const MKeyOverride &operator=(const MKeyOverride &other);
 
68
 
 
69
    /*!
 
70
     * \brief Returns the key id.
 
71
     */
 
72
    QString keyId() const;
 
73
 
 
74
    //! Returns text from the key
 
75
    QString label() const;
 
76
 
 
77
    //! Returns icon name
 
78
    QString icon() const;
 
79
 
 
80
    //! Return true if the key is highlighted; otherwise return false.
 
81
    bool highlighted() const;
 
82
 
 
83
    //! Return true if the key is enabled; otherwise return false.
 
84
    bool enabled() const;
 
85
 
 
86
public Q_SLOTS:
 
87
    //! Sets text for the key
 
88
    void setLabel(const QString &label);
 
89
 
 
90
    //! Sets icon name
 
91
    void setIcon(const QString &icon);
 
92
 
 
93
    /*!
 
94
     * \brief Set highlighted state for item
 
95
     *
 
96
     */
 
97
    void setHighlighted(bool highlighted);
 
98
 
 
99
    /*!
 
100
     * \brief  If \a enabled is true, the key is enabled; otherwise, it is disabled.
 
101
     *
 
102
     */
 
103
    void setEnabled(bool enabled);
 
104
 
 
105
Q_SIGNALS:
 
106
    /*!
 
107
     * \brief Emitted when some attributes of the key are changed.
 
108
     *
 
109
     * This signal is emitted after attribute specific signal.
 
110
     *
 
111
     * \param keyId, the key id.
 
112
     * \param changedAttributes Specifies the changed attributes. \sa KeyOverrideAttribute
 
113
     */
 
114
    void keyAttributesChanged(const QString &keyId, const MKeyOverride::KeyOverrideAttributes changedAttributes);
 
115
 
 
116
    /*!
 
117
     * \brief Emitted when label is changed.
 
118
     *
 
119
     * This signal is emitted before keyAttributesChanged signal.
 
120
     */
 
121
    void labelChanged(const QString &label);
 
122
 
 
123
    /*!
 
124
     * \brief Emitted when icon is changed.
 
125
     *
 
126
     * This signal is emitted before keyAttributesChanged signal.
 
127
     */
 
128
    void iconChanged(const QString &icon);
 
129
 
 
130
    /*!
 
131
     * \brief Emitted when highlighted is changed.
 
132
     *
 
133
     * This signal is emitted before keyAttributesChanged signal.
 
134
     */
 
135
    void highlightedChanged(bool highlighted);
 
136
 
 
137
    /*!
 
138
     * \brief Emitted when enabled is changed.
 
139
     *
 
140
     * This signal is emitted before keyAttributesChanged signal.
 
141
     */
 
142
    void enabledChanged(bool enabled);
 
143
 
 
144
private:
 
145
    Q_DECLARE_PRIVATE(MKeyOverride)
 
146
 
 
147
    MKeyOverridePrivate *const d_ptr;
 
148
 
 
149
    friend class Ut_MKeyOverride;
 
150
};
 
151
 
 
152
 
 
153
#endif