webengine/osswebengine/DerivedSources/WebCore/JSHTMLTableCaptionElement.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 07 Jan 2010 13:31:38 +0200
changeset 37 cb62a4f66ebe
parent 0 dd21522fd290
permissions -rw-r--r--
Revision: 200951 Kit: 201001

/*
    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"

#include "JSHTMLTableCaptionElement.h"

#include <wtf/GetPtr.h>

#include "HTMLTableCaptionElement.h"
#include "PlatformString.h"

using namespace KJS;

namespace WebCore {

/* Hash table */

static const HashEntry JSHTMLTableCaptionElementTableEntries[] =
{
    { 0, 0, 0, 0, 0 },
    { "align", JSHTMLTableCaptionElement::AlignAttrNum, DontDelete, 0, &JSHTMLTableCaptionElementTableEntries[2] },
    { "constructor", JSHTMLTableCaptionElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
};

static const HashTable JSHTMLTableCaptionElementTable = 
{
    2, 3, JSHTMLTableCaptionElementTableEntries, 2
};

/* Hash table for constructor */

static const HashEntry JSHTMLTableCaptionElementConstructorTableEntries[] =
{
    { 0, 0, 0, 0, 0 }
};

static const HashTable JSHTMLTableCaptionElementConstructorTable = 
{
    2, 1, JSHTMLTableCaptionElementConstructorTableEntries, 1
};

class JSHTMLTableCaptionElementConstructor : public DOMObject {
public:
    JSHTMLTableCaptionElementConstructor(ExecState* exec)
    {
        setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
        putDirect(exec->propertyNames().prototype, JSHTMLTableCaptionElementPrototype::self(exec), None);
    }
    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    JSValue* getValueProperty(ExecState*, int token) const;
    virtual const ClassInfo* classInfo() const { return &info; }
    static const ClassInfo info;

    virtual bool implementsHasInstance() const { return true; }
};

const ClassInfo JSHTMLTableCaptionElementConstructor::info = { "HTMLTableCaptionElementConstructor", 0, &JSHTMLTableCaptionElementConstructorTable, 0 };

bool JSHTMLTableCaptionElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSHTMLTableCaptionElementConstructor, DOMObject>(exec, &JSHTMLTableCaptionElementConstructorTable, this, propertyName, slot);
}

JSValue* JSHTMLTableCaptionElementConstructor::getValueProperty(ExecState*, int token) const
{
    // The token is the numeric value of its associated constant
    return jsNumber(token);
}

/* Hash table for prototype */

static const HashEntry JSHTMLTableCaptionElementPrototypeTableEntries[] =
{
    { 0, 0, 0, 0, 0 }
};

static const HashTable JSHTMLTableCaptionElementPrototypeTable = 
{
    2, 1, JSHTMLTableCaptionElementPrototypeTableEntries, 1
};

const ClassInfo JSHTMLTableCaptionElementPrototype::info = { "HTMLTableCaptionElementPrototype", 0, &JSHTMLTableCaptionElementPrototypeTable, 0 };

JSObject* JSHTMLTableCaptionElementPrototype::self(ExecState* exec)
{
    return KJS::cacheGlobalObject<JSHTMLTableCaptionElementPrototype>(exec, "[[JSHTMLTableCaptionElement.prototype]]");
}

const ClassInfo JSHTMLTableCaptionElement::info = { "HTMLTableCaptionElement", &JSHTMLElement::info, &JSHTMLTableCaptionElementTable, 0 };

JSHTMLTableCaptionElement::JSHTMLTableCaptionElement(ExecState* exec, HTMLTableCaptionElement* impl)
    : JSHTMLElement(exec, impl)
{
    setPrototype(JSHTMLTableCaptionElementPrototype::self(exec));
}

bool JSHTMLTableCaptionElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSHTMLTableCaptionElement, JSHTMLElement>(exec, &JSHTMLTableCaptionElementTable, this, propertyName, slot);
}

JSValue* JSHTMLTableCaptionElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case AlignAttrNum: {
        HTMLTableCaptionElement* imp = static_cast<HTMLTableCaptionElement*>(impl());

        return jsString(imp->align());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}

void JSHTMLTableCaptionElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
{
    lookupPut<JSHTMLTableCaptionElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLTableCaptionElementTable, this);
}

void JSHTMLTableCaptionElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
{
    switch (token) {
    case AlignAttrNum: {
        HTMLTableCaptionElement* imp = static_cast<HTMLTableCaptionElement*>(impl());

        imp->setAlign(valueToStringWithNullCheck(exec, value));
        break;
    }
    }
}

JSValue* JSHTMLTableCaptionElement::getConstructor(ExecState* exec)
{
    return KJS::cacheGlobalObject<JSHTMLTableCaptionElementConstructor>(exec, "[[HTMLTableCaptionElement.constructor]]");
}
HTMLTableCaptionElement* toHTMLTableCaptionElement(KJS::JSValue* val)
{
    return val->isObject(&JSHTMLTableCaptionElement::info) ? static_cast<JSHTMLTableCaptionElement*>(val)->impl() : 0;
}

HTMLTableCaptionElement* JSHTMLTableCaptionElement::impl() const
{
    return static_cast<HTMLTableCaptionElement*>(JSHTMLElement::impl());
}

}