1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
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
17
#ifndef MKEYOVERRIDE_H
18
#define MKEYOVERRIDE_H
23
#include <QStringList>
25
class MKeyOverridePrivate;
27
/*! \ingroup maliitserver
28
* \brief MKeyOverride is used to store key attribute overrides for virtual keyboard.
30
class MKeyOverride : public QObject
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)
39
//! Defines all the attributes of an key override.
40
enum KeyOverrideAttribute {
45
All = Label | Icon | Highlighted | Enabled
47
Q_DECLARE_FLAGS(KeyOverrideAttributes, KeyOverrideAttribute)
52
explicit MKeyOverride(const QString &keyId);
55
* \brief Copy constructor
57
MKeyOverride(const MKeyOverride&);
62
virtual ~MKeyOverride();
65
* \brief Assignment operator
67
const MKeyOverride &operator=(const MKeyOverride &other);
70
* \brief Returns the key id.
72
QString keyId() const;
74
//! Returns text from the key
75
QString label() const;
80
//! Return true if the key is highlighted; otherwise return false.
81
bool highlighted() const;
83
//! Return true if the key is enabled; otherwise return false.
87
//! Sets text for the key
88
void setLabel(const QString &label);
91
void setIcon(const QString &icon);
94
* \brief Set highlighted state for item
97
void setHighlighted(bool highlighted);
100
* \brief If \a enabled is true, the key is enabled; otherwise, it is disabled.
103
void setEnabled(bool enabled);
107
* \brief Emitted when some attributes of the key are changed.
109
* This signal is emitted after attribute specific signal.
111
* \param keyId, the key id.
112
* \param changedAttributes Specifies the changed attributes. \sa KeyOverrideAttribute
114
void keyAttributesChanged(const QString &keyId, const MKeyOverride::KeyOverrideAttributes changedAttributes);
117
* \brief Emitted when label is changed.
119
* This signal is emitted before keyAttributesChanged signal.
121
void labelChanged(const QString &label);
124
* \brief Emitted when icon is changed.
126
* This signal is emitted before keyAttributesChanged signal.
128
void iconChanged(const QString &icon);
131
* \brief Emitted when highlighted is changed.
133
* This signal is emitted before keyAttributesChanged signal.
135
void highlightedChanged(bool highlighted);
138
* \brief Emitted when enabled is changed.
140
* This signal is emitted before keyAttributesChanged signal.
142
void enabledChanged(bool enabled);
145
Q_DECLARE_PRIVATE(MKeyOverride)
147
MKeyOverridePrivate *const d_ptr;
149
friend class Ut_MKeyOverride;