KHTML
css_rule.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * Copyright 1999 Lars Knoll (knoll@kde.org) 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 * This file includes excerpts from the Document Object Model (DOM) 00022 * Level 2 Specification (Candidate Recommendation) 00023 * http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/ 00024 * Copyright © 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved. 00025 * 00026 */ 00027 #ifndef _CSS_css_rule_h_ 00028 #define _CSS_css_rule_h_ 00029 00030 #include <dom/dom_string.h> 00031 #include <dom/css_stylesheet.h> 00032 #include <dom/css_value.h> 00033 00034 namespace DOM { 00035 00036 class CSSRuleImpl; 00037 00052 class KHTML_EXPORT CSSRule 00053 { 00054 public: 00055 CSSRule(); 00056 CSSRule(const CSSRule &other); 00057 CSSRule(CSSRuleImpl *impl); 00058 public: 00059 00060 CSSRule & operator = (const CSSRule &other); 00061 00062 ~CSSRule(); 00067 enum RuleType { 00068 UNKNOWN_RULE = 0, 00069 STYLE_RULE = 1, 00070 CHARSET_RULE = 2, 00071 IMPORT_RULE = 3, 00072 MEDIA_RULE = 4, 00073 FONT_FACE_RULE = 5, 00074 PAGE_RULE = 6, 00075 NAMESPACE_RULE = 10, 00076 QUIRKS_RULE = 100 // KHTML CSS Extension 00077 }; 00078 00086 unsigned short type() const; 00087 00093 DOM::DOMString cssText() const; 00094 00112 void setCssText( const DOM::DOMString & ); 00113 00118 CSSStyleSheet parentStyleSheet() const; 00119 00127 CSSRule parentRule() const; 00128 00133 CSSRuleImpl *handle() const; 00134 bool isNull() const; 00135 00136 protected: 00137 CSSRuleImpl *impl; 00138 00139 void assignOther( const CSSRule &other, RuleType thisType ); 00140 }; 00141 00142 class CSSCharsetRuleImpl; 00143 00150 class KHTML_EXPORT CSSCharsetRule : public CSSRule 00151 { 00152 public: 00153 CSSCharsetRule(); 00154 CSSCharsetRule(const CSSCharsetRule &other); 00155 CSSCharsetRule(const CSSRule &other); 00156 CSSCharsetRule(CSSCharsetRuleImpl *impl); 00157 public: 00158 00159 CSSCharsetRule & operator = (const CSSCharsetRule &other); 00160 CSSCharsetRule & operator = (const CSSRule &other); 00161 00162 ~CSSCharsetRule(); 00163 00169 DOM::DOMString encoding() const; 00170 00182 void setEncoding( const DOM::DOMString & ); 00183 }; 00184 00185 00186 class CSSFontFaceRuleImpl; 00194 class KHTML_EXPORT CSSFontFaceRule : public CSSRule 00195 { 00196 public: 00197 CSSFontFaceRule(); 00198 CSSFontFaceRule(const CSSFontFaceRule &other); 00199 CSSFontFaceRule(const CSSRule &other); 00200 CSSFontFaceRule(CSSFontFaceRuleImpl *impl); 00201 public: 00202 00203 CSSFontFaceRule & operator = (const CSSFontFaceRule &other); 00204 CSSFontFaceRule & operator = (const CSSRule &other); 00205 00206 ~CSSFontFaceRule(); 00207 00213 CSSStyleDeclaration style() const; 00214 }; 00215 00216 class CSSImportRuleImpl; 00224 class KHTML_EXPORT CSSImportRule : public CSSRule 00225 { 00226 public: 00227 CSSImportRule(); 00228 CSSImportRule(const CSSImportRule &other); 00229 CSSImportRule(const CSSRule &other); 00230 CSSImportRule(CSSImportRuleImpl *impl); 00231 public: 00232 00233 CSSImportRule & operator = (const CSSImportRule &other); 00234 CSSImportRule & operator = (const CSSRule &other); 00235 00236 ~CSSImportRule(); 00237 00244 DOM::DOMString href() const; 00245 00250 MediaList media() const; 00251 00260 CSSStyleSheet styleSheet() const; 00261 }; 00262 00263 class CSSMediaRuleImpl; 00271 class KHTML_EXPORT CSSMediaRule : public CSSRule 00272 { 00273 public: 00274 CSSMediaRule(); 00275 CSSMediaRule(const CSSMediaRule &other); 00276 CSSMediaRule(const CSSRule &other); 00277 CSSMediaRule(CSSMediaRuleImpl *impl); 00278 public: 00279 00280 CSSMediaRule & operator = (const CSSMediaRule &other); 00281 CSSMediaRule & operator = (const CSSRule &other); 00282 00283 ~CSSMediaRule(); 00284 00291 MediaList media() const; 00292 00297 CSSRuleList cssRules() const; 00298 00332 unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index ); 00333 00350 void deleteRule ( unsigned long index ); 00351 }; 00352 00353 00354 class CSSPageRuleImpl; 00363 class KHTML_EXPORT CSSPageRule : public CSSRule 00364 { 00365 public: 00366 CSSPageRule(); 00367 CSSPageRule(const CSSPageRule &other); 00368 CSSPageRule(const CSSRule &other); 00369 CSSPageRule(CSSPageRuleImpl *impl); 00370 public: 00371 00372 CSSPageRule & operator = (const CSSPageRule &other); 00373 CSSPageRule & operator = (const CSSRule &other); 00374 00375 ~CSSPageRule(); 00376 00382 DOM::DOMString selectorText() const; 00383 00395 void setSelectorText( const DOM::DOMString & ); 00396 00402 CSSStyleDeclaration style() const; 00403 }; 00404 00405 class CSSStyleRuleImpl; 00412 class KHTML_EXPORT CSSStyleRule : public CSSRule 00413 { 00414 public: 00415 CSSStyleRule(); 00416 CSSStyleRule(const CSSStyleRule &other); 00417 CSSStyleRule(const CSSRule &other); 00418 CSSStyleRule(CSSStyleRuleImpl *impl); 00419 public: 00420 00421 CSSStyleRule & operator = (const CSSStyleRule &other); 00422 CSSStyleRule & operator = (const CSSRule &other); 00423 00424 ~CSSStyleRule(); 00425 00433 DOM::DOMString selectorText() const; 00434 00446 void setSelectorText( const DOM::DOMString & ); 00447 00453 CSSStyleDeclaration style() const; 00454 }; 00455 00456 class CSSNamespaceRuleImpl; 00462 class KHTML_EXPORT CSSNamespaceRule : public CSSRule 00463 { 00464 public: 00465 CSSNamespaceRule(); 00466 CSSNamespaceRule(const CSSNamespaceRule &other); 00467 CSSNamespaceRule(const CSSRule &other); 00468 CSSNamespaceRule(CSSNamespaceRuleImpl *impl); 00469 00470 DOMString namespaceURI() const; 00471 DOMString prefix() const; 00472 public: 00473 00474 CSSNamespaceRule & operator = (const CSSNamespaceRule &other); 00475 CSSNamespaceRule & operator = (const CSSRule &other); 00476 00477 ~CSSNamespaceRule(); 00478 }; 00479 00480 00481 00482 00483 class CSSUnknownRuleImpl; 00489 class KHTML_EXPORT CSSUnknownRule : public CSSRule 00490 { 00491 public: 00492 CSSUnknownRule(); 00493 CSSUnknownRule(const CSSUnknownRule &other); 00494 CSSUnknownRule(const CSSRule &other); 00495 CSSUnknownRule(CSSUnknownRuleImpl *impl); 00496 public: 00497 00498 CSSUnknownRule & operator = (const CSSUnknownRule &other); 00499 CSSUnknownRule & operator = (const CSSRule &other); 00500 00501 ~CSSUnknownRule(); 00502 }; 00503 00504 00505 class CSSRuleListImpl; 00506 class StyleListImpl; 00512 class KHTML_EXPORT CSSRuleList 00513 { 00514 public: 00515 CSSRuleList(); 00516 CSSRuleList(const CSSRuleList &other); 00517 CSSRuleList(CSSRuleListImpl *i); 00518 CSSRuleList(StyleListImpl *i); 00519 public: 00520 00521 CSSRuleList & operator = (const CSSRuleList &other); 00522 00523 ~CSSRuleList(); 00524 00531 unsigned long length() const; 00532 00545 CSSRule item ( unsigned long index ); 00546 00551 CSSRuleListImpl *handle() const; 00552 bool isNull() const; 00553 00554 protected: 00555 // we just need a pointer to an implementation here. 00556 CSSRuleListImpl *impl; 00557 }; 00558 00559 00560 } // namespace 00561 00562 #endif
KDE 4.6 API Reference