1 // Commit: 2c7cab4172f1acc86fd49345a2847417e162f2c3
2 /****************************************************************************
4 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
5 ** All rights reserved.
6 ** Contact: http://www.qt-project.org/
8 ** This file is part of the QtDeclarative module of the Qt Toolkit.
10 ** $QT_BEGIN_LICENSE:LGPL$
11 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this
15 ** file. Please review the following information to ensure the GNU Lesser
16 ** General Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
23 ** GNU General Public License Usage
24 ** Alternatively, this file may be used under the terms of the GNU General
25 ** Public License version 3.0 as published by the Free Software Foundation
26 ** and appearing in the file LICENSE.GPL included in the packaging of this
27 ** file. Please review the following information to ensure the GNU General
28 ** Public License version 3.0 requirements will be met:
29 ** http://www.gnu.org/copyleft/gpl.html.
32 ** Alternatively, this file may be used in accordance with the terms and
33 ** conditions contained in a signed written agreement between you and Nokia.
41 ****************************************************************************/
43 #ifndef QQUICKANCHORS_P_H
44 #define QQUICKANCHORS_P_H
46 #include <qdeclarative.h>
48 #include <QtCore/QObject>
50 #include <private/qtquickglobal_p.h>
57 class QQuickAnchorsPrivate;
58 class QQuickAnchorLine;
59 class Q_QUICK_PRIVATE_EXPORT QQuickAnchors : public QObject
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)
83 QQuickAnchors(QQuickItem *item, QObject *parent=0);
84 virtual ~QQuickAnchors();
93 BaselineAnchor = 0x40,
94 Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
95 Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
97 Q_DECLARE_FLAGS(Anchors, Anchor)
99 QQuickAnchorLine left() const;
100 void setLeft(const QQuickAnchorLine &edge);
103 QQuickAnchorLine right() const;
104 void setRight(const QQuickAnchorLine &edge);
107 QQuickAnchorLine horizontalCenter() const;
108 void setHorizontalCenter(const QQuickAnchorLine &edge);
109 void resetHorizontalCenter();
111 QQuickAnchorLine top() const;
112 void setTop(const QQuickAnchorLine &edge);
115 QQuickAnchorLine bottom() const;
116 void setBottom(const QQuickAnchorLine &edge);
119 QQuickAnchorLine verticalCenter() const;
120 void setVerticalCenter(const QQuickAnchorLine &edge);
121 void resetVerticalCenter();
123 QQuickAnchorLine baseline() const;
124 void setBaseline(const QQuickAnchorLine &edge);
125 void resetBaseline();
127 qreal leftMargin() const;
128 void setLeftMargin(qreal);
130 qreal rightMargin() const;
131 void setRightMargin(qreal);
133 qreal horizontalCenterOffset() const;
134 void setHorizontalCenterOffset(qreal);
136 qreal topMargin() const;
137 void setTopMargin(qreal);
139 qreal bottomMargin() const;
140 void setBottomMargin(qreal);
142 qreal margins() const;
143 void setMargins(qreal);
145 qreal verticalCenterOffset() const;
146 void setVerticalCenterOffset(qreal);
148 qreal baselineOffset() const;
149 void setBaselineOffset(qreal);
151 QQuickItem *fill() const;
152 void setFill(QQuickItem *);
155 QQuickItem *centerIn() const;
156 void setCenterIn(QQuickItem *);
157 void resetCenterIn();
159 Anchors usedAnchors() const;
164 void componentComplete();
170 void bottomChanged();
171 void verticalCenterChanged();
172 void horizontalCenterChanged();
173 void baselineChanged();
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();
187 friend class QQuickItemPrivate;
188 Q_DISABLE_COPY(QQuickAnchors)
189 Q_DECLARE_PRIVATE(QQuickAnchors)
191 Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAnchors::Anchors)
195 QML_DECLARE_TYPE(QQuickAnchors)
199 #endif // QQUICKANCHORS_P_H