2
* This file is part of the DOM implementation for KDE.
4
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
5
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
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.
23
#ifndef CSSStyleDeclaration_h
24
#define CSSStyleDeclaration_h
26
#include "StyleBase.h"
27
#include <wtf/PassRefPtr.h>
31
class CSSMutableStyleDeclaration;
35
typedef int ExceptionCode;
37
class CSSStyleDeclaration : public StyleBase {
39
virtual bool isStyleDeclaration();
41
static bool isPropertyName(const String&);
43
CSSRule* parentRule() const;
45
virtual String cssText() const = 0;
46
virtual void setCssText(const String&, ExceptionCode&) = 0;
48
virtual unsigned length() const = 0;
49
virtual String item(unsigned index) const = 0;
51
PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
52
String getPropertyValue(const String& propertyName);
53
String getPropertyPriority(const String& propertyName);
54
String getPropertyShorthand(const String& propertyName);
55
bool isPropertyImplicit(const String& propertyName);
57
virtual PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID) const = 0;
58
virtual String getPropertyValue(int propertyID) const = 0;
59
virtual bool getPropertyPriority(int propertyID) const = 0;
60
virtual int getPropertyShorthand(int propertyID) const = 0;
61
virtual bool isPropertyImplicit(int propertyID) const = 0;
63
void setProperty(const String& propertyName, const String& value, ExceptionCode&);
64
void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&);
65
String removeProperty(const String& propertyName, ExceptionCode&);
66
virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&) = 0;
67
virtual String removeProperty(int propertyID, ExceptionCode&) = 0;
69
virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const = 0;
70
virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable() = 0;
72
void diff(CSSMutableStyleDeclaration*) const;
74
PassRefPtr<CSSMutableStyleDeclaration> copyPropertiesInSet(const int* set, unsigned length) const;
77
CSSStyleDeclaration(CSSRule* parentRule = 0);
80
CSSStyleDeclaration(const CSSStyleDeclaration&);
81
CSSStyleDeclaration& operator=(const CSSStyleDeclaration&);
84
} // namespace WebCore
86
#endif // CSSStyleDeclaration_h