Qt 4.8
qdeclarativeanchors_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDECLARATIVEANCHORS_H
43 #define QDECLARATIVEANCHORS_H
44 
45 #include "qdeclarativeitem.h"
46 
47 #include <qdeclarative.h>
48 
49 #include <QtCore/QObject>
50 
51 #include <private/qdeclarativeglobal_p.h>
52 
54 
56 
57 QT_MODULE(Declarative)
58 
62 {
63  Q_OBJECT
64 
82 
83 public:
84  QDeclarativeAnchors(QObject *parent=0);
86  virtual ~QDeclarativeAnchors();
87 
88  enum Anchor {
89  LeftAnchor = 0x01,
90  RightAnchor = 0x02,
91  TopAnchor = 0x04,
92  BottomAnchor = 0x08,
93  HCenterAnchor = 0x10,
94  VCenterAnchor = 0x20,
95  BaselineAnchor = 0x40,
96  Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
97  Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
98  };
99  Q_DECLARE_FLAGS(Anchors, Anchor)
100 
102  void setLeft(const QDeclarativeAnchorLine &edge);
103  void resetLeft();
104 
106  void setRight(const QDeclarativeAnchorLine &edge);
107  void resetRight();
108 
109  QDeclarativeAnchorLine horizontalCenter() const;
110  void setHorizontalCenter(const QDeclarativeAnchorLine &edge);
111  void resetHorizontalCenter();
112 
113  QDeclarativeAnchorLine top() const;
114  void setTop(const QDeclarativeAnchorLine &edge);
115  void resetTop();
116 
117  QDeclarativeAnchorLine bottom() const;
118  void setBottom(const QDeclarativeAnchorLine &edge);
119  void resetBottom();
120 
121  QDeclarativeAnchorLine verticalCenter() const;
122  void setVerticalCenter(const QDeclarativeAnchorLine &edge);
123  void resetVerticalCenter();
124 
125  QDeclarativeAnchorLine baseline() const;
126  void setBaseline(const QDeclarativeAnchorLine &edge);
127  void resetBaseline();
128 
129  qreal leftMargin() const;
130  void setLeftMargin(qreal);
131 
132  qreal rightMargin() const;
133  void setRightMargin(qreal);
134 
135  qreal horizontalCenterOffset() const;
136  void setHorizontalCenterOffset(qreal);
137 
138  qreal topMargin() const;
139  void setTopMargin(qreal);
140 
141  qreal bottomMargin() const;
142  void setBottomMargin(qreal);
143 
144  qreal margins() const;
145  void setMargins(qreal);
146 
147  qreal verticalCenterOffset() const;
148  void setVerticalCenterOffset(qreal);
149 
150  qreal baselineOffset() const;
151  void setBaselineOffset(qreal);
152 
153  QGraphicsObject *fill() const;
154  void setFill(QGraphicsObject *);
155  void resetFill();
156 
157  QGraphicsObject *centerIn() const;
158  void setCenterIn(QGraphicsObject *);
159  void resetCenterIn();
160 
161  Anchors usedAnchors() const;
162 
163  void classBegin();
164  void componentComplete();
165 
166  bool mirrored();
167 
168 Q_SIGNALS:
169  void leftChanged();
170  void rightChanged();
171  void topChanged();
172  void bottomChanged();
173  void verticalCenterChanged();
174  void horizontalCenterChanged();
175  void baselineChanged();
176  void fillChanged();
177  void centerInChanged();
178  void leftMarginChanged();
179  void rightMarginChanged();
180  void topMarginChanged();
181  void bottomMarginChanged();
182  void marginsChanged();
183  void verticalCenterOffsetChanged();
184  void horizontalCenterOffsetChanged();
185  void baselineOffsetChanged();
186 
187 private:
188  friend class QDeclarativeItem;
193  Q_PRIVATE_SLOT(d_func(), void _q_widgetGeometryChanged())
194  Q_PRIVATE_SLOT(d_func(), void _q_widgetDestroyed(QObject *obj))
195 };
197 
199 
201 
203 
204 #endif
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
QDeclarativeAnchorLine top
#define QML_DECLARE_TYPE(TYPE)
Definition: qdeclarative.h:56
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Definition: qglobal.h:2348
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QDeclarativeAnchorLine baseline
#define Q_SIGNALS
Definition: qobjectdefs.h:72
QGraphicsObject * fill
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QDeclarativeAnchorLine horizontalCenter
QDeclarativeAnchorLine verticalCenter
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
Definition: qglobal.h:2355
QGraphicsObject * centerIn
The QDeclarativeItem class provides the most basic of all visual items in QML.
#define Q_DECLARATIVE_PRIVATE_EXPORT
#define Q_OBJECT
Definition: qobjectdefs.h:157
QDeclarativeAnchorLine left
QDeclarativeAnchorLine bottom
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
The QGraphicsObject class provides a base class for all graphics items that require signals...
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define QT_END_HEADER
Definition: qglobal.h:137
QDeclarativeAnchorLine right