• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KHTML

css_rule.cpp

Go to the documentation of this file.
00001 
00023 #include "css/css_ruleimpl.h"
00024 
00025 using namespace DOM;
00026 
00027 CSSRule::CSSRule()
00028 {
00029     impl = 0;
00030 }
00031 
00032 CSSRule::CSSRule(const CSSRule &other)
00033 {
00034     impl = other.impl;
00035     if(impl) impl->ref();
00036 }
00037 
00038 CSSRule::CSSRule(CSSRuleImpl *i)
00039 {
00040     impl = i;
00041     if(impl) impl->ref();
00042 }
00043 
00044 CSSRule &CSSRule::operator = (const CSSRule &other)
00045 {
00046     if ( impl != other.impl ) {
00047         if(impl) impl->deref();
00048         impl = other.impl;
00049         if(impl) impl->ref();
00050     }
00051     return *this;
00052 }
00053 
00054 CSSRule::~CSSRule()
00055 {
00056     if(impl) impl->deref();
00057 }
00058 
00059 unsigned short CSSRule::type() const
00060 {
00061     if(!impl) return 0;
00062     return ((CSSRuleImpl *)impl)->type();
00063 }
00064 
00065 DOMString CSSRule::cssText() const
00066 {
00067     if(!impl) return DOMString();
00068     return impl->cssText();
00069 }
00070 
00071 void CSSRule::setCssText( const DOMString &value )
00072 {
00073     if(!impl) return;
00074     impl->setCssText(value);
00075 }
00076 
00077 CSSStyleSheet CSSRule::parentStyleSheet() const
00078 {
00079     if(!impl) return CSSStyleSheet();
00080     return ((CSSRuleImpl *)impl)->parentStyleSheet();
00081 }
00082 
00083 CSSRule CSSRule::parentRule() const
00084 {
00085     if(!impl) return 0;
00086     return ((CSSRuleImpl *)impl)->parentRule();
00087 }
00088 
00089 CSSRuleImpl *CSSRule::handle() const
00090 {
00091     return impl;
00092 }
00093 
00094 bool CSSRule::isNull() const
00095 {
00096     return (impl == 0);
00097 }
00098 
00099 void CSSRule::assignOther( const CSSRule &other, RuleType thisType )
00100 {
00101     if (other.type() != thisType ) {
00102     if ( impl ) impl->deref();
00103     impl = 0;
00104     } else
00105     CSSRule::operator = ( other );
00106 }
00107 
00108 // ----------------------------------------------------------
00109 
00110 
00111 CSSCharsetRule::CSSCharsetRule()
00112     : CSSRule()
00113 {
00114 }
00115 
00116 CSSCharsetRule::CSSCharsetRule(const CSSCharsetRule &other) : CSSRule(other)
00117 {
00118 }
00119 
00120 CSSCharsetRule::CSSCharsetRule(const CSSRule &other)
00121 {
00122     impl = 0;
00123     operator=(other);
00124 }
00125 
00126 CSSCharsetRule::CSSCharsetRule(CSSCharsetRuleImpl *impl) : CSSRule(impl)
00127 {
00128 }
00129 
00130 CSSCharsetRule &CSSCharsetRule::operator = (const CSSCharsetRule &other)
00131 {
00132     CSSRule::operator = (other);
00133     return *this;
00134 }
00135 
00136 CSSCharsetRule &CSSCharsetRule::operator = (const CSSRule &other)
00137 {
00138     assignOther( other, CSSRule::CHARSET_RULE);
00139     return *this;
00140 }
00141 
00142 CSSCharsetRule::~CSSCharsetRule()
00143 {
00144 }
00145 
00146 DOMString CSSCharsetRule::encoding() const
00147 {
00148     if(!impl) return DOMString();
00149     return ((CSSCharsetRuleImpl*)impl)->encoding();
00150 }
00151 
00152 void CSSCharsetRule::setEncoding( const DOMString &value )
00153 {
00154     ((CSSCharsetRuleImpl*)impl)->setEncoding(value);
00155 }
00156 
00157 
00158 // ----------------------------------------------------------
00159 
00160 
00161 CSSFontFaceRule::CSSFontFaceRule() : CSSRule()
00162 {
00163 }
00164 
00165 CSSFontFaceRule::CSSFontFaceRule(const CSSFontFaceRule &other) : CSSRule(other)
00166 {
00167 }
00168 
00169 CSSFontFaceRule::CSSFontFaceRule(const CSSRule &other)
00170 {
00171     impl = 0;
00172     operator=(other);
00173 }
00174 
00175 CSSFontFaceRule::CSSFontFaceRule(CSSFontFaceRuleImpl *impl) : CSSRule(impl)
00176 {
00177 }
00178 
00179 CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSFontFaceRule &other)
00180 {
00181     CSSRule::operator = (other);
00182     return *this;
00183 }
00184 
00185 CSSFontFaceRule &CSSFontFaceRule::operator = (const CSSRule &other)
00186 {
00187     assignOther( other, CSSRule::FONT_FACE_RULE );
00188     return *this;
00189 }
00190 
00191 CSSFontFaceRule::~CSSFontFaceRule()
00192 {
00193 }
00194 
00195 CSSStyleDeclaration CSSFontFaceRule::style() const
00196 {
00197     if(!impl) return CSSStyleDeclaration();
00198     return ((CSSFontFaceRuleImpl *)impl)->style();
00199 }
00200 
00201 
00202 // ----------------------------------------------------------
00203 
00204 
00205 CSSImportRule::CSSImportRule() : CSSRule()
00206 {
00207 }
00208 
00209 CSSImportRule::CSSImportRule(const CSSImportRule &other) : CSSRule(other)
00210 {
00211 }
00212 
00213 CSSImportRule::CSSImportRule(const CSSRule &other)
00214 {
00215     impl = 0;
00216     operator=(other);
00217 }
00218 
00219 CSSImportRule::CSSImportRule(CSSImportRuleImpl *impl) : CSSRule(impl)
00220 {
00221 }
00222 
00223 CSSImportRule &CSSImportRule::operator = (const CSSImportRule &other)
00224 {
00225     CSSRule::operator = (other);
00226     return *this;
00227 }
00228 
00229 CSSImportRule &CSSImportRule::operator = (const CSSRule &other)
00230 {
00231     assignOther( other, CSSRule::IMPORT_RULE );
00232     return *this;
00233 }
00234 
00235 CSSImportRule::~CSSImportRule()
00236 {
00237 }
00238 
00239 DOMString CSSImportRule::href() const
00240 {
00241     if(!impl) return DOMString();
00242     return ((CSSImportRuleImpl *)impl)->href();
00243 }
00244 
00245 MediaList CSSImportRule::media() const
00246 {
00247     if(!impl) return MediaList();
00248     return ((CSSImportRuleImpl *)impl)->media();
00249 }
00250 
00251 CSSStyleSheet CSSImportRule::styleSheet() const
00252 {
00253     if(!impl) return CSSStyleSheet();
00254     return ((CSSImportRuleImpl *)impl)->styleSheet();
00255 }
00256 
00257 
00258 // ----------------------------------------------------------
00259 
00260 
00261 CSSMediaRule::CSSMediaRule() : CSSRule()
00262 {
00263 }
00264 
00265 CSSMediaRule::CSSMediaRule(const CSSMediaRule &other) : CSSRule(other)
00266 {
00267 }
00268 
00269 CSSMediaRule::CSSMediaRule(const CSSRule &other)
00270 {
00271     impl = 0;
00272     operator=(other);
00273 }
00274 
00275 CSSMediaRule::CSSMediaRule(CSSMediaRuleImpl *impl) : CSSRule(impl)
00276 {
00277 }
00278 
00279 CSSMediaRule &CSSMediaRule::operator = (const CSSMediaRule &other)
00280 {
00281     CSSRule::operator = (other);
00282     return *this;
00283 }
00284 
00285 CSSMediaRule &CSSMediaRule::operator = (const CSSRule &other)
00286 {
00287     assignOther( other, CSSRule::MEDIA_RULE );
00288     return *this;
00289 }
00290 
00291 CSSMediaRule::~CSSMediaRule()
00292 {
00293 }
00294 
00295 MediaList CSSMediaRule::media() const
00296 {
00297     if(!impl) return MediaList();
00298     return ((CSSMediaRuleImpl *)impl)->media();
00299 }
00300 
00301 CSSRuleList CSSMediaRule::cssRules() const
00302 {
00303     if(!impl) return CSSRuleList();
00304     return ((CSSMediaRuleImpl *)impl)->cssRules();
00305 }
00306 
00307 unsigned long CSSMediaRule::insertRule( const DOMString &rule, unsigned long index )
00308 {
00309     if(!impl) return 0;
00310     return ((CSSMediaRuleImpl *)impl)->insertRule( rule, index );
00311 }
00312 
00313 void CSSMediaRule::deleteRule( unsigned long index )
00314 {
00315     if(impl)
00316         ((CSSMediaRuleImpl *)impl)->deleteRule( index );
00317 }
00318 
00319 
00320 // ----------------------------------------------------------
00321 
00322 
00323 CSSPageRule::CSSPageRule() : CSSRule()
00324 {
00325 }
00326 
00327 CSSPageRule::CSSPageRule(const CSSPageRule &other) : CSSRule(other)
00328 {
00329 }
00330 
00331 CSSPageRule::CSSPageRule(const CSSRule &other)
00332 {
00333     impl = 0;
00334     operator=(other);
00335 }
00336 
00337 CSSPageRule::CSSPageRule(CSSPageRuleImpl *impl) : CSSRule(impl)
00338 {
00339 }
00340 
00341 CSSPageRule &CSSPageRule::operator = (const CSSPageRule &other)
00342 {
00343     CSSRule::operator = (other);
00344     return *this;
00345 }
00346 
00347 CSSPageRule &CSSPageRule::operator = (const CSSRule &other)
00348 {
00349     assignOther( other, CSSRule::PAGE_RULE );
00350     return *this;
00351 }
00352 
00353 CSSPageRule::~CSSPageRule()
00354 {
00355 }
00356 
00357 DOMString CSSPageRule::selectorText() const
00358 {
00359     if(!impl) return DOMString();
00360     return ((CSSPageRuleImpl*)impl)->selectorText();
00361 }
00362 
00363 void CSSPageRule::setSelectorText( const DOMString &value )
00364 {
00365     ((CSSPageRuleImpl*)impl)->setSelectorText(value);
00366 }
00367 
00368 CSSStyleDeclaration CSSPageRule::style() const
00369 {
00370     if(!impl) return CSSStyleDeclaration();
00371     return ((CSSPageRuleImpl *)impl)->style();
00372 }
00373 
00374 
00375 // ----------------------------------------------------------
00376 
00377 CSSStyleRule::CSSStyleRule() : CSSRule()
00378 {
00379 }
00380 
00381 CSSStyleRule::CSSStyleRule(const CSSStyleRule &other)
00382     : CSSRule(other)
00383 {
00384 }
00385 
00386 CSSStyleRule::CSSStyleRule(const CSSRule &other)
00387 {
00388     impl = 0;
00389     operator=(other);
00390 }
00391 
00392 
00393 CSSStyleRule::CSSStyleRule(CSSStyleRuleImpl *impl)
00394     : CSSRule(impl)
00395 {
00396 }
00397 
00398 CSSStyleRule &CSSStyleRule::operator = (const CSSStyleRule &other)
00399 {
00400     CSSRule::operator = (other);
00401     return *this;
00402 }
00403 
00404 CSSStyleRule &CSSStyleRule::operator = (const CSSRule &other)
00405 {
00406     assignOther( other, CSSRule::STYLE_RULE );
00407     return *this;
00408 }
00409 
00410 CSSStyleRule::~CSSStyleRule()
00411 {
00412 }
00413 
00414 DOMString CSSStyleRule::selectorText() const
00415 {
00416     if(!impl) return DOMString();
00417     return ((CSSStyleRuleImpl*)impl)->selectorText();
00418 }
00419 
00420 void CSSStyleRule::setSelectorText( const DOMString &value )
00421 {
00422     ((CSSStyleRuleImpl*)impl)->setSelectorText(value);
00423 }
00424 
00425 CSSStyleDeclaration CSSStyleRule::style() const
00426 {
00427     if(!impl) return CSSStyleDeclaration();
00428     return ((CSSStyleRuleImpl *)impl)->style();
00429 }
00430 
00431 // ----------------------------------------------------------
00432 
00433 
00434 CSSNamespaceRule::CSSNamespaceRule() : CSSRule()
00435 {
00436 }
00437 
00438 CSSNamespaceRule::CSSNamespaceRule(const CSSNamespaceRule &other)
00439     : CSSRule(other)
00440 {
00441 }
00442 
00443 CSSNamespaceRule::CSSNamespaceRule(const CSSRule &other)
00444 {
00445     impl = 0;
00446     operator=(other);
00447 }
00448 
00449 CSSNamespaceRule::CSSNamespaceRule(CSSNamespaceRuleImpl *impl)
00450     : CSSRule(impl)
00451 {
00452 }
00453 
00454 CSSNamespaceRule &CSSNamespaceRule::operator = (const CSSNamespaceRule &other)
00455 {
00456     CSSRule::operator = (other);
00457     return *this;
00458 }
00459 
00460 CSSNamespaceRule &CSSNamespaceRule::operator = (const CSSRule &other)
00461 {
00462     assignOther( other, CSSRule::NAMESPACE_RULE );
00463     return *this;
00464 }
00465 
00466 CSSNamespaceRule::~CSSNamespaceRule()
00467 {
00468 }
00469 
00470 DOMString CSSNamespaceRule::namespaceURI() const
00471 {
00472     if(!impl) return DOMString();
00473     return static_cast<CSSNamespaceRuleImpl*>(impl)->namespaceURI();
00474 }
00475 
00476 DOMString CSSNamespaceRule::prefix() const
00477 {
00478     if(!impl) return DOMString();
00479     return static_cast<CSSNamespaceRuleImpl*>(impl)->prefix();
00480 }
00481 
00482 // ----------------------------------------------------------
00483 
00484 
00485 CSSUnknownRule::CSSUnknownRule() : CSSRule()
00486 {
00487 }
00488 
00489 CSSUnknownRule::CSSUnknownRule(const CSSUnknownRule &other)
00490     : CSSRule(other)
00491 {
00492 }
00493 
00494 CSSUnknownRule::CSSUnknownRule(const CSSRule &other)
00495 {
00496     impl = 0;
00497     operator=(other);
00498 }
00499 
00500 CSSUnknownRule::CSSUnknownRule(CSSUnknownRuleImpl *impl)
00501     : CSSRule(impl)
00502 {
00503 }
00504 
00505 CSSUnknownRule &CSSUnknownRule::operator = (const CSSUnknownRule &other)
00506 {
00507     CSSRule::operator = (other);
00508     return *this;
00509 }
00510 
00511 CSSUnknownRule &CSSUnknownRule::operator = (const CSSRule &other)
00512 {
00513     assignOther( other, CSSRule::UNKNOWN_RULE );
00514     return *this;
00515 }
00516 
00517 CSSUnknownRule::~CSSUnknownRule()
00518 {
00519 }
00520 
00521 
00522 // ----------------------------------------------------------
00523 
00524 CSSRuleList::CSSRuleList()
00525 {
00526     impl = 0;
00527 }
00528 
00529 CSSRuleList::CSSRuleList(const CSSRuleList &other)
00530 {
00531     impl = other.impl;
00532     if(impl) impl->ref();
00533 }
00534 
00535 CSSRuleList::CSSRuleList(CSSRuleListImpl *i)
00536 {
00537     impl = i;
00538     if(impl) impl->ref();
00539 }
00540 
00541 CSSRuleList::CSSRuleList(StyleListImpl *lst)
00542 {
00543     impl = new CSSRuleListImpl;
00544     impl->ref();
00545     if (lst)
00546     {
00547         for( unsigned long i = 0; i < lst->length() ; ++i )
00548         {
00549             StyleBaseImpl* style = lst->item( i );
00550             if ( style->isRule() )
00551                 impl->insertRule( static_cast<CSSRuleImpl *>(style), impl->length() );
00552         }
00553     }
00554 }
00555 
00556 CSSRuleList &CSSRuleList::operator = (const CSSRuleList &other)
00557 {
00558     if ( impl != other.impl ) {
00559         if(impl) impl->deref();
00560         impl = other.impl;
00561         if(impl) impl->ref();
00562     }
00563     return *this;
00564 }
00565 
00566 CSSRuleList::~CSSRuleList()
00567 {
00568     if(impl) impl->deref();
00569 }
00570 
00571 unsigned long CSSRuleList::length() const
00572 {
00573     if(!impl) return 0;
00574     return ((CSSRuleListImpl *)impl)->length();
00575     return 0;
00576 }
00577 
00578 CSSRule CSSRuleList::item( unsigned long index )
00579 {
00580     if(!impl) return CSSRule();
00581     return ((CSSRuleListImpl *)impl)->item( index );
00582 }
00583 
00584 CSSRuleListImpl *CSSRuleList::handle() const
00585 {
00586     return impl;
00587 }
00588 
00589 bool CSSRuleList::isNull() const
00590 {
00591     return (impl == 0);
00592 }
00593 
00594 
00595 
00596 

KHTML

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal