KHtml

css_rule.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * This file includes excerpts from the Document Object Model (DOM)
22  * Level 2 Specification (Candidate Recommendation)
23  * https://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/
24  * Copyright © 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved.
25  *
26  */
27 #ifndef _CSS_css_rule_h_
28 #define _CSS_css_rule_h_
29 
30 #include <dom/dom_string.h>
31 #include <dom/css_stylesheet.h>
32 #include <dom/css_value.h>
33 
34 namespace DOM
35 {
36 
37 class CSSRuleImpl;
38 
53 class KHTML_EXPORT CSSRule
54 {
55 public:
56  CSSRule();
57  CSSRule(const CSSRule &other);
58  CSSRule(CSSRuleImpl *impl);
59 public:
60 
61  CSSRule &operator = (const CSSRule &other);
62 
63  ~CSSRule();
68  enum RuleType {
69  UNKNOWN_RULE = 0,
70  STYLE_RULE = 1,
71  CHARSET_RULE = 2,
72  IMPORT_RULE = 3,
73  MEDIA_RULE = 4,
74  FONT_FACE_RULE = 5,
75  PAGE_RULE = 6,
76  NAMESPACE_RULE = 10,
77  QUIRKS_RULE = 100 // KHTML CSS Extension
78  };
79 
87  unsigned short type() const;
88 
94  DOM::DOMString cssText() const;
95 
113  void setCssText(const DOM::DOMString &);
114 
119  CSSStyleSheet parentStyleSheet() const;
120 
128  CSSRule parentRule() const;
129 
134  CSSRuleImpl *handle() const;
135  bool isNull() const;
136 
137 protected:
138  CSSRuleImpl *impl;
139 
140  void assignOther(const CSSRule &other, RuleType thisType);
141 };
142 
143 class CSSCharsetRuleImpl;
144 
151 class KHTML_EXPORT CSSCharsetRule : public CSSRule
152 {
153 public:
154  CSSCharsetRule();
155  CSSCharsetRule(const CSSCharsetRule &other);
156  CSSCharsetRule(const CSSRule &other);
157  CSSCharsetRule(CSSCharsetRuleImpl *impl);
158 public:
159 
160  CSSCharsetRule &operator = (const CSSCharsetRule &other);
161  CSSCharsetRule &operator = (const CSSRule &other);
162 
163  ~CSSCharsetRule();
164 
170  DOM::DOMString encoding() const;
171 
183  void setEncoding(const DOM::DOMString &);
184 };
185 
186 class CSSFontFaceRuleImpl;
194 class KHTML_EXPORT CSSFontFaceRule : public CSSRule
195 {
196 public:
197  CSSFontFaceRule();
198  CSSFontFaceRule(const CSSFontFaceRule &other);
199  CSSFontFaceRule(const CSSRule &other);
200  CSSFontFaceRule(CSSFontFaceRuleImpl *impl);
201 public:
202 
203  CSSFontFaceRule &operator = (const CSSFontFaceRule &other);
204  CSSFontFaceRule &operator = (const CSSRule &other);
205 
206  ~CSSFontFaceRule();
207 
213  CSSStyleDeclaration style() const;
214 };
215 
216 class CSSImportRuleImpl;
224 class KHTML_EXPORT CSSImportRule : public CSSRule
225 {
226 public:
227  CSSImportRule();
228  CSSImportRule(const CSSImportRule &other);
229  CSSImportRule(const CSSRule &other);
230  CSSImportRule(CSSImportRuleImpl *impl);
231 public:
232 
233  CSSImportRule &operator = (const CSSImportRule &other);
234  CSSImportRule &operator = (const CSSRule &other);
235 
236  ~CSSImportRule();
237 
244  DOM::DOMString href() const;
245 
250  MediaList media() const;
251 
260  CSSStyleSheet styleSheet() const;
261 };
262 
263 class CSSMediaRuleImpl;
271 class KHTML_EXPORT CSSMediaRule : public CSSRule
272 {
273 public:
274  CSSMediaRule();
275  CSSMediaRule(const CSSMediaRule &other);
276  CSSMediaRule(const CSSRule &other);
277  CSSMediaRule(CSSMediaRuleImpl *impl);
278 public:
279 
280  CSSMediaRule &operator = (const CSSMediaRule &other);
281  CSSMediaRule &operator = (const CSSRule &other);
282 
283  ~CSSMediaRule();
284 
291  MediaList media() const;
292 
297  CSSRuleList cssRules() const;
298 
332  unsigned long insertRule(const DOM::DOMString &rule, unsigned long index);
333 
350  void deleteRule(unsigned long index);
351 };
352 
353 class CSSPageRuleImpl;
362 class KHTML_EXPORT CSSPageRule : public CSSRule
363 {
364 public:
365  CSSPageRule();
366  CSSPageRule(const CSSPageRule &other);
367  CSSPageRule(const CSSRule &other);
368  CSSPageRule(CSSPageRuleImpl *impl);
369 public:
370 
371  CSSPageRule &operator = (const CSSPageRule &other);
372  CSSPageRule &operator = (const CSSRule &other);
373 
374  ~CSSPageRule();
375 
381  DOM::DOMString selectorText() const;
382 
394  void setSelectorText(const DOM::DOMString &);
395 
401  CSSStyleDeclaration style() const;
402 };
403 
404 class CSSStyleRuleImpl;
411 class KHTML_EXPORT CSSStyleRule : public CSSRule
412 {
413 public:
414  CSSStyleRule();
415  CSSStyleRule(const CSSStyleRule &other);
416  CSSStyleRule(const CSSRule &other);
417  CSSStyleRule(CSSStyleRuleImpl *impl);
418 public:
419 
420  CSSStyleRule &operator = (const CSSStyleRule &other);
421  CSSStyleRule &operator = (const CSSRule &other);
422 
423  ~CSSStyleRule();
424 
432  DOM::DOMString selectorText() const;
433 
445  void setSelectorText(const DOM::DOMString &);
446 
452  CSSStyleDeclaration style() const;
453 };
454 
455 class CSSNamespaceRuleImpl;
461 class KHTML_EXPORT CSSNamespaceRule : public CSSRule
462 {
463 public:
464  CSSNamespaceRule();
465  CSSNamespaceRule(const CSSNamespaceRule &other);
466  CSSNamespaceRule(const CSSRule &other);
467  CSSNamespaceRule(CSSNamespaceRuleImpl *impl);
468 
469  DOMString namespaceURI() const;
470  DOMString prefix() const;
471 public:
472 
473  CSSNamespaceRule &operator = (const CSSNamespaceRule &other);
474  CSSNamespaceRule &operator = (const CSSRule &other);
475 
476  ~CSSNamespaceRule();
477 };
478 
479 class CSSUnknownRuleImpl;
485 class KHTML_EXPORT CSSUnknownRule : public CSSRule
486 {
487 public:
488  CSSUnknownRule();
489  CSSUnknownRule(const CSSUnknownRule &other);
490  CSSUnknownRule(const CSSRule &other);
491  CSSUnknownRule(CSSUnknownRuleImpl *impl);
492 public:
493 
494  CSSUnknownRule &operator = (const CSSUnknownRule &other);
495  CSSUnknownRule &operator = (const CSSRule &other);
496 
497  ~CSSUnknownRule();
498 };
499 
500 class CSSRuleListImpl;
501 class StyleListImpl;
507 class KHTML_EXPORT CSSRuleList
508 {
509 public:
510  CSSRuleList();
511  CSSRuleList(const CSSRuleList &other);
512  CSSRuleList(CSSRuleListImpl *i);
513  CSSRuleList(StyleListImpl *i);
514 public:
515 
516  CSSRuleList &operator = (const CSSRuleList &other);
517 
518  ~CSSRuleList();
519 
526  unsigned long length() const;
527 
540  CSSRule item(unsigned long index);
541 
546  CSSRuleListImpl *handle() const;
547  bool isNull() const;
548 
549 protected:
550  // we just need a pointer to an implementation here.
551  CSSRuleListImpl *impl;
552 };
553 
554 } // namespace
555 
556 #endif
The CSSNamespaceRule interface represents an.
Definition: css_rule.h:455
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:59
RuleType
An integer indicating which type of rule this is.
Definition: css_rule.h:68
The CSSImportRule interface represents a @import rule within a CSS style sheet.
Definition: css_rule.h:224
The CSSFontFaceRule interface represents a @font-face rule in a CSS style sheet. ...
Definition: css_rule.h:194
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.
Definition: css_rule.h:485
The MediaList interface provides the abstraction of an ordered collection of media, without defining or constraining how this collection is implemented.
The CSSStyleRule interface represents a single rule set in a CSS style sheet.
Definition: css_rule.h:411
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
This library provides a full-featured HTML parser and widget.
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules...
Definition: css_rule.h:507
The CSSRule interface is the abstract base interface for any type of CSS statement ...
Definition: css_rule.h:53
The CSSCharsetRule interface a @charset rule in a CSS style sheet.
Definition: css_rule.h:151
The CSSMediaRule interface represents a @media rule in a CSS style sheet.
Definition: css_rule.h:271
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 3 2020 22:45:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.