summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeitem_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeitem_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h54
1 files changed, 51 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 4303c0a..dae581c 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE
class QNetworkReply;
class QDeclarativeItemKeyFilter;
+class QDeclarativeLayoutMirroringAttached;
//### merge into private?
class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener
@@ -125,8 +126,10 @@ public:
_stateGroup(0), origin(QDeclarativeItem::Center),
widthValid(false), heightValid(false),
componentComplete(true), keepMouse(false),
- smooth(false), transformOriginDirty(true), doneEventPreHandler(false), keyHandler(0),
- mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), hadSubFocusItem(false)
+ smooth(false), transformOriginDirty(true), doneEventPreHandler(false),
+ inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
+ inheritMirrorFromParent(false), inheritMirrorFromItem(false), keyHandler(0),
+ mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), attachedLayoutDirection(0), hadSubFocusItem(false)
{
QGraphicsItemPrivate::acceptedMouseButtons = 0;
isDeclarativeItem = 1;
@@ -134,7 +137,6 @@ public:
QGraphicsItem::ItemHasNoContents
| QGraphicsItem::ItemIsFocusable
| QGraphicsItem::ItemNegativeZStacksBehindParent);
-
}
void init(QDeclarativeItem *parent)
@@ -143,11 +145,17 @@ public:
if (parent) {
QDeclarative_setParent_noEvent(q, parent);
q->setParentItem(parent);
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parent);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
}
baselineOffset.invalidate();
mouseSetsFocus = false;
}
+ bool isMirrored() const {
+ return effectiveLayoutMirror;
+ }
+
// Private Properties
qreal width() const;
void setWidth(qreal);
@@ -162,6 +170,10 @@ public:
virtual void implicitWidthChanged();
virtual void implicitHeightChanged();
+ void resolveLayoutMirror();
+ void setImplicitLayoutMirror(bool mirror, bool inherit);
+ void setLayoutMirror(bool mirror);
+
QDeclarativeListProperty<QObject> data();
QDeclarativeListProperty<QObject> resources();
@@ -272,6 +284,11 @@ public:
bool smooth:1;
bool transformOriginDirty : 1;
bool doneEventPreHandler : 1;
+ bool inheritedLayoutMirror:1;
+ bool effectiveLayoutMirror:1;
+ bool isMirrorImplicit:1;
+ bool inheritMirrorFromParent:1;
+ bool inheritMirrorFromItem:1;
QDeclarativeItemKeyFilter *keyHandler;
@@ -280,6 +297,8 @@ public:
qreal mImplicitWidth;
qreal mImplicitHeight;
+ QDeclarativeLayoutMirroringAttached* attachedLayoutDirection;
+
bool hadSubFocusItem;
QPointF computeTransformOrigin() const;
@@ -326,6 +345,8 @@ public:
virtual void focusChanged(bool);
+ virtual void mirrorChange() {};
+
static qint64 consistentTime;
static void setConsistentTime(qint64 t);
static void start(QElapsedTimer &);
@@ -423,6 +444,31 @@ private:
void setFocusNavigation(QDeclarativeItem *currentItem, const char *dir);
};
+class QDeclarativeLayoutMirroringAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged)
+
+public:
+ explicit QDeclarativeLayoutMirroringAttached(QObject *parent = 0);
+
+ bool enabled() const;
+ void setEnabled(bool);
+ void resetEnabled();
+
+ bool childrenInherit() const;
+ void setChildrenInherit(bool);
+
+ static QDeclarativeLayoutMirroringAttached *qmlAttachedProperties(QObject *);
+Q_SIGNALS:
+ void enabledChanged();
+ void childrenInheritChanged();
+private:
+ friend class QDeclarativeItemPrivate;
+ QDeclarativeItemPrivate *itemPrivate;
+};
+
class QDeclarativeKeysAttachedPrivate : public QObjectPrivate
{
public:
@@ -572,5 +618,7 @@ QML_DECLARE_TYPE(QDeclarativeKeysAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
QML_DECLARE_TYPE(QDeclarativeKeyNavigationAttached)
QML_DECLARE_TYPEINFO(QDeclarativeKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeLayoutMirroringAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeLayoutMirroringAttached, QML_HAS_ATTACHED_PROPERTIES)
#endif // QDECLARATIVEITEM_P_H