source: trunk/tools/shared/deviceskin/deviceskin.h@ 1054

Last change on this file since 1054 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 4.9 KB
RevLine 
[2]1/****************************************************************************
2**
[846]3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
[561]4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
[2]6**
7** This file is part of the tools applications of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
[561]24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
[2]27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
[561]36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
[2]38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef SKIN_H
43#define SKIN_H
44
45#include <QtGui/QWidget>
46#include <QtGui/QPolygon>
47#include <QtGui/QRegion>
48#include <QtGui/QPixmap>
49#include <QtCore/QVector>
50
51QT_BEGIN_NAMESPACE
52
53namespace qvfb_internal {
54 class CursorWindow;
55}
56
57class QTextStream;
58
59// ------- Button Area
60struct DeviceSkinButtonArea {
61 DeviceSkinButtonArea();
62 QString name;
63 int keyCode;
64 QPolygon area;
65 QString text;
66 bool activeWhenClosed;
67 bool toggleArea;
68 bool toggleActiveArea;
69};
70
71// -------- Parameters
72struct DeviceSkinParameters {
73 enum ReadMode { ReadAll, ReadSizeOnly };
74 bool read(const QString &skinDirectory, ReadMode rm, QString *errorMessage);
75 bool read(QTextStream &ts, ReadMode rm, QString *errorMessage);
76
77 QSize screenSize() const { return screenRect.size(); }
78 QSize secondaryScreenSize() const;
79 bool hasSecondaryScreen() const;
80
81 QString skinImageUpFileName;
82 QString skinImageDownFileName;
83 QString skinImageClosedFileName;
84 QString skinCursorFileName;
85
86 QImage skinImageUp;
87 QImage skinImageDown;
88 QImage skinImageClosed;
89 QImage skinCursor;
90
91 QRect screenRect;
92 QRect backScreenRect;
93 QRect closedScreenRect;
94 int screenDepth;
95 QPoint cursorHot;
96 QVector<DeviceSkinButtonArea> buttonAreas;
97 QList<int> toggleAreaList;
98
99 int joystick;
100 QString prefix;
101 bool hasMouseHover;
102};