summaryrefslogtreecommitdiffstats
path: root/src/v4/qv4dateobject.h
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-01-29 14:20:50 +0100
committerLars Knoll <lars.knoll@digia.com>2013-01-30 13:20:40 +0100
commit74fba4d8069c946c1ba12b9ac4d4026aaf14118b (patch)
tree138cc204ec33ef0c838c98355ea84846e11ca1a7 /src/v4/qv4dateobject.h
parent0781ecb087b027cccc1c44de1a1c7520cc89e2d2 (diff)
Say hello to QtV4 module.
Change-Id: I507cd5707b7d7223a0d901cf939896fb2649b684 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/v4/qv4dateobject.h')
-rw-r--r--src/v4/qv4dateobject.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/src/v4/qv4dateobject.h b/src/v4/qv4dateobject.h
new file mode 100644
index 00000000..ede44732
--- /dev/null
+++ b/src/v4/qv4dateobject.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the V4VM module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QV4DATEOBJECT_P_H
+#define QV4DATEOBJECT_P_H
+
+#include "qv4object.h"
+#include "qv4functionobject.h"
+#include <QtCore/qnumeric.h>
+
+namespace QQmlJS {
+namespace VM {
+
+struct DateObject: Object {
+ Value value;
+ DateObject(const Value &value): value(value) { type = Type_DateObject; }
+};
+
+struct DateCtor: FunctionObject
+{
+ DateCtor(ExecutionContext *scope);
+
+ virtual Value construct(ExecutionContext *ctx);
+ virtual Value call(ExecutionContext *ctx);
+};
+
+struct DatePrototype: DateObject
+{
+ DatePrototype(): DateObject(Value::fromDouble(qSNaN())) {}
+ void init(ExecutionContext *ctx, const Value &ctor);
+
+ static double getThisDate(ExecutionContext *ctx);
+
+ static Value method_parse(ExecutionContext *ctx);
+ static Value method_UTC(ExecutionContext *ctx);
+ static Value method_now(ExecutionContext *ctx);
+
+ static Value method_toString(ExecutionContext *ctx);
+ static Value method_toDateString(ExecutionContext *ctx);
+ static Value method_toTimeString(ExecutionContext *ctx);
+ static Value method_toLocaleString(ExecutionContext *ctx);
+ static Value method_toLocaleDateString(ExecutionContext *ctx);
+ static Value method_toLocaleTimeString(ExecutionContext *ctx);
+ static Value method_valueOf(ExecutionContext *ctx);
+ static Value method_getTime(ExecutionContext *ctx);
+ static Value method_getYear(ExecutionContext *ctx);
+ static Value method_getFullYear(ExecutionContext *ctx);
+ static Value method_getUTCFullYear(ExecutionContext *ctx);
+ static Value method_getMonth(ExecutionContext *ctx);
+ static Value method_getUTCMonth(ExecutionContext *ctx);
+ static Value method_getDate(ExecutionContext *ctx);
+ static Value method_getUTCDate(ExecutionContext *ctx);
+ static Value method_getDay(ExecutionContext *ctx);
+ static Value method_getUTCDay(ExecutionContext *ctx);
+ static Value method_getHours(ExecutionContext *ctx);
+ static Value method_getUTCHours(ExecutionContext *ctx);
+ static Value method_getMinutes(ExecutionContext *ctx);
+ static Value method_getUTCMinutes(ExecutionContext *ctx);
+ static Value method_getSeconds(ExecutionContext *ctx);
+ static Value method_getUTCSeconds(ExecutionContext *ctx);
+ static Value method_getMilliseconds(ExecutionContext *ctx);
+ static Value method_getUTCMilliseconds(ExecutionContext *ctx);
+ static Value method_getTimezoneOffset(ExecutionContext *ctx);
+ static Value method_setTime(ExecutionContext *ctx);
+ static Value method_setMilliseconds(ExecutionContext *ctx);
+ static Value method_setUTCMilliseconds(ExecutionContext *ctx);
+ static Value method_setSeconds(ExecutionContext *ctx);
+ static Value method_setUTCSeconds(ExecutionContext *ctx);
+ static Value method_setMinutes(ExecutionContext *ctx);
+ static Value method_setUTCMinutes(ExecutionContext *ctx);
+ static Value method_setHours(ExecutionContext *ctx);
+ static Value method_setUTCHours(ExecutionContext *ctx);
+ static Value method_setDate(ExecutionContext *ctx);
+ static Value method_setUTCDate(ExecutionContext *ctx);
+ static Value method_setMonth(ExecutionContext *ctx);
+ static Value method_setUTCMonth(ExecutionContext *ctx);
+ static Value method_setYear(ExecutionContext *ctx);
+ static Value method_setFullYear(ExecutionContext *ctx);
+ static Value method_setUTCFullYear(ExecutionContext *ctx);
+ static Value method_toUTCString(ExecutionContext *ctx);
+ static Value method_toISOString(ExecutionContext *ctx);
+ static Value method_toJSON(ExecutionContext *ctx);
+};
+
+} // end of namespace VM
+} // end of namespace QQmlJS
+
+#endif // QV4ECMAOBJECTS_P_H