• 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
25using namespace DOM;
26
27CSSRule::CSSRule()
28{
29 impl = 0;
30}
31
32CSSRule::CSSRule(const CSSRule &other)
33{
34 impl = other.impl;
35 if(impl) impl->ref();
36}
37
38CSSRule::CSSRule(CSSRuleImpl *i)
39{
40 impl = i;
41 if(impl) impl->ref();
42}
43
44CSSRule &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
54CSSRule::~CSSRule()
55{
56 if(impl) impl->deref();
57}
58
59unsigned short CSSRule::type() const
60{
61 if(!impl) return 0;
62 return ((CSSRuleImpl *)impl)->type();
63}
64
65DOMString CSSRule::cssText() const
66{
67 if(!impl) return DOMString();
68 return impl->cssText();
69}
70
71void CSSRule::setCssText( const DOMString &value )
72{
73 if(!impl) return;
74 impl->setCssText(value);
75}
76
77CSSStyleSheet CSSRule::parentStyleSheet() const
78{
79 if(!impl) return CSSStyleSheet();
80 return ((CSSRuleImpl *)impl)->parentStyleSheet();
81}
82
83CSSRule CSSRule::parentRule() const
84{
85 if(!impl) return 0;
86 return ((CSSRuleImpl *)impl)->parentRule();
87}
88
89CSSRuleImpl *CSSRule::handle() const
90{
91 return impl;
92}
93
94bool CSSRule::isNull() const
95{
96 return (impl == 0);
97}
98
99void 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
111CSSCharsetRule::CSSCharsetRule()
112 : CSSRule()
113{
114}
115
116CSSCharsetRule::CSSCharsetRule(const CSSCharsetRule &other) : CSSRule(other)
117{
118}
119
120CSSCharsetRule::CSSCharsetRule(const CSSRule &other)
121{
122 impl = 0;
123 operator=(other);
124}
125
126CSSCharsetRule::CSSCharsetRule(CSSCharsetRuleImpl *impl) : CSSRule(impl)
127{
128}
129
130CSSCharsetRule &CSSCharsetRule::operator = (const CSSCharsetRule &other)
131{
132 CSSRule::operator = (other);
133 return *this;
134}
135
136CSSCharsetRule &CSSCharsetRule::operator = (const CSSRule &other)
137{
138 assignOther( other, CSSRule::CHARSET_RULE);
139 return *this;
140}
141
142CSSCharsetRule::~CSSCharsetRule()
143{
144}
145
146DOMString CSSCharsetRule::encoding() const
147{
148 if(!impl) return DOMString();
149 return ((CSSCharsetRuleImpl*)impl)->encoding();
150}
151
152void CSSCharsetRule::setEncoding( const DOMString &value )
153{
154 ((CSSCharsetRuleImpl*)impl)->setEncoding(value);
155}
156
157
158// ----------------------------------------------------------
159
160
161CSSFontFaceRule::CSSFontFaceRule() : CSSRule()
162{
163}
164
165CSSFontFaceRule::CSSFontFaceRule(const CSSFontFaceRule &other) : CSSRule(other)
166{
167}
168
169CSSFontFaceRule::CSSFontFaceRule(const CSSRule &other)
170{
171 impl = 0;
172 operator=(other);
173}
174
175CSSFontFaceRule::CSSFontFaceRule(CSSFontFaceRuleImpl *impl) : CSSRule(impl)
176{
177}
178
179CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSFontFaceRule &other)
180{
181 CSSRule::operator = (other);
182 return *this;
183}
184
185CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSRule &other)
186{
187 assignOther( other, CSSRule::FONT_FACE_RULE );
188 return *this;
189}
190
191CSSFontFaceRule::~CSSFontFaceRule()
192{
193}
194
195CSSStyleDeclaration CSSFontFaceRule::style() const
196{
197 if(!impl) return CSSStyleDeclaration();
198 return ((CSSFontFaceRuleImpl *)impl)->style();
199}
200
201
202// ----------------------------------------------------------
203
204
205CSSImportRule::CSSImportRule() : CSSRule()
206{
207}
208
209CSSImportRule::CSSImportRule(const CSSImportRule &other) : CSSRule(other)
210{
211}
212
213CSSImportRule::CSSImportRule(const CSSRule &other)
214{
215 impl = 0;
216 operator=(other);
217}
218
219CSSImportRule::CSSImportRule(CSSImportRuleImpl *impl) : CSSRule(impl)
220{
221}
222
223CSSImportRule &CSSImportRule::operator = (const CSSImportRule &other)
224{
225 CSSRule::operator = (other);
226 return *this;
227}
228
229CSSImportRule &CSSImportRule::operator = (const CSSRule &other)
230{
231 assignOther( other, CSSRule::IMPORT_RULE );
232 return *this;
233}
234
235CSSImportRule::~CSSImportRule()
236{
237}
238
239DOMString CSSImportRule::href() const
240{
241 if(!impl) return DOMString();
242 return ((CSSImportRuleImpl *)impl)->href();
243}
244
245MediaList CSSImportRule::media() const
246{
247 if(!impl) return MediaList();
248 return ((CSSImportRuleImpl *)impl)->media();
249}
250
251CSSStyleSheet CSSImportRule::styleSheet() const
252{
253 if(!impl) return CSSStyleSheet();
254 return ((CSSImportRuleImpl *)impl)->styleSheet();
255}
256
257
258// ----------------------------------------------------------
259
260
261CSSMediaRule::CSSMediaRule() : CSSRule()
262{
263}
264
265CSSMediaRule::CSSMediaRule(const CSSMediaRule &other) : CSSRule(other)
266{
267}
268
269CSSMediaRule::CSSMediaRule(const CSSRule &other)
270{
271 impl = 0;
272 operator=(other);
273}
274
275CSSMediaRule::CSSMediaRule(CSSMediaRuleImpl *impl) : CSSRule(impl)
276{
277}
278
279CSSMediaRule &CSSMediaRule::operator = (const CSSMediaRule &other)
280{
281 CSSRule::operator = (other);
282 return *this;
283}
284
285CSSMediaRule &CSSMediaRule::operator = (const CSSRule &other)
286{
287 assignOther( other, CSSRule::MEDIA_RULE );
288 return *this;
289}
290
291CSSMediaRule::~CSSMediaRule()
292{
293}
294
295MediaList CSSMediaRule::media() const
296{
297 if(!impl) return MediaList();
298 return ((CSSMediaRuleImpl *)impl)->media();
299}
300
301CSSRuleList CSSMediaRule::cssRules() const
302{
303 if(!impl) return CSSRuleList();
304 return ((CSSMediaRuleImpl *)impl)->cssRules();
305}
306
307unsigned long CSSMediaRule::insertRule( const DOMString &rule, unsigned long index )
308{
309 if(!impl) return 0;
310 return ((CSSMediaRuleImpl *)impl)->insertRule( rule, index );
311}
312
313void CSSMediaRule::deleteRule( unsigned long index )
314{
315 if(impl)
316 ((CSSMediaRuleImpl *)impl)->deleteRule( index );
317}
318
319
320// ----------------------------------------------------------
321
322
323CSSPageRule::CSSPageRule() : CSSRule()
324{
325}
326
327CSSPageRule::CSSPageRule(const CSSPageRule &other) : CSSRule(other)
328{
329}
330
331CSSPageRule::CSSPageRule(const CSSRule &other)
332{
333 impl = 0;
334 operator=(other);
335}
336
337CSSPageRule::CSSPageRule(CSSPageRuleImpl *impl) : CSSRule(impl)
338{
339}
340
341CSSPageRule &CSSPageRule::operator = (const CSSPageRule &other)
342{
343 CSSRule::operator = (other);
344 return *this;
345}
346
347CSSPageRule &CSSPageRule::operator = (const CSSRule &other)
348{
349 assignOther( other, CSSRule::PAGE_RULE );
350 return *this;
351}
352
353CSSPageRule::~CSSPageRule()
354{
355}
356
357DOMString CSSPageRule::selectorText() const
358{
359 if(!impl) return DOMString();
360 return ((CSSPageRuleImpl*)impl)->selectorText();
361}
362
363void CSSPageRule::setSelectorText( const DOMString &value )
364{
365 ((CSSPageRuleImpl*)impl)->setSelectorText(value);
366}
367
368CSSStyleDeclaration CSSPageRule::style() const
369{
370 if(!impl) return CSSStyleDeclaration();
371 return ((CSSPageRuleImpl *)impl)->style();
372}
373
374
375// ----------------------------------------------------------
376
377CSSStyleRule::CSSStyleRule() : CSSRule()
378{
379}
380
381CSSStyleRule::CSSStyleRule(const CSSStyleRule &other)
382 : CSSRule(other)
383{
384}
385
386CSSStyleRule::CSSStyleRule(const CSSRule &other)
387{
388 impl = 0;
389 operator=(other);
390}
391
392
393CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *impl)
394 : CSSRule(impl)
395{
396}
397
398CSSStyleRule &CSSStyleRule::operator = (const CSSStyleRule &other)
399{
400 CSSRule::operator = (other);
401 return *this;
402}
403
404CSSStyleRule &CSSStyleRule::operator = (const CSSRule &other)
405{
406 assignOther( other, CSSRule::STYLE_RULE );
407 return *this;
408}
409
410CSSStyleRule::~CSSStyleRule()
411{
412}
413
414DOMString CSSStyleRule::selectorText() const
415{
416 if(!impl) return DOMString();
417 return ((CSSStyleRuleImpl*)impl)->selectorText();
418}
419
420void CSSStyleRule::setSelectorText( const DOMString &value )
421{
422 ((CSSStyleRuleImpl*)impl)->setSelectorText(value);
423}
424
425CSSStyleDeclaration CSSStyleRule::style() const
426{
427 if(!impl) return CSSStyleDeclaration();
428 return ((CSSStyleRuleImpl *)impl)->style();
429}
430
431
432// ----------------------------------------------------------
433
434
435CSSUnknownRule::CSSUnknownRule() : CSSRule()
436{
437}
438
439CSSUnknownRule::CSSUnknownRule(const CSSUnknownRule &other)
440 : CSSRule(other)
441{
442}
443
444CSSUnknownRule::CSSUnknownRule(const CSSRule &other)
445{
446 impl = 0;
447 operator=(other);
448}
449
450CSSUnknownRule::CSSUnknownRule(CSSUnknownRuleImpl *impl)
451 : CSSRule(impl)
452{
453}
454
455CSSUnknownRule &CSSUnknownRule::operator = (const CSSUnknownRule &other)
456{
457 CSSRule::operator = (other);
458 return *this;
459}
460
461CSSUnknownRule &CSSUnknownRule::operator = (const CSSRule &other)
462{
463 assignOther( other, CSSRule::UNKNOWN_RULE );
464 return *this;
465}
466
467CSSUnknownRule::~CSSUnknownRule()
468{
469}
470
471
472// ----------------------------------------------------------
473
474CSSRuleList::CSSRuleList()
475{
476 impl = 0;
477}
478
479CSSRuleList::CSSRuleList(const CSSRuleList &other)
480{
481 impl = other.impl;
482 if(impl) impl->ref();
483}
484
485CSSRuleList::CSSRuleList(CSSRuleListImpl *i)
486{
487 impl = i;
488 if(impl) impl->ref();
489}
490
491CSSRuleList::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
506CSSRuleList &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
516CSSRuleList::~CSSRuleList()
517{
518 if(impl) impl->deref();
519}
520
521unsigned long CSSRuleList::length() const
522{
523 if(!impl) return 0;
524 return ((CSSRuleListImpl *)impl)->length();
525 return 0;
526}
527
528CSSRule CSSRuleList::item( unsigned long index )
529{
530 if(!impl) return CSSRule();
531 return ((CSSRuleListImpl *)impl)->item( index );
532}
533
534CSSRuleListImpl *CSSRuleList::handle() const
535{
536 return impl;
537}
538
539bool 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.4
This website is maintained by Timothy Pearson.