Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / v8 / qjsengine.cpp
index 3db7fc4..0e8d0c1 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 QtScript module of the Qt Toolkit.
 **
 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
+** us via http://www.qt-project.org/.
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 
 #include "qjsengine.h"
+#include "qjsengine_p.h"
 #include "qjsvalue.h"
 #include "qjsvalue_p.h"
 #include "qscriptisolate_p.h"
@@ -157,6 +158,8 @@ QJSEngine::QJSEngine()
 {
 }
 
+#ifdef QT_DEPRECATED
+
 /*!
     \internal
 */
@@ -165,6 +168,8 @@ QJSEngine::QJSEngine(QJSEngine::ContextOwnership ownership)
 {
 }
 
+#endif // QT_DEPRECATED
+
 /*!
     Constructs a QJSEngine object with the given \a parent.
 
@@ -178,7 +183,7 @@ QJSEngine::QJSEngine(QObject *parent)
 {
 }
 
-QJSEngine::QJSEngine(QObjectPrivate &dd, QObject *parent)
+QJSEngine::QJSEngine(QJSEnginePrivate &dd, QObject *parent)
     : QObject(dd, parent)
     , d(new QV8Engine(this))
 {
@@ -197,7 +202,11 @@ QJSEngine::~QJSEngine()
     \internal
 */
 
+#ifdef QT_DEPRECATED
+
 /*!
+    \obsolete
+
     Returns true if the last script evaluation resulted in an uncaught
     exception; otherwise returns false.
 
@@ -214,6 +223,8 @@ bool QJSEngine::hasUncaughtException() const
 }
 
 /*!
+    \obsolete
+
     Returns the current uncaught exception, or an invalid QJSValue
     if there is no uncaught exception.
 
@@ -232,6 +243,8 @@ QJSValue QJSEngine::uncaughtException() const
 }
 
 /*!
+    \obsolete
+
     Clears any uncaught exceptions in this engine.
 
     \sa hasUncaughtException()
@@ -243,6 +256,7 @@ void QJSEngine::clearExceptions()
     d->clearExceptions();
 }
 
+#endif // QT_DEPRECATED
 
 /*!
     Runs the garbage collector.
@@ -297,7 +311,11 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in
     return QJSValuePrivate::get(d->evaluate(program, fileName, lineNumber));
 }
 
+#ifdef QT_DEPRECATED
+
 /*!
+  \obsolete
+
   Returns a QJSValue of the primitive type Null.
 
   \sa nullValue()
@@ -311,6 +329,8 @@ QJSValue QJSEngine::nullValue()
 }
 
 /*!
+  \obsolete
+
   Returns a QJSValue of the primitive type Undefined.
 
   \sa nullValue()
@@ -323,6 +343,8 @@ QJSValue QJSEngine::undefinedValue()
     return QJSValuePrivate::get(new QJSValuePrivate(d, v8::Undefined()));
 }
 
+#endif // QT_DEPRECATED
+
 /*!
   Creates a JavaScript object of class Object.
 
@@ -378,10 +400,14 @@ QJSValue QJSEngine::newQObject(QObject *object)
     Q_D(QJSEngine);
     QScriptIsolate api(d, QScriptIsolate::NotNullEngine);
     v8::HandleScope handleScope;
-    return d->scriptValueFromInternal(d->newQObject(object));
+    return d->scriptValueFromInternal(d->newQObject(object, QV8Engine::JavaScriptOwnership));
 }
 
+#ifdef QT_DEPRECATED
+
 /*!
+  \obsolete
+
   Creates a JavaScript object holding the given variant \a value.
 
   If a default prototype has been registered with the meta type id of
@@ -399,6 +425,7 @@ QJSValue QJSEngine::newVariant(const QVariant &value)
     return d->scriptValueFromInternal(d->newVariant(value));
 }
 
+#endif // QT_DEPRECATED
 
 /*!
   Returns this engine's Global Object.
@@ -418,7 +445,11 @@ QJSValue QJSEngine::globalObject() const
     return d->scriptValueFromInternal(d->global());
 }
 
+#ifdef QT_DEPRECATED
+
 /*!
+  \obsolete
+
   Converts the given \a value to an object, if such a conversion is
   possible; otherwise returns an invalid QJSValue. The conversion
   is performed according to the following table:
@@ -444,6 +475,8 @@ QJSValue QJSEngine::toObject(const QJSValue& value)
 }
 
 /*!
+  \obsolete
+
   Creates a JavaScript object of class Date from the given \a value.
 
   \sa QJSValue::toDateTime()
@@ -453,10 +486,12 @@ QJSValue QJSEngine::newDate(const QDateTime &dt)
     Q_D(QJSEngine);
     QScriptIsolate api(d, QScriptIsolate::NotNullEngine);
     v8::HandleScope handleScope;
-    return d->scriptValueFromInternal(v8::Handle<v8::Value>(QJSConverter::toDateTime(dt)));
+    return d->scriptValueFromInternal(QJSConverter::toDateTime(dt));
 }
 
 /*!
+  \obsolete
+
   Creates a JavaScript object of class Date with the given
   \a value (the number of milliseconds since 01 January 1970,
   UTC).
@@ -470,6 +505,8 @@ QJSValue QJSEngine::newDate(double date)
 }
 
 /*!
+  \obsolete
+
   Creates a JavaScript object of class RegExp with the given
   \a regexp.
 
@@ -484,6 +521,8 @@ QJSValue QJSEngine::newRegExp(const QRegExp &regexp)
 }
 
 /*!
+  \obsolete
+
   Creates a JavaScript object of class RegExp with the given
   \a pattern and \a flags.
 
@@ -498,6 +537,8 @@ QJSValue QJSEngine::newRegExp(const QString &pattern, const QString &flags)
     return QJSValuePrivate::get(d->newRegExp(pattern, flags));
 }
 
+#endif // QT_DEPRECATED
+
 /*!
  *  \internal
  * used by QJSEngine::toScriptValue