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 "DOMException.h"
25 #include "CSSStyleRule.h"
26 #include "CSSStyleSheet.h"
27 #include "CSSStyleRuleImpl.h"
28 #include "DOMExceptionImpl.h"
29 #include "CSSStyleDeclaration.h"
31 #include "kdom/data/CSSConstants.h"
32 #include "CSSStyleRule.lut.h"
37 @begin CSSStyleRule::s_hashTable 3
38 selectorText CSSStyleRuleConstants::SelectorText DontDelete|ReadOnly
39 style CSSStyleRuleConstants::Style DontDelete|ReadOnly
43 Value CSSStyleRule::getValueProperty(ExecState *exec, int token) const
47 case CSSStyleRuleConstants::SelectorText:
48 return getDOMString(selectorText());
49 case CSSStyleRuleConstants::Style:
50 return safe_cache<CSSStyleDeclaration>(exec, style());
52 kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
58 void CSSStyleRule::putValueProperty(ExecState *exec, int token, const Value &value, int)
64 case CSSStyleRuleConstants::SelectorText:
65 setSelectorText(toDOMString(exec, value));
68 kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
71 KDOM_LEAVE_SAFE(DOMException)
75 #define impl (static_cast<CSSStyleRuleImpl *>(d))
77 CSSStyleRule CSSStyleRule::null;
79 CSSStyleRule::CSSStyleRule() : CSSRule()
83 CSSStyleRule::CSSStyleRule(const CSSStyleRule &other) : CSSRule()
88 CSSStyleRule::CSSStyleRule(const CSSRule &other) : CSSRule()
93 CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *i) : CSSRule(i)
97 CSSStyleRule::~CSSStyleRule()
101 CSSStyleRule &CSSStyleRule::operator=(const CSSStyleRule &other)
103 CSSRule::operator=(other);
107 KDOM_CSSRULE_DERIVED_ASSIGN_OP(CSSStyleRule, STYLE_RULE)
109 void CSSStyleRule::setSelectorText(const DOMString &selectorText)
112 impl->setSelectorText(selectorText);
115 DOMString CSSStyleRule::selectorText() const
120 return impl->selectorText();
123 CSSStyleDeclaration CSSStyleRule::style() const
126 return CSSStyleDeclaration::null;
128 return CSSStyleDeclaration(impl->style());