2 Copyright (C) 2004 Nikolas Zimmermann <wildfox@kde.org>
3 2004 Rob Buis <buis@kde.org>
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
24 #include "CSSValueList.h"
25 #include "CSSValueListImpl.h"
27 #include "kdom/data/CSSConstants.h"
28 #include "CSSValueList.lut.h"
33 @begin CSSValueList::s_hashTable 2
34 length CSSValueListConstants::Length DontDelete
36 @begin CSSValueListProto::s_hashTable 2
37 item CSSValueListConstants::Item DontDelete|Function 1
41 KDOM_IMPLEMENT_PROTOTYPE("CSSValueList", CSSValueListProto, CSSValueListProtoFunc)
43 Value CSSValueList::getValueProperty(ExecState *, int token) const
47 case CSSValueListConstants::Length:
48 return Number(length());
50 kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
56 Value CSSValueListProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
58 KDOM_CHECK_THIS(CSSValueList)
62 case CSSValueListConstants::Item:
64 unsigned long index = args[0].toUInt32(exec);
65 return getDOMCSSValue(exec, obj.item(index));
68 kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
76 #define impl (static_cast<CSSValueListImpl *>(d))
78 CSSValueList CSSValueList::null;
80 CSSValueList::CSSValueList() : CSSValue()
84 CSSValueList::CSSValueList(const CSSValueList &other) : CSSValue()
89 CSSValueList::CSSValueList(const CSSValue &other) : CSSValue()
94 CSSValueList::CSSValueList(CSSValueListImpl *i) : CSSValue(i)
98 CSSValueList::~CSSValueList()
102 CSSValueList &CSSValueList::operator=(const CSSValueList &other)
104 CSSValue::operator=(other);
108 KDOM_CSSVALUE_DERIVED_ASSIGN_OP(CSSValueList, CSS_VALUE_LIST)
110 unsigned long CSSValueList::length() const
115 return impl->length();
118 CSSValue CSSValueList::item(unsigned long index) const
121 return CSSValue::null;
123 return CSSValue(impl->item(index));