/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"

#if ENABLE(INPUT_SPEECH)

#include "JSSpeechInputEvent.h"

#include "JSSpeechInputResultList.h"
#include "SpeechInputEvent.h"
#include "SpeechInputResultList.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSSpeechInputEventTableValues[] =
{
    { "results", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSpeechInputEventResults), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSpeechInputEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSSpeechInputEventTable = { 4, 3, true, JSSpeechInputEventTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSSpeechInputEventConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSSpeechInputEventConstructorTable = { 1, 0, false, JSSpeechInputEventConstructorTableValues, 0 };
const ClassInfo JSSpeechInputEventConstructor::s_info = { "SpeechInputEventConstructor", &Base::s_info, &JSSpeechInputEventConstructorTable, 0, CREATE_METHOD_TABLE(JSSpeechInputEventConstructor) };

JSSpeechInputEventConstructor::JSSpeechInputEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSSpeechInputEventConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSSpeechInputEventPrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSSpeechInputEventConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSpeechInputEventConstructor, JSDOMWrapper>(exec, JSSpeechInputEventConstructorTable, jsCast<JSSpeechInputEventConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSSpeechInputEventPrototypeTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSSpeechInputEventPrototypeTable = { 1, 0, false, JSSpeechInputEventPrototypeTableValues, 0 };
const ClassInfo JSSpeechInputEventPrototype::s_info = { "SpeechInputEventPrototype", &Base::s_info, &JSSpeechInputEventPrototypeTable, 0, CREATE_METHOD_TABLE(JSSpeechInputEventPrototype) };

JSObject* JSSpeechInputEventPrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSSpeechInputEvent>(vm, globalObject);
}

const ClassInfo JSSpeechInputEvent::s_info = { "SpeechInputEvent", &Base::s_info, &JSSpeechInputEventTable, 0 , CREATE_METHOD_TABLE(JSSpeechInputEvent) };

JSSpeechInputEvent::JSSpeechInputEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SpeechInputEvent> impl)
    : JSEvent(structure, globalObject, impl)
{
}

void JSSpeechInputEvent::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSSpeechInputEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSSpeechInputEventPrototype::create(vm, globalObject, JSSpeechInputEventPrototype::createStructure(vm, globalObject, JSEventPrototype::self(vm, globalObject)));
}

bool JSSpeechInputEvent::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSSpeechInputEvent* thisObject = jsCast<JSSpeechInputEvent*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSSpeechInputEvent, Base>(exec, JSSpeechInputEventTable, thisObject, propertyName, slot);
}

EncodedJSValue jsSpeechInputEventResults(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSSpeechInputEvent* castedThis = jsDynamicCast<JSSpeechInputEvent*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    SpeechInputEvent& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.results()));
    return JSValue::encode(result);
}


EncodedJSValue jsSpeechInputEventConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSSpeechInputEvent* domObject = jsDynamicCast<JSSpeechInputEvent*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSSpeechInputEvent::getConstructor(exec->vm(), domObject->globalObject()));
}

JSValue JSSpeechInputEvent::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSSpeechInputEventConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}


}

#endif // ENABLE(INPUT_SPEECH)
