23 #include "css/css_ruleimpl.h"
32 CSSRule::CSSRule(
const CSSRule &other)
38 CSSRule::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();
89 CSSRuleImpl *CSSRule::handle()
const
94 bool CSSRule::isNull()
const
99 void CSSRule::assignOther(
const CSSRule &other, RuleType thisType )
101 if (other.
type() != thisType ) {
102 if ( impl ) impl->deref();
105 CSSRule::operator = ( other );
111 CSSCharsetRule::CSSCharsetRule()
120 CSSCharsetRule::CSSCharsetRule(
const CSSRule &other)
126 CSSCharsetRule::CSSCharsetRule(CSSCharsetRuleImpl *impl) :
CSSRule(impl)
132 CSSRule::operator = (other);
138 assignOther( other, CSSRule::CHARSET_RULE);
142 CSSCharsetRule::~CSSCharsetRule()
149 return ((CSSCharsetRuleImpl*)impl)->encoding();
154 ((CSSCharsetRuleImpl*)impl)->setEncoding(value);
161 CSSFontFaceRule::CSSFontFaceRule() :
CSSRule()
169 CSSFontFaceRule::CSSFontFaceRule(
const CSSRule &other)
175 CSSFontFaceRule::CSSFontFaceRule(CSSFontFaceRuleImpl *impl) :
CSSRule(impl)
181 CSSRule::operator = (other);
187 assignOther( other, CSSRule::FONT_FACE_RULE );
191 CSSFontFaceRule::~CSSFontFaceRule()
198 return ((CSSFontFaceRuleImpl *)impl)->style();
205 CSSImportRule::CSSImportRule() :
CSSRule()
213 CSSImportRule::CSSImportRule(
const CSSRule &other)
219 CSSImportRule::CSSImportRule(CSSImportRuleImpl *impl) :
CSSRule(impl)
225 CSSRule::operator = (other);
231 assignOther( other, CSSRule::IMPORT_RULE );
235 CSSImportRule::~CSSImportRule()
242 return ((CSSImportRuleImpl *)impl)->href();
248 return ((CSSImportRuleImpl *)impl)->media();
254 return ((CSSImportRuleImpl *)impl)->styleSheet();
261 CSSMediaRule::CSSMediaRule() :
CSSRule()
269 CSSMediaRule::CSSMediaRule(
const CSSRule &other)
275 CSSMediaRule::CSSMediaRule(CSSMediaRuleImpl *impl) :
CSSRule(impl)
281 CSSRule::operator = (other);
287 assignOther( other, CSSRule::MEDIA_RULE );
291 CSSMediaRule::~CSSMediaRule()
298 return ((CSSMediaRuleImpl *)impl)->media();
304 return ((CSSMediaRuleImpl *)impl)->cssRules();
310 return ((CSSMediaRuleImpl *)impl)->insertRule( rule, index );
316 ((CSSMediaRuleImpl *)impl)->deleteRule( index );
323 CSSPageRule::CSSPageRule() :
CSSRule()
327 CSSPageRule::CSSPageRule(
const CSSPageRule &other) :
CSSRule(other)
331 CSSPageRule::CSSPageRule(
const CSSRule &other)
337 CSSPageRule::CSSPageRule(CSSPageRuleImpl *impl) :
CSSRule(impl)
341 CSSPageRule &CSSPageRule::operator = (
const CSSPageRule &other)
343 CSSRule::operator = (other);
347 CSSPageRule &CSSPageRule::operator = (
const CSSRule &other)
349 assignOther( other, CSSRule::PAGE_RULE );
353 CSSPageRule::~CSSPageRule()
357 DOMString CSSPageRule::selectorText()
const
360 return ((CSSPageRuleImpl*)impl)->selectorText();
363 void CSSPageRule::setSelectorText(
const DOMString &value )
365 ((CSSPageRuleImpl*)impl)->setSelectorText(value);
371 return ((CSSPageRuleImpl *)impl)->style();
377 CSSStyleRule::CSSStyleRule() :
CSSRule()
386 CSSStyleRule::CSSStyleRule(
const CSSRule &other)
393 CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *impl)
400 CSSRule::operator = (other);
406 assignOther( other, CSSRule::STYLE_RULE );
410 CSSStyleRule::~CSSStyleRule()
417 return ((CSSStyleRuleImpl*)impl)->selectorText();
422 ((CSSStyleRuleImpl*)impl)->setSelectorText(value);
428 return ((CSSStyleRuleImpl *)impl)->style();
435 CSSUnknownRule::CSSUnknownRule() :
CSSRule()
444 CSSUnknownRule::CSSUnknownRule(
const CSSRule &other)
450 CSSUnknownRule::CSSUnknownRule(CSSUnknownRuleImpl *impl)
457 CSSRule::operator = (other);
463 assignOther( other, CSSRule::UNKNOWN_RULE );
467 CSSUnknownRule::~CSSUnknownRule()
474 CSSRuleList::CSSRuleList()
482 if(impl) impl->ref();
485 CSSRuleList::CSSRuleList(CSSRuleListImpl *i)
488 if(impl) impl->ref();
491 CSSRuleList::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();
516 CSSRuleList::~CSSRuleList()
518 if(impl) impl->deref();
524 return ((CSSRuleListImpl *)impl)->length();
531 return ((CSSRuleListImpl *)impl)->item( index );
534 CSSRuleListImpl *CSSRuleList::handle()
const
539 bool 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...