• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

  • tdehtml
  • dom
css_rule.cpp
1 
23 #include "css/css_ruleimpl.h"
24 
25 using namespace DOM;
26 
27 CSSRule::CSSRule()
28 {
29  impl = 0;
30 }
31 
32 CSSRule::CSSRule(const CSSRule &other)
33 {
34  impl = other.impl;
35  if(impl) impl->ref();
36 }
37 
38 CSSRule::CSSRule(CSSRuleImpl *i)
39 {
40  impl = i;
41  if(impl) impl->ref();
42 }
43 
44 CSSRule &CSSRule::operator = (const CSSRule &other)
45 {
46  if ( impl != other.impl ) {
47  if(impl) impl->deref();
48  impl = other.impl;
49  if(impl) impl->ref();
50  }
51  return *this;
52 }
53 
54 CSSRule::~CSSRule()
55 {
56  if(impl) impl->deref();
57 }
58 
59 unsigned short CSSRule::type() const
60 {
61  if(!impl) return 0;
62  return ((CSSRuleImpl *)impl)->type();
63 }
64 
65 DOMString CSSRule::cssText() const
66 {
67  if(!impl) return DOMString();
68  return impl->cssText();
69 }
70 
71 void CSSRule::setCssText( const DOMString &value )
72 {
73  if(!impl) return;
74  impl->setCssText(value);
75 }
76 
77 CSSStyleSheet CSSRule::parentStyleSheet() const
78 {
79  if(!impl) return CSSStyleSheet();
80  return ((CSSRuleImpl *)impl)->parentStyleSheet();
81 }
82 
83 CSSRule CSSRule::parentRule() const
84 {
85  if(!impl) return 0;
86  return ((CSSRuleImpl *)impl)->parentRule();
87 }
88 
89 CSSRuleImpl *CSSRule::handle() const
90 {
91  return impl;
92 }
93 
94 bool CSSRule::isNull() const
95 {
96  return (impl == 0);
97 }
98 
99 void CSSRule::assignOther( const CSSRule &other, RuleType thisType )
100 {
101  if (other.type() != thisType ) {
102  if ( impl ) impl->deref();
103  impl = 0;
104  } else
105  CSSRule::operator = ( other );
106 }
107 
108 // ----------------------------------------------------------
109 
110 
111 CSSCharsetRule::CSSCharsetRule()
112  : CSSRule()
113 {
114 }
115 
116 CSSCharsetRule::CSSCharsetRule(const CSSCharsetRule &other) : CSSRule(other)
117 {
118 }
119 
120 CSSCharsetRule::CSSCharsetRule(const CSSRule &other)
121 {
122  impl = 0;
123  operator=(other);
124 }
125 
126 CSSCharsetRule::CSSCharsetRule(CSSCharsetRuleImpl *impl) : CSSRule(impl)
127 {
128 }
129 
130 CSSCharsetRule &CSSCharsetRule::operator = (const CSSCharsetRule &other)
131 {
132  CSSRule::operator = (other);
133  return *this;
134 }
135 
136 CSSCharsetRule &CSSCharsetRule::operator = (const CSSRule &other)
137 {
138  assignOther( other, CSSRule::CHARSET_RULE);
139  return *this;
140 }
141 
142 CSSCharsetRule::~CSSCharsetRule()
143 {
144 }
145 
146 DOMString CSSCharsetRule::encoding() const
147 {
148  if(!impl) return DOMString();
149  return ((CSSCharsetRuleImpl*)impl)->encoding();
150 }
151 
152 void CSSCharsetRule::setEncoding( const DOMString &value )
153 {
154  ((CSSCharsetRuleImpl*)impl)->setEncoding(value);
155 }
156 
157 
158 // ----------------------------------------------------------
159 
160 
161 CSSFontFaceRule::CSSFontFaceRule() : CSSRule()
162 {
163 }
164 
165 CSSFontFaceRule::CSSFontFaceRule(const CSSFontFaceRule &other) : CSSRule(other)
166 {
167 }
168 
169 CSSFontFaceRule::CSSFontFaceRule(const CSSRule &other)
170 {
171  impl = 0;
172  operator=(other);
173 }
174 
175 CSSFontFaceRule::CSSFontFaceRule(CSSFontFaceRuleImpl *impl) : CSSRule(impl)
176 {
177 }
178 
179 CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSFontFaceRule &other)
180 {
181  CSSRule::operator = (other);
182  return *this;
183 }
184 
185 CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSRule &other)
186 {
187  assignOther( other, CSSRule::FONT_FACE_RULE );
188  return *this;
189 }
190 
191 CSSFontFaceRule::~CSSFontFaceRule()
192 {
193 }
194 
195 CSSStyleDeclaration CSSFontFaceRule::style() const
196 {
197  if(!impl) return CSSStyleDeclaration();
198  return ((CSSFontFaceRuleImpl *)impl)->style();
199 }
200 
201 
202 // ----------------------------------------------------------
203 
204 
205 CSSImportRule::CSSImportRule() : CSSRule()
206 {
207 }
208 
209 CSSImportRule::CSSImportRule(const CSSImportRule &other) : CSSRule(other)
210 {
211 }
212 
213 CSSImportRule::CSSImportRule(const CSSRule &other)
214 {
215  impl = 0;
216  operator=(other);
217 }
218 
219 CSSImportRule::CSSImportRule(CSSImportRuleImpl *impl) : CSSRule(impl)
220 {
221 }
222 
223 CSSImportRule &CSSImportRule::operator = (const CSSImportRule &other)
224 {
225  CSSRule::operator = (other);
226  return *this;
227 }
228 
229 CSSImportRule &CSSImportRule::operator = (const CSSRule &other)
230 {
231  assignOther( other, CSSRule::IMPORT_RULE );
232  return *this;
233 }
234 
235 CSSImportRule::~CSSImportRule()
236 {
237 }
238 
239 DOMString CSSImportRule::href() const
240 {
241  if(!impl) return DOMString();
242  return ((CSSImportRuleImpl *)impl)->href();
243 }
244 
245 MediaList CSSImportRule::media() const
246 {
247  if(!impl) return MediaList();
248  return ((CSSImportRuleImpl *)impl)->media();
249 }
250 
251 CSSStyleSheet CSSImportRule::styleSheet() const
252 {
253  if(!impl) return CSSStyleSheet();
254  return ((CSSImportRuleImpl *)impl)->styleSheet();
255 }
256 
257 
258 // ----------------------------------------------------------
259 
260 
261 CSSMediaRule::CSSMediaRule() : CSSRule()
262 {
263 }
264 
265 CSSMediaRule::CSSMediaRule(const CSSMediaRule &other) : CSSRule(other)
266 {
267 }
268 
269 CSSMediaRule::CSSMediaRule(const CSSRule &other)
270 {
271  impl = 0;
272  operator=(other);
273 }
274 
275 CSSMediaRule::CSSMediaRule(CSSMediaRuleImpl *impl) : CSSRule(impl)
276 {
277 }
278 
279 CSSMediaRule &CSSMediaRule::operator = (const CSSMediaRule &other)
280 {
281  CSSRule::operator = (other);
282  return *this;
283 }
284 
285 CSSMediaRule &CSSMediaRule::operator = (const CSSRule &other)
286 {
287  assignOther( other, CSSRule::MEDIA_RULE );
288  return *this;
289 }
290 
291 CSSMediaRule::~CSSMediaRule()
292 {
293 }
294 
295 MediaList CSSMediaRule::media() const
296 {
297  if(!impl) return MediaList();
298  return ((CSSMediaRuleImpl *)impl)->media();
299 }
300 
301 CSSRuleList CSSMediaRule::cssRules() const
302 {
303  if(!impl) return CSSRuleList();
304  return ((CSSMediaRuleImpl *)impl)->cssRules();
305 }
306 
307 unsigned long CSSMediaRule::insertRule( const DOMString &rule, unsigned long index )
308 {
309  if(!impl) return 0;
310  return ((CSSMediaRuleImpl *)impl)->insertRule( rule, index );
311 }
312 
313 void CSSMediaRule::deleteRule( unsigned long index )
314 {
315  if(impl)
316  ((CSSMediaRuleImpl *)impl)->deleteRule( index );
317 }
318 
319 
320 // ----------------------------------------------------------
321 
322 
323 CSSPageRule::CSSPageRule() : CSSRule()
324 {
325 }
326 
327 CSSPageRule::CSSPageRule(const CSSPageRule &other) : CSSRule(other)
328 {
329 }
330 
331 CSSPageRule::CSSPageRule(const CSSRule &other)
332 {
333  impl = 0;
334  operator=(other);
335 }
336 
337 CSSPageRule::CSSPageRule(CSSPageRuleImpl *impl) : CSSRule(impl)
338 {
339 }
340 
341 CSSPageRule &CSSPageRule::operator = (const CSSPageRule &other)
342 {
343  CSSRule::operator = (other);
344  return *this;
345 }
346 
347 CSSPageRule &CSSPageRule::operator = (const CSSRule &other)
348 {
349  assignOther( other, CSSRule::PAGE_RULE );
350  return *this;
351 }
352 
353 CSSPageRule::~CSSPageRule()
354 {
355 }
356 
357 DOMString CSSPageRule::selectorText() const
358 {
359  if(!impl) return DOMString();
360  return ((CSSPageRuleImpl*)impl)->selectorText();
361 }
362 
363 void CSSPageRule::setSelectorText( const DOMString &value )
364 {
365  ((CSSPageRuleImpl*)impl)->setSelectorText(value);
366 }
367 
368 CSSStyleDeclaration CSSPageRule::style() const
369 {
370  if(!impl) return CSSStyleDeclaration();
371  return ((CSSPageRuleImpl *)impl)->style();
372 }
373 
374 
375 // ----------------------------------------------------------
376 
377 CSSStyleRule::CSSStyleRule() : CSSRule()
378 {
379 }
380 
381 CSSStyleRule::CSSStyleRule(const CSSStyleRule &other)
382  : CSSRule(other)
383 {
384 }
385 
386 CSSStyleRule::CSSStyleRule(const CSSRule &other)
387 {
388  impl = 0;
389  operator=(other);
390 }
391 
392 
393 CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *impl)
394  : CSSRule(impl)
395 {
396 }
397 
398 CSSStyleRule &CSSStyleRule::operator = (const CSSStyleRule &other)
399 {
400  CSSRule::operator = (other);
401  return *this;
402 }
403 
404 CSSStyleRule &CSSStyleRule::operator = (const CSSRule &other)
405 {
406  assignOther( other, CSSRule::STYLE_RULE );
407  return *this;
408 }
409 
410 CSSStyleRule::~CSSStyleRule()
411 {
412 }
413 
414 DOMString CSSStyleRule::selectorText() const
415 {
416  if(!impl) return DOMString();
417  return ((CSSStyleRuleImpl*)impl)->selectorText();
418 }
419 
420 void CSSStyleRule::setSelectorText( const DOMString &value )
421 {
422  ((CSSStyleRuleImpl*)impl)->setSelectorText(value);
423 }
424 
425 CSSStyleDeclaration CSSStyleRule::style() const
426 {
427  if(!impl) return CSSStyleDeclaration();
428  return ((CSSStyleRuleImpl *)impl)->style();
429 }
430 
431 
432 // ----------------------------------------------------------
433 
434 
435 CSSUnknownRule::CSSUnknownRule() : CSSRule()
436 {
437 }
438 
439 CSSUnknownRule::CSSUnknownRule(const CSSUnknownRule &other)
440  : CSSRule(other)
441 {
442 }
443 
444 CSSUnknownRule::CSSUnknownRule(const CSSRule &other)
445 {
446  impl = 0;
447  operator=(other);
448 }
449 
450 CSSUnknownRule::CSSUnknownRule(CSSUnknownRuleImpl *impl)
451  : CSSRule(impl)
452 {
453 }
454 
455 CSSUnknownRule &CSSUnknownRule::operator = (const CSSUnknownRule &other)
456 {
457  CSSRule::operator = (other);
458  return *this;
459 }
460 
461 CSSUnknownRule &CSSUnknownRule::operator = (const CSSRule &other)
462 {
463  assignOther( other, CSSRule::UNKNOWN_RULE );
464  return *this;
465 }
466 
467 CSSUnknownRule::~CSSUnknownRule()
468 {
469 }
470 
471 
472 // ----------------------------------------------------------
473 
474 CSSRuleList::CSSRuleList()
475 {
476  impl = 0;
477 }
478 
479 CSSRuleList::CSSRuleList(const CSSRuleList &other)
480 {
481  impl = other.impl;
482  if(impl) impl->ref();
483 }
484 
485 CSSRuleList::CSSRuleList(CSSRuleListImpl *i)
486 {
487  impl = i;
488  if(impl) impl->ref();
489 }
490 
491 CSSRuleList::CSSRuleList(StyleListImpl *lst)
492 {
493  impl = new CSSRuleListImpl;
494  impl->ref();
495  if (lst)
496  {
497  for( unsigned long i = 0; i < lst->length() ; ++i )
498  {
499  StyleBaseImpl* style = lst->item( i );
500  if ( style->isRule() )
501  impl->insertRule( static_cast<CSSRuleImpl *>(style), impl->length() );
502  }
503  }
504 }
505 
506 CSSRuleList &CSSRuleList::operator = (const CSSRuleList &other)
507 {
508  if ( impl != other.impl ) {
509  if(impl) impl->deref();
510  impl = other.impl;
511  if(impl) impl->ref();
512  }
513  return *this;
514 }
515 
516 CSSRuleList::~CSSRuleList()
517 {
518  if(impl) impl->deref();
519 }
520 
521 unsigned long CSSRuleList::length() const
522 {
523  if(!impl) return 0;
524  return ((CSSRuleListImpl *)impl)->length();
525  return 0;
526 }
527 
528 CSSRule CSSRuleList::item( unsigned long index )
529 {
530  if(!impl) return CSSRule();
531  return ((CSSRuleListImpl *)impl)->item( index );
532 }
533 
534 CSSRuleListImpl *CSSRuleList::handle() const
535 {
536  return impl;
537 }
538 
539 bool CSSRuleList::isNull() const
540 {
541  return (impl == 0);
542 }
543 
544 
545 
546 
DOM::CSSCharsetRule
The CSSCharsetRule interface a @charset rule in a CSS style sheet.
Definition: css_rule.h:150
DOM::CSSCharsetRule::setEncoding
void setEncoding(const DOM::DOMString &)
see encoding
Definition: css_rule.cpp:152
DOM::CSSCharsetRule::encoding
DOM::DOMString encoding() const
The encoding information used in this @charset rule.
Definition: css_rule.cpp:146
DOM::CSSFontFaceRule
The CSSFontFaceRule interface represents a @font-face rule in a CSS style sheet.
Definition: css_rule.h:194
DOM::CSSFontFaceRule::style
CSSStyleDeclaration style() const
The declaration-block of this rule.
Definition: css_rule.cpp:195
DOM::CSSImportRule
The CSSImportRule interface represents a @import rule within a CSS style sheet.
Definition: css_rule.h:224
DOM::CSSImportRule::href
DOM::DOMString href() const
The location of the style sheet to be imported.
Definition: css_rule.cpp:239
DOM::CSSImportRule::media
MediaList media() const
A list of media types for which this style sheet may be used.
Definition: css_rule.cpp:245
DOM::CSSImportRule::styleSheet
CSSStyleSheet styleSheet() const
The style sheet referred to by this rule, if it has been loaded.
Definition: css_rule.cpp:251
DOM::CSSMediaRule
The CSSMediaRule interface represents a @media rule in a CSS style sheet.
Definition: css_rule.h:271
DOM::CSSMediaRule::insertRule
unsigned long insertRule(const DOM::DOMString &rule, unsigned long index)
Used to insert a new rule into the media block.
Definition: css_rule.cpp:307
DOM::CSSMediaRule::media
MediaList media() const
A list of media types for this rule.
Definition: css_rule.cpp:295
DOM::CSSMediaRule::cssRules
CSSRuleList cssRules() const
A list of all CSS rules contained within the media block.
Definition: css_rule.cpp:301
DOM::CSSMediaRule::deleteRule
void deleteRule(unsigned long index)
Used to delete a rule from the media block.
Definition: css_rule.cpp:313
DOM::CSSRuleList
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules.
Definition: css_rule.h:485
DOM::CSSRuleList::length
unsigned long length() const
The number of CSSRule s in the list.
Definition: css_rule.cpp:521
DOM::CSSRuleList::item
CSSRule item(unsigned long index)
Used to retrieve a CSS rule by ordinal index.
Definition: css_rule.cpp:528
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement .
Definition: css_rule.h:53
DOM::CSSRule::setCssText
void setCssText(const DOM::DOMString &)
see cssText
Definition: css_rule.cpp:71
DOM::CSSRule::parentStyleSheet
CSSStyleSheet parentStyleSheet() const
The style sheet that contains this rule.
Definition: css_rule.cpp:77
DOM::CSSRule::cssText
DOM::DOMString cssText() const
The parsable textual representation of the rule.
Definition: css_rule.cpp:65
DOM::CSSRule::parentRule
CSSRule parentRule() const
If this rule is contained inside another rule (e.g.
Definition: css_rule.cpp:83
DOM::CSSRule::type
unsigned short type() const
The type of the rule, as defined above.
Definition: css_rule.cpp:59
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:61
DOM::CSSStyleRule
The CSSStyleRule interface represents a single rule set in a CSS style sheet.
Definition: css_rule.h:412
DOM::CSSStyleRule::selectorText
DOM::DOMString selectorText() const
The textual representation of the selector for the rule set.
Definition: css_rule.cpp:414
DOM::CSSStyleRule::setSelectorText
void setSelectorText(const DOM::DOMString &)
see selectorText
Definition: css_rule.cpp:420
DOM::CSSStyleRule::style
CSSStyleDeclaration style() const
The declaration-block of this rule set.
Definition: css_rule.cpp:425
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i....
Definition: css_stylesheet.h:208
DOM::CSSUnknownRule
The CSSUnkownRule interface represents an at-rule not supported by this user agent.
Definition: css_rule.h:462
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::MediaList
The MediaList interface provides the abstraction of an ordered collection of media,...
Definition: css_stylesheet.h:364
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:57

tdehtml

Skip menu "tdehtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.9.1
This website is maintained by Timothy Pearson.