summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativebinding_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativebinding_p.h')
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 1a714f0..56f1715 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -68,12 +68,14 @@ class Q_DECLARATIVE_EXPORT QDeclarativeAbstractBinding
{
public:
QDeclarativeAbstractBinding();
- virtual ~QDeclarativeAbstractBinding();
virtual void destroy();
virtual QString expression() const;
+ enum Type { PropertyBinding, ValueTypeProxy };
+ virtual Type bindingType() const { return PropertyBinding; }
+
void setEnabled(bool e) { setEnabled(e, QDeclarativePropertyPrivate::DontRemoveBinding); }
virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags) = 0;
virtual int propertyIndex() = 0;
@@ -85,11 +87,13 @@ public:
void removeFromObject();
protected:
+ virtual ~QDeclarativeAbstractBinding();
void clear();
private:
+
friend class QDeclarativeDeclarativeData;
- friend class QDeclarativeProperty;
+ friend class QDeclarativeValueTypeProxyBinding;
friend class QDeclarativePropertyPrivate;
friend class QDeclarativeVME;
@@ -99,6 +103,32 @@ private:
QDeclarativeAbstractBinding *m_nextBinding;
};
+class QDeclarativeValueTypeProxyBinding : public QDeclarativeAbstractBinding
+{
+public:
+ QDeclarativeValueTypeProxyBinding(QObject *o, int coreIndex);
+
+ virtual Type bindingType() const { return ValueTypeProxy; }
+
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags);
+ virtual int propertyIndex();
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags);
+
+ QDeclarativeAbstractBinding *binding(int propertyIndex);
+
+protected:
+ ~QDeclarativeValueTypeProxyBinding();
+
+private:
+ void recursiveEnable(QDeclarativeAbstractBinding *, QDeclarativePropertyPrivate::WriteFlags);
+ void recursiveDisable(QDeclarativeAbstractBinding *);
+
+ friend class QDeclarativeAbstractBinding;
+ QObject *m_object;
+ int m_index;
+ QDeclarativeAbstractBinding *m_bindings;
+};
+
class QDeclarativeContext;
class QDeclarativeBindingPrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
@@ -106,9 +136,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeBinding : public QDeclarativeExpression,
Q_OBJECT
public:
QDeclarativeBinding(const QString &, QObject *, QDeclarativeContext *, QObject *parent=0);
- QDeclarativeBinding(void *, QDeclarativeRefCount *, QObject *, QDeclarativeContext *, const QString &, int,
- QObject *parent);
- ~QDeclarativeBinding();
+ QDeclarativeBinding(const QString &, QObject *, QDeclarativeContextData *, QObject *parent=0);
+ QDeclarativeBinding(void *, QDeclarativeRefCount *, QObject *, QDeclarativeContextData *,
+ const QString &, int, QObject *parent);
void setTarget(const QDeclarativeProperty &);
QDeclarativeProperty property() const;
@@ -125,6 +155,7 @@ public Q_SLOTS:
void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); }
protected:
+ ~QDeclarativeBinding();
void emitValueChanged();
private: