Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / qdeclarative.h
index 311ecd3..2d199b7 100644 (file)
@@ -1,8 +1,7 @@
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
@@ -45,7 +45,6 @@
 #include <QtDeclarative/qdeclarativeprivate.h>
 #include <QtDeclarative/qdeclarativeparserstatus.h>
 #include <QtDeclarative/qdeclarativepropertyvaluesource.h>
-#include <QtDeclarative/qdeclarativepropertyvalueinterceptor.h>
 #include <QtDeclarative/qdeclarativelist.h>
 
 #include <QtCore/qbytearray.h>
@@ -87,7 +86,8 @@ QT_END_NAMESPACE
 
 QT_BEGIN_NAMESPACE
 
-QT_MODULE(Declarative)
+
+class QDeclarativePropertyValueInterceptor;
 
 template<typename T>
 int qmlRegisterType()
@@ -413,46 +413,6 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
 // For the use of QtQuick1 module
 Q_DECLARATIVE_EXPORT void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor);
 
-/*!
-   This function may be used to register a module API provider \a callback in a particular \a uri
-   with a version specified in \a versionMajor and \a versionMinor.
-
-   Installing a module API into a uri allows developers to provide arbitrary functionality
-   (methods and properties) in a namespace that doesn't necessarily contain elements.
-
-   A module API may be either a QObject or a QScriptValue.  Only one module API provider
-   may be registered into any given namespace (combination of \a uri, \a majorVersion and \a minorVersion).
-   This function should be used to register a module API provider function which returns a QScriptValue as a module API.
-
-   Usage:
-   \code
-   // first, define the module API provider function (callback).
-   static QScriptValue *example_qscriptvalue_module_api_provider(QDeclarativeEngine *engine, QScriptEngine *scriptEngine)
-   {
-       Q_UNUSED(engine)
-
-       static int seedValue = 5;
-       QScriptValue example = scriptEngine->newObject();
-       example.setProperty("someProperty", seedValue++);
-       return example;
-   }
-
-   // second, register the module API provider with QML by calling this function in an initialization function.
-   ...
-   qmlRegisterModuleApi("Qt.example.qscriptvalueApi", 1, 0, example_qscriptvalue_module_api_provider);
-   ...
-   \endcode
-
-   In order to use the registered module API in QML, you must import the module API.
-   \qml
-   import QtQuick 2.0
-   import Qt.example.qscriptvalueApi 1.0 as ExampleApi
-   Item {
-       id: root
-       property int someValue: ExampleApi.someProperty
-   }
-   \endqml
-  */
 inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor,
                                 QJSValue (*callback)(QDeclarativeEngine *, QJSEngine *))
 {
@@ -467,75 +427,6 @@ inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMi
     return QDeclarativePrivate::qmlregister(QDeclarativePrivate::ModuleApiRegistration, &api);
 }
 
-/*!
-   This function may be used to register a module API provider \a callback in a particular \a uri
-   with a version specified in \a versionMajor and \a versionMinor.
-
-   Installing a module API into a uri allows developers to provide arbitrary functionality
-   (methods and properties) in a namespace that doesn't necessarily contain elements.
-
-   A module API may be either a QObject or a QScriptValue.  Only one module API provider
-   may be registered into any given namespace (combination of \a uri, \a majorVersion and \a minorVersion).
-   This function should be used to register a module API provider function which returns a QObject as a module API.
-
-   Usage:
-   \code
-   // first, define your QObject which provides the functionality.
-   class ModuleApiExample : public QObject
-   {
-       Q_OBJECT
-       Q_PROPERTY (int someProperty READ someProperty WRITE setSomeProperty NOTIFY somePropertyChanged)
-
-   public:
-       ModuleApiExample(QObject* parent = 0)
-           : QObject(parent), m_someProperty(0)
-       {
-       }
-
-       ~ModuleApiExample() {}
-
-       Q_INVOKABLE int doSomething() { setSomeProperty(5); return m_someProperty; }
-
-       int someProperty() const { return m_someProperty; }
-       void setSomeProperty(int val) { m_someProperty = val; emit somePropertyChanged(val); }
-
-   signals:
-       void somePropertyChanged(int newValue);
-
-   private:
-       int m_someProperty;
-   };
-
-   // second, define the module API provider function (callback).
-   static QObject *example_qobject_module_api_provider(QDeclarativeEngine *engine, QScriptEngine *scriptEngine)
-   {
-       Q_UNUSED(engine)
-       Q_UNUSED(scriptEngine)
-
-       ModuleApiExample *example = new ModuleApiExample();
-       return example;
-   }
-
-   // third, register the module API provider with QML by calling this function in an initialization function.
-   ...
-   qmlRegisterModuleApi("Qt.example.qobjectApi", 1, 0, example_qobject_module_api_provider);
-   ...
-   \endcode
-
-   In order to use the registered module API in QML, you must import the module API.
-   \qml
-   import QtQuick 2.0
-   import Qt.example.qobjectApi 1.0 as ExampleApi
-   Item {
-       id: root
-       property int someValue: ExampleApi.someProperty
-
-       Component.onCompleted: {
-           someValue = ExampleApi.doSomething()
-       }
-   }
-   \endqml
-  */
 inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor,
                                 QObject *(*callback)(QDeclarativeEngine *, QJSEngine *))
 {
@@ -550,17 +441,6 @@ inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMi
     return QDeclarativePrivate::qmlregister(QDeclarativePrivate::ModuleApiRegistration, &api);
 }
 
-// Enable debugging before any QDeclarativeEngine is created
-struct Q_DECLARATIVE_EXPORT QDeclarativeDebuggingEnabler
-{
-    QDeclarativeDebuggingEnabler();
-};
-
-// Execute code in constructor before first QDeclarativeEngine is instantiated
-#if defined(QT_DECLARATIVE_DEBUG)
-static QDeclarativeDebuggingEnabler qmlEnableDebuggingHelper;
-#endif
-
 QT_END_NAMESPACE
 
 QML_DECLARE_TYPE(QObject)