2
* Copyright (C) 2013 Canonical, Ltd.
4
* Redistribution and use in source and binary forms, with or without modification,
5
* are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright notice, this list
8
* of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright notice, this list
10
* of conditions and the following disclaimer in the documentation and/or other materials
11
* provided with the distribution.
12
* Neither the name of Nokia Corporation nor the names of its contributors may be
13
* used to endorse or promote products derived from this software without specific
14
* prior written permission.
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
17
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
19
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
#ifndef KEYBOARDGEOMETRY_H
29
#define KEYBOARDGEOMETRY_H
34
//! \brief The KeyboardGeometry class hold the geometry of the QML keyboard
36
class KeyboardGeometry : public QObject
39
Q_PROPERTY(int keypadHeight READ keypadHeight NOTIFY keypadHeightChanged)
40
Q_PROPERTY(int canvasHeight READ canvasHeight NOTIFY canvasHeightChanged)
41
Q_PROPERTY(QRectF visibleRect READ visibleRect WRITE setVisibleRect NOTIFY visibleRectChanged)
42
Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
43
Q_PROPERTY(bool shown READ shown WRITE setShown NOTIFY shownChanged)
46
explicit KeyboardGeometry(QObject *parent = 0);
48
int keypadHeight() const;
49
void setKeypadHeight(int height);
51
int canvasHeight() const;
52
void setCanvasHeight(int height);
54
const QRectF &visibleRect() const;
55
Q_SLOT void setVisibleRect(const QRectF &rect);
57
Qt::ScreenOrientation orientation() const;
58
void setOrientation(Qt::ScreenOrientation orient);
61
Q_SLOT void setShown(bool show);
64
void keypadHeightChanged();
65
void canvasHeightChanged();
66
void visibleRectChanged();
67
void orientationChanged();
74
Qt::ScreenOrientation m_orientation;
78
#endif // KEYBOARDGEOMETRY_H