23#include "css/css_ruleimpl.h"
32CSSRule::CSSRule(
const CSSRule &other)
38CSSRule::CSSRule(CSSRuleImpl *i)
46 if ( impl != other.impl ) {
47 if(impl) impl->deref();
56 if(impl) impl->deref();
62 return ((CSSRuleImpl *)impl)->type();
68 return impl->cssText();
74 impl->setCssText(value);
80 return ((CSSRuleImpl *)impl)->parentStyleSheet();
89CSSRuleImpl *CSSRule::handle()
const
94bool CSSRule::isNull()
const
99void CSSRule::assignOther(
const CSSRule &other, RuleType thisType )
101 if (other.
type() != thisType ) {
102 if ( impl ) impl->deref();
105 CSSRule::operator = ( other );
111CSSCharsetRule::CSSCharsetRule()
120CSSCharsetRule::CSSCharsetRule(
const CSSRule &other)
126CSSCharsetRule::CSSCharsetRule(CSSCharsetRuleImpl *impl) :
CSSRule(impl)
132 CSSRule::operator = (other);
138 assignOther( other, CSSRule::CHARSET_RULE);
142CSSCharsetRule::~CSSCharsetRule()
149 return ((CSSCharsetRuleImpl*)impl)->encoding();
154 ((CSSCharsetRuleImpl*)impl)->setEncoding(value);
161CSSFontFaceRule::CSSFontFaceRule() :
CSSRule()
169CSSFontFaceRule::CSSFontFaceRule(
const CSSRule &other)
175CSSFontFaceRule::CSSFontFaceRule(CSSFontFaceRuleImpl *impl) :
CSSRule(impl)
181 CSSRule::operator = (other);
187 assignOther( other, CSSRule::FONT_FACE_RULE );
191CSSFontFaceRule::~CSSFontFaceRule()
198 return ((CSSFontFaceRuleImpl *)impl)->style();
205CSSImportRule::CSSImportRule() :
CSSRule()
213CSSImportRule::CSSImportRule(
const CSSRule &other)
219CSSImportRule::CSSImportRule(CSSImportRuleImpl *impl) :
CSSRule(impl)
225 CSSRule::operator = (other);
231 assignOther( other, CSSRule::IMPORT_RULE );
235CSSImportRule::~CSSImportRule()
242 return ((CSSImportRuleImpl *)impl)->href();
248 return ((CSSImportRuleImpl *)impl)->media();
254 return ((CSSImportRuleImpl *)impl)->styleSheet();
261CSSMediaRule::CSSMediaRule() :
CSSRule()
269CSSMediaRule::CSSMediaRule(
const CSSRule &other)
275CSSMediaRule::CSSMediaRule(CSSMediaRuleImpl *impl) :
CSSRule(impl)
281 CSSRule::operator = (other);
287 assignOther( other, CSSRule::MEDIA_RULE );
291CSSMediaRule::~CSSMediaRule()
298 return ((CSSMediaRuleImpl *)impl)->media();
304 return ((CSSMediaRuleImpl *)impl)->cssRules();
310 return ((CSSMediaRuleImpl *)impl)->insertRule( rule, index );
316 ((CSSMediaRuleImpl *)impl)->deleteRule( index );
323CSSPageRule::CSSPageRule() :
CSSRule()
327CSSPageRule::CSSPageRule(
const CSSPageRule &other) :
CSSRule(other)
331CSSPageRule::CSSPageRule(
const CSSRule &other)
337CSSPageRule::CSSPageRule(CSSPageRuleImpl *impl) :
CSSRule(impl)
341CSSPageRule &CSSPageRule::operator = (
const CSSPageRule &other)
343 CSSRule::operator = (other);
347CSSPageRule &CSSPageRule::operator = (
const CSSRule &other)
349 assignOther( other, CSSRule::PAGE_RULE );
353CSSPageRule::~CSSPageRule()
357DOMString CSSPageRule::selectorText()
const
360 return ((CSSPageRuleImpl*)impl)->selectorText();
363void CSSPageRule::setSelectorText(
const DOMString &value )
365 ((CSSPageRuleImpl*)impl)->setSelectorText(value);
371 return ((CSSPageRuleImpl *)impl)->style();
377CSSStyleRule::CSSStyleRule() :
CSSRule()
386CSSStyleRule::CSSStyleRule(
const CSSRule &other)
393CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *impl)
400 CSSRule::operator = (other);
406 assignOther( other, CSSRule::STYLE_RULE );
410CSSStyleRule::~CSSStyleRule()
417 return ((CSSStyleRuleImpl*)impl)->selectorText();
422 ((CSSStyleRuleImpl*)impl)->setSelectorText(value);
428 return ((CSSStyleRuleImpl *)impl)->style();
435CSSUnknownRule::CSSUnknownRule() :
CSSRule()
444CSSUnknownRule::CSSUnknownRule(
const CSSRule &other)
450CSSUnknownRule::CSSUnknownRule(CSSUnknownRuleImpl *impl)
457 CSSRule::operator = (other);
463 assignOther( other, CSSRule::UNKNOWN_RULE );
467CSSUnknownRule::~CSSUnknownRule()
474CSSRuleList::CSSRuleList()
482 if(impl) impl->ref();
485CSSRuleList::CSSRuleList(CSSRuleListImpl *i)
488 if(impl) impl->ref();
491CSSRuleList::CSSRuleList(StyleListImpl *lst)
493 impl =
new CSSRuleListImpl;
497 for(
unsigned long i = 0; i < lst->length() ; ++i )
499 StyleBaseImpl* style = lst->item( i );
500 if ( style->isRule() )
501 impl->insertRule(
static_cast<CSSRuleImpl *
>(style), impl->length() );
508 if ( impl != other.impl ) {
509 if(impl) impl->deref();
511 if(impl) impl->ref();
516CSSRuleList::~CSSRuleList()
518 if(impl) impl->deref();
524 return ((CSSRuleListImpl *)impl)->length();
531 return ((CSSRuleListImpl *)impl)->item( index );
534CSSRuleListImpl *CSSRuleList::handle()
const
539bool CSSRuleList::isNull()
const
The CSSCharsetRule interface a @charset rule in a CSS style sheet.
void setEncoding(const DOM::DOMString &)
see encoding
DOM::DOMString encoding() const
The encoding information used in this @charset rule.
The CSSFontFaceRule interface represents a @font-face rule in a CSS style sheet.
CSSStyleDeclaration style() const
The declaration-block of this rule.
The CSSImportRule interface represents a @import rule within a CSS style sheet.
DOM::DOMString href() const
The location of the style sheet to be imported.
MediaList media() const
A list of media types for which this style sheet may be used.
CSSStyleSheet styleSheet() const
The style sheet referred to by this rule, if it has been loaded.
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules.
unsigned long length() const
The number of CSSRule s in the list.
CSSRule item(unsigned long index)
Used to retrieve a CSS rule by ordinal index.
The CSSRule interface is the abstract base interface for any type of CSS statement .
void setCssText(const DOM::DOMString &)
see cssText
CSSStyleSheet parentStyleSheet() const
The style sheet that contains this rule.
DOM::DOMString cssText() const
The parsable textual representation of the rule.
CSSRule parentRule() const
If this rule is contained inside another rule (e.g.
unsigned short type() const
The type of the rule, as defined above.
The CSSStyleDeclaration interface represents a single CSS declaration block .
The CSSStyleRule interface represents a single rule set in a CSS style sheet.
DOM::DOMString selectorText() const
The textual representation of the selector for the rule set.
void setSelectorText(const DOM::DOMString &)
see selectorText
CSSStyleDeclaration style() const
The declaration-block of this rule set.
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i....
The CSSUnkownRule interface represents an at-rule not supported by this user agent.
This class implements the basic string we use in the DOM.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...