Update copyright year in license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / qdeclarativecomponent.h
index ab007e8..2e33bf8 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -47,7 +47,7 @@
 
 #include <QtCore/qobject.h>
 #include <QtCore/qstring.h>
-#include <QtScript/qscriptvalue.h>
+#include <QtDeclarative/qjsvalue.h>
 
 QT_BEGIN_HEADER
 
@@ -55,11 +55,15 @@ QT_BEGIN_NAMESPACE
 
 QT_MODULE(Declarative)
 
-class QDeclarativeCompiledData;
 class QByteArray;
-class QDeclarativeComponentPrivate;
 class QDeclarativeEngine;
+class QDeclarativeComponent;
+class QDeclarativeIncubator;
+class QDeclarativeV8Function;
+class QDeclarativeCompiledData;
+class QDeclarativeComponentPrivate;
 class QDeclarativeComponentAttached;
+
 class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
 {
     Q_OBJECT
@@ -96,28 +100,31 @@ public:
     virtual QObject *beginCreate(QDeclarativeContext *);
     virtual void completeCreate();
 
-    void loadUrl(const QUrl &url);
-    void setData(const QByteArray &, const QUrl &baseUrl);
+    void create(QDeclarativeIncubator &, QDeclarativeContext *context = 0,
+                QDeclarativeContext *forContext = 0);
 
     QDeclarativeContext *creationContext() const;
 
     static QDeclarativeComponentAttached *qmlAttachedProperties(QObject *);
 
+public Q_SLOTS:
+    void loadUrl(const QUrl &url);
+    void setData(const QByteArray &, const QUrl &baseUrl);
+
 Q_SIGNALS:
     void statusChanged(QDeclarativeComponent::Status);
     void progressChanged(qreal);
 
 protected:
     QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent);
-    Q_INVOKABLE QScriptValue createObject(QObject* parent);
-    Q_INVOKABLE Q_REVISION(1) QScriptValue createObject(QObject* parent, const QScriptValue& valuemap); //XXX Versioning
+    Q_INVOKABLE void createObject(QDeclarativeV8Function *);
+    Q_INVOKABLE void incubateObject(QDeclarativeV8Function *);
 
 private:
-    QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent);
+    QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, QObject *parent);
 
     Q_DISABLE_COPY(QDeclarativeComponent)
     friend class QDeclarativeVME;
-    friend class QDeclarativeCompositeTypeData;
     friend class QDeclarativeTypeData;
 };