2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef CSSStyleDeclaration_h
22 #define CSSStyleDeclaration_h
24 #include "StyleBase.h"
25 #include <wtf/Forward.h>
29 class CSSMutableStyleDeclaration
;
33 typedef int ExceptionCode
;
35 class CSSStyleDeclaration
: public StyleBase
{
37 static bool isPropertyName(const String
&);
39 CSSRule
* parentRule() const;
41 virtual String
cssText() const = 0;
42 virtual void setCssText(const String
&, ExceptionCode
&) = 0;
44 virtual unsigned length() const = 0;
45 virtual String
item(unsigned index
) const = 0;
47 PassRefPtr
<CSSValue
> getPropertyCSSValue(const String
& propertyName
);
48 String
getPropertyValue(const String
& propertyName
);
49 String
getPropertyPriority(const String
& propertyName
);
50 String
getPropertyShorthand(const String
& propertyName
);
51 bool isPropertyImplicit(const String
& propertyName
);
53 virtual PassRefPtr
<CSSValue
> getPropertyCSSValue(int propertyID
) const = 0;
54 virtual String
getPropertyValue(int propertyID
) const = 0;
55 virtual bool getPropertyPriority(int propertyID
) const = 0;
56 virtual int getPropertyShorthand(int propertyID
) const = 0;
57 virtual bool isPropertyImplicit(int propertyID
) const = 0;
59 void setProperty(const String
& propertyName
, const String
& value
, ExceptionCode
&);
60 void setProperty(const String
& propertyName
, const String
& value
, const String
& priority
, ExceptionCode
&);
61 String
removeProperty(const String
& propertyName
, ExceptionCode
&);
62 virtual void setProperty(int propertyId
, const String
& value
, bool important
, ExceptionCode
&) = 0;
63 virtual String
removeProperty(int propertyID
, ExceptionCode
&) = 0;
65 virtual PassRefPtr
<CSSMutableStyleDeclaration
> copy() const = 0;
66 virtual PassRefPtr
<CSSMutableStyleDeclaration
> makeMutable() = 0;
68 void diff(CSSMutableStyleDeclaration
*) const;
70 PassRefPtr
<CSSMutableStyleDeclaration
> copyPropertiesInSet(const int* set
, unsigned length
) const;
73 CSSStyleDeclaration(CSSRule
* parentRule
= 0);
76 } // namespace WebCore
78 #endif // CSSStyleDeclaration_h