Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / quick / items / qquickanchors_p.h
1 // Commit: 2c7cab4172f1acc86fd49345a2847417e162f2c3
2 /****************************************************************************
3 **
4 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
5 ** Contact: http://www.qt-project.org/
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 **
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
29 **
30 ** Other Usage
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
33 **
34 **
35 **
36 **
37 **
38 **
39 ** $QT_END_LICENSE$
40 **
41 ****************************************************************************/
42
43 #ifndef QQUICKANCHORS_P_H
44 #define QQUICKANCHORS_P_H
45
46 #include <qdeclarative.h>
47
48 #include <QtCore/QObject>
49
50 #include <private/qtquickglobal_p.h>
51
52 QT_BEGIN_HEADER
53
54 QT_BEGIN_NAMESPACE
55
56 class QQuickItem;
57 class QQuickAnchorsPrivate;
58 class QQuickAnchorLine;
59 class Q_QUICK_PRIVATE_EXPORT QQuickAnchors : public QObject
60 {
61     Q_OBJECT
62
63     Q_PROPERTY(QQuickAnchorLine left READ left WRITE setLeft RESET resetLeft NOTIFY leftChanged)
64     Q_PROPERTY(QQuickAnchorLine right READ right WRITE setRight RESET resetRight NOTIFY rightChanged)
65     Q_PROPERTY(QQuickAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter NOTIFY horizontalCenterChanged)
66     Q_PROPERTY(QQuickAnchorLine top READ top WRITE setTop RESET resetTop NOTIFY topChanged)
67     Q_PROPERTY(QQuickAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom NOTIFY bottomChanged)
68     Q_PROPERTY(QQuickAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter NOTIFY verticalCenterChanged)
69     Q_PROPERTY(QQuickAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline NOTIFY baselineChanged)
70     Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
71     Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
72     Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
73     Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged)
74     Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
75     Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
76     Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged)
77     Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
78     Q_PROPERTY(QQuickItem *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
79     Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
80     Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged)
81
82 public:
83     QQuickAnchors(QQuickItem *item, QObject *parent=0);
84     virtual ~QQuickAnchors();
85
86     enum Anchor {
87         LeftAnchor = 0x01,
88         RightAnchor = 0x02,
89         TopAnchor = 0x04,
90         BottomAnchor = 0x08,
91         HCenterAnchor = 0x10,
92         VCenterAnchor = 0x20,
93         BaselineAnchor = 0x40,
94         Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
95         Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
96     };
97     Q_DECLARE_FLAGS(Anchors, Anchor)
98
99     QQuickAnchorLine left() const;
100     void setLeft(const QQuickAnchorLine &edge);
101     void resetLeft();
102
103     QQuickAnchorLine right() const;
104     void setRight(const QQuickAnchorLine &edge);
105     void resetRight();
106
107     QQuickAnchorLine horizontalCenter() const;
108     void setHorizontalCenter(const QQuickAnchorLine &edge);
109     void resetHorizontalCenter();
110
111     QQuickAnchorLine top() const;
112     void setTop(const QQuickAnchorLine &edge);
113     void resetTop();
114
115     QQuickAnchorLine bottom() const;
116     void setBottom(const QQuickAnchorLine &edge);
117     void resetBottom();
118
119     QQuickAnchorLine verticalCenter() const;
120     void setVerticalCenter(const QQuickAnchorLine &edge);
121     void resetVerticalCenter();
122
123     QQuickAnchorLine baseline() const;
124     void setBaseline(const QQuickAnchorLine &edge);
125     void resetBaseline();
126
127     qreal leftMargin() const;
128     void setLeftMargin(qreal);
129
130     qreal rightMargin() const;
131     void setRightMargin(qreal);
132
133     qreal horizontalCenterOffset() const;
134     void setHorizontalCenterOffset(qreal);
135
136     qreal topMargin() const;
137     void setTopMargin(qreal);
138
139     qreal bottomMargin() const;
140     void setBottomMargin(qreal);
141
142     qreal margins() const;
143     void setMargins(qreal);
144
145     qreal verticalCenterOffset() const;
146     void setVerticalCenterOffset(qreal);
147
148     qreal baselineOffset() const;
149     void setBaselineOffset(qreal);
150
151     QQuickItem *fill() const;
152     void setFill(QQuickItem *);
153     void resetFill();
154
155     QQuickItem *centerIn() const;
156     void setCenterIn(QQuickItem *);
157     void resetCenterIn();
158
159     Anchors usedAnchors() const;
160
161     bool mirrored();
162
163     void classBegin();
164     void componentComplete();
165
166 Q_SIGNALS:
167     void leftChanged();
168     void rightChanged();
169     void topChanged();
170     void bottomChanged();
171     void verticalCenterChanged();
172     void horizontalCenterChanged();
173     void baselineChanged();
174     void fillChanged();
175     void centerInChanged();
176     void leftMarginChanged();
177     void rightMarginChanged();
178     void topMarginChanged();
179     void bottomMarginChanged();
180     void marginsChanged();
181     void verticalCenterOffsetChanged();
182     void horizontalCenterOffsetChanged();
183     void baselineOffsetChanged();
184     void mirroredChanged();
185
186 private:
187     friend class QQuickItemPrivate;
188     Q_DISABLE_COPY(QQuickAnchors)
189     Q_DECLARE_PRIVATE(QQuickAnchors)
190 };
191 Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAnchors::Anchors)
192
193 QT_END_NAMESPACE
194
195 QML_DECLARE_TYPE(QQuickAnchors)
196
197 QT_END_HEADER
198
199 #endif // QQUICKANCHORS_P_H