|
1 /* |
|
2 * This file is part of the DOM implementation for KDE. |
|
3 * |
|
4 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
|
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
|
6 * |
|
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. |
|
11 * |
|
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. |
|
16 * |
|
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., 51 Franklin Street, Fifth Floor, |
|
20 * Boston, MA 02110-1301, USA. |
|
21 */ |
|
22 |
|
23 #ifndef CSSStyleDeclaration_h |
|
24 #define CSSStyleDeclaration_h |
|
25 |
|
26 #include "StyleBase.h" |
|
27 #include <wtf/PassRefPtr.h> |
|
28 |
|
29 namespace WebCore { |
|
30 |
|
31 class CSSMutableStyleDeclaration; |
|
32 class CSSRule; |
|
33 class CSSValue; |
|
34 |
|
35 typedef int ExceptionCode; |
|
36 |
|
37 class CSSStyleDeclaration : public StyleBase { |
|
38 public: |
|
39 virtual bool isStyleDeclaration(); |
|
40 |
|
41 static bool isPropertyName(const String&); |
|
42 |
|
43 CSSRule* parentRule() const; |
|
44 |
|
45 virtual String cssText() const = 0; |
|
46 virtual void setCssText(const String&, ExceptionCode&) = 0; |
|
47 |
|
48 virtual unsigned length() const = 0; |
|
49 virtual String item(unsigned index) const = 0; |
|
50 |
|
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); |
|
56 |
|
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; |
|
62 |
|
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; |
|
68 |
|
69 virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const = 0; |
|
70 virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable() = 0; |
|
71 |
|
72 void diff(CSSMutableStyleDeclaration*) const; |
|
73 |
|
74 PassRefPtr<CSSMutableStyleDeclaration> copyPropertiesInSet(const int* set, unsigned length) const; |
|
75 |
|
76 protected: |
|
77 CSSStyleDeclaration(CSSRule* parentRule = 0); |
|
78 |
|
79 private: |
|
80 CSSStyleDeclaration(const CSSStyleDeclaration&); |
|
81 CSSStyleDeclaration& operator=(const CSSStyleDeclaration&); |
|
82 }; |
|
83 |
|
84 } // namespace WebCore |
|
85 |
|
86 #endif // CSSStyleDeclaration_h |