1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef QDECLARATIVESYSTEMPALETTE_H
43 #define QDECLARATIVESYSTEMPALETTE_H
45 #include <qdeclarative.h>
47 #include <QtCore/qobject.h>
54 QT_MODULE(Declarative)
56 class QDeclarativeSystemPalettePrivate;
57 class Q_AUTOTEST_EXPORT QDeclarativeSystemPalette : public QObject
61 Q_DECLARE_PRIVATE(QDeclarativeSystemPalette)
63 Q_PROPERTY(QDeclarativeSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
64 Q_PROPERTY(QColor window READ window NOTIFY paletteChanged)
65 Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged)
66 Q_PROPERTY(QColor base READ base NOTIFY paletteChanged)
67 Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
68 Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged)
69 Q_PROPERTY(QColor button READ button NOTIFY paletteChanged)
70 Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged)
71 Q_PROPERTY(QColor light READ light NOTIFY paletteChanged)
72 Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged)
73 Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged)
74 Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged)
75 Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged)
76 Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged)
77 Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged)
80 QDeclarativeSystemPalette(QObject *parent=0);
81 ~QDeclarativeSystemPalette();
83 enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled };
85 QColor window() const;
86 QColor windowText() const;
90 QColor alternateBase() const;
92 QColor button() const;
93 QColor buttonText() const;
96 QColor midlight() const;
99 QColor shadow() const;
101 QColor highlight() const;
102 QColor highlightedText() const;
104 QDeclarativeSystemPalette::ColorGroup colorGroup() const;
105 void setColorGroup(QDeclarativeSystemPalette::ColorGroup);
108 void paletteChanged();
111 bool eventFilter(QObject *watched, QEvent *event);
112 bool event(QEvent *event);
118 QML_DECLARE_TYPE(QDeclarativeSystemPalette)
122 #endif // QDECLARATIVESYSTEMPALETTE_H