1
/****************************************************************************
3
** Copyright (C) 2009 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 QtGui 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 QDECORATION_QWS_H
43
#define QDECORATION_QWS_H
45
#include <QtGui/qregion.h>
46
#include <QtGui/qwidget.h>
47
#include <QtGui/qaction.h>
59
class QDecorationAction : public QAction
62
QDecorationAction(const QString &text, QObject* parent, int region)
63
: QAction(text, parent), reg(region) {}
66
#endif // QT_NO_ACTION
69
Implements decoration styles
71
class Q_GUI_EXPORT QDecoration
75
virtual ~QDecoration() {}
77
/* AABBBBBBBBBBCC Items in DecorationRegion:
79
A C A = TopLeft B = Top C = TopRight
80
D E D = Left E = Right
81
D E F = BottomLeft H = Bottom G = BottomRight
82
F G i = Menu j = Title k = Help
83
FFHHHHHHHHHHGG l = Minimize m = Maximize n = Close
87
enum DecorationRegion {
88
None = 0x0000000000, All = 0x7fffffff,
89
TopLeft = 0x0000000001, Top = 0x0000000002, TopRight = 0x0000000004,
90
Left = 0x0000000008, Right = 0x0000000010,
91
BottomLeft = 0x0000000020, Bottom = 0x0000000040, BottomRight = 0x0000000080,
92
Borders = 0x00000000ff,
93
Menu = 0x0000000100, Title = 0x0000000200, Help = 0x0000000400,
94
Minimize = 0x0000000800, Maximize = 0x0000001000, Normalize = 0x0000002000,
95
Close = 0x0000004000, Move = 0x0000008000, Resize = 0x0000010000
98
enum DecorationState { Normal = 0x04, Disabled = 0x08, Hover = 0x01, Pressed = 0x02 };
100
virtual QRegion region(const QWidget *w, const QRect &rect, int decorationRegion = All ) = 0;
101
QRegion region(const QWidget *w, int decorationRegion = All )
102
{ return region(w, w->rect(), decorationRegion); }
103
virtual int regionAt(const QWidget *w, const QPoint &point);
105
virtual void regionClicked(QWidget *widget, int region);
106
virtual void regionDoubleClicked(QWidget *widget, int region);
108
virtual void buildSysMenu(QWidget *widget, QMenu *menu);
109
void menuTriggered(QWidget *widget, QAction *action);
112
static void startMove(QWidget *widget);
113
static void startResize(QWidget *widget);
115
virtual bool paint(QPainter *p, const QWidget *w, int decorationRegion = All,
116
DecorationState state = Normal) = 0;
124
#endif // QDECORATION_QWS_H