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

KHTML

  • khtml
  • dom
css_rule.h
Go to the documentation of this file.
1/*
2 * This file is part of the DOM implementation for KDE.
3 *
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
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 * http://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
34namespace DOM {
35
36class CSSRuleImpl;
37
52class KHTML_EXPORT CSSRule
53{
54public:
55 CSSRule();
56 CSSRule(const CSSRule &other);
57 CSSRule(CSSRuleImpl *impl);
58public:
59
60 CSSRule & operator = (const CSSRule &other);
61
62 ~CSSRule();
67 enum RuleType {
68 UNKNOWN_RULE = 0,
69 STYLE_RULE = 1,
70 CHARSET_RULE = 2,
71 IMPORT_RULE = 3,
72 MEDIA_RULE = 4,
73 FONT_FACE_RULE = 5,
74 PAGE_RULE = 6,
75 NAMESPACE_RULE = 10,
76 QUIRKS_RULE = 100 // KHTML CSS Extension
77 };
78
86 unsigned short type() const;
87
93 DOM::DOMString cssText() const;
94
112 void setCssText( const DOM::DOMString & );
113
118 CSSStyleSheet parentStyleSheet() const;
119
127 CSSRule parentRule() const;
128
133 CSSRuleImpl *handle() const;
134 bool isNull() const;
135
136protected:
137 CSSRuleImpl *impl;
138
139 void assignOther( const CSSRule &other, RuleType thisType );
140};
141
142class CSSCharsetRuleImpl;
143
150class KHTML_EXPORT CSSCharsetRule : public CSSRule
151{
152public:
153 CSSCharsetRule();
154 CSSCharsetRule(const CSSCharsetRule &other);
155 CSSCharsetRule(const CSSRule &other);
156 CSSCharsetRule(CSSCharsetRuleImpl *impl);
157public:
158
159 CSSCharsetRule & operator = (const CSSCharsetRule &other);
160 CSSCharsetRule & operator = (const CSSRule &other);
161
162 ~CSSCharsetRule();
163
169 DOM::DOMString encoding() const;
170
182 void setEncoding( const DOM::DOMString & );
183};
184
185
186class CSSFontFaceRuleImpl;
194class KHTML_EXPORT CSSFontFaceRule : public CSSRule
195{
196public:
197 CSSFontFaceRule();
198 CSSFontFaceRule(const CSSFontFaceRule &other);
199 CSSFontFaceRule(const CSSRule &other);
200 CSSFontFaceRule(CSSFontFaceRuleImpl *impl);
201public:
202
203 CSSFontFaceRule & operator = (const CSSFontFaceRule &other);
204 CSSFontFaceRule & operator = (const CSSRule &other);
205
206 ~CSSFontFaceRule();
207
213 CSSStyleDeclaration style() const;
214};
215
216class CSSImportRuleImpl;
224class KHTML_EXPORT CSSImportRule : public CSSRule
225{
226public:
227 CSSImportRule();
228 CSSImportRule(const CSSImportRule &other);
229 CSSImportRule(const CSSRule &other);
230 CSSImportRule(CSSImportRuleImpl *impl);
231public:
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
263class CSSMediaRuleImpl;
271class KHTML_EXPORT CSSMediaRule : public CSSRule
272{
273public:
274 CSSMediaRule();
275 CSSMediaRule(const CSSMediaRule &other);
276 CSSMediaRule(const CSSRule &other);
277 CSSMediaRule(CSSMediaRuleImpl *impl);
278public:
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
354class CSSPageRuleImpl;
363class KHTML_EXPORT CSSPageRule : public CSSRule
364{
365public:
366 CSSPageRule();
367 CSSPageRule(const CSSPageRule &other);
368 CSSPageRule(const CSSRule &other);
369 CSSPageRule(CSSPageRuleImpl *impl);
370public:
371
372 CSSPageRule & operator = (const CSSPageRule &other);
373 CSSPageRule & operator = (const CSSRule &other);
374
375 ~CSSPageRule();
376
382 DOM::DOMString selectorText() const;
383
395 void setSelectorText( const DOM::DOMString & );
396
402 CSSStyleDeclaration style() const;
403};
404
405class CSSStyleRuleImpl;
412class KHTML_EXPORT CSSStyleRule : public CSSRule
413{
414public:
415 CSSStyleRule();
416 CSSStyleRule(const CSSStyleRule &other);
417 CSSStyleRule(const CSSRule &other);
418 CSSStyleRule(CSSStyleRuleImpl *impl);
419public:
420
421 CSSStyleRule & operator = (const CSSStyleRule &other);
422 CSSStyleRule & operator = (const CSSRule &other);
423
424 ~CSSStyleRule();
425
433 DOM::DOMString selectorText() const;
434
446 void setSelectorText( const DOM::DOMString & );
447
453 CSSStyleDeclaration style() const;
454};
455
456class CSSNamespaceRuleImpl;
462class KHTML_EXPORT CSSNamespaceRule : public CSSRule
463{
464public:
465 CSSNamespaceRule();
466 CSSNamespaceRule(const CSSNamespaceRule &other);
467 CSSNamespaceRule(const CSSRule &other);
468 CSSNamespaceRule(CSSNamespaceRuleImpl *impl);
469
470 DOMString namespaceURI() const;
471 DOMString prefix() const;
472public:
473
474 CSSNamespaceRule & operator = (const CSSNamespaceRule &other);
475 CSSNamespaceRule & operator = (const CSSRule &other);
476
477 ~CSSNamespaceRule();
478};
479
480
481
482
483class CSSUnknownRuleImpl;
489class KHTML_EXPORT CSSUnknownRule : public CSSRule
490{
491public:
492 CSSUnknownRule();
493 CSSUnknownRule(const CSSUnknownRule &other);
494 CSSUnknownRule(const CSSRule &other);
495 CSSUnknownRule(CSSUnknownRuleImpl *impl);
496public:
497
498 CSSUnknownRule & operator = (const CSSUnknownRule &other);
499 CSSUnknownRule & operator = (const CSSRule &other);
500
501 ~CSSUnknownRule();
502};
503
504
505class CSSRuleListImpl;
506class StyleListImpl;
512class KHTML_EXPORT CSSRuleList
513{
514public:
515 CSSRuleList();
516 CSSRuleList(const CSSRuleList &other);
517 CSSRuleList(CSSRuleListImpl *i);
518 CSSRuleList(StyleListImpl *i);
519public:
520
521 CSSRuleList & operator = (const CSSRuleList &other);
522
523 ~CSSRuleList();
524
531 unsigned long length() const;
532
545 CSSRule item ( unsigned long index );
546
551 CSSRuleListImpl *handle() const;
552 bool isNull() const;
553
554protected:
555 // we just need a pointer to an implementation here.
556 CSSRuleListImpl *impl;
557};
558
559
560} // namespace
561
562#endif
DOM::CSSCharsetRule::setEncoding
void setEncoding(const DOM::DOMString &)
see encoding
Definition css_rule.cpp:152
DOM::CSSCharsetRule::CSSCharsetRule
CSSCharsetRule()
Definition css_rule.cpp:111
DOM::CSSCharsetRule::encoding
DOM::DOMString encoding() const
The encoding information used in this @charset rule.
Definition css_rule.cpp:146
DOM::CSSFontFaceRule::style
CSSStyleDeclaration style() const
The declaration-block of this rule.
Definition css_rule.cpp:195
DOM::CSSFontFaceRule::CSSFontFaceRule
CSSFontFaceRule()
Definition css_rule.cpp:161
DOM::CSSImportRule::CSSImportRule
CSSImportRule()
Definition css_rule.cpp:205
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::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::CSSMediaRule
CSSMediaRule()
Definition css_rule.cpp:261
DOM::CSSMediaRule::deleteRule
void deleteRule(unsigned long index)
Used to delete a rule from the media block.
Definition css_rule.cpp:313
DOM::CSSNamespaceRule::prefix
DOMString prefix() const
Definition css_rule.cpp:476
DOM::CSSNamespaceRule::CSSNamespaceRule
CSSNamespaceRule()
Definition css_rule.cpp:434
DOM::CSSNamespaceRule::namespaceURI
DOMString namespaceURI() const
Definition css_rule.cpp:470
DOM::CSSPageRule::style
CSSStyleDeclaration style() const
The declaration-block of this rule.
Definition css_rule.cpp:368
DOM::CSSPageRule::selectorText
DOM::DOMString selectorText() const
The parsable textual representation of the page selector for the rule.
Definition css_rule.cpp:357
DOM::CSSPageRule::setSelectorText
void setSelectorText(const DOM::DOMString &)
see selectorText
Definition css_rule.cpp:363
DOM::CSSPageRule::CSSPageRule
CSSPageRule()
Definition css_rule.cpp:323
DOM::CSSRuleList
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules.
Definition css_rule.h:513
DOM::CSSRuleList::length
unsigned long length() const
The number of CSSRule s in the list.
Definition css_rule.cpp:571
DOM::CSSRuleList::CSSRuleList
CSSRuleList()
Definition css_rule.cpp:524
DOM::CSSRuleList::isNull
bool isNull() const
Definition css_rule.cpp:589
DOM::CSSRuleList::impl
CSSRuleListImpl * impl
Definition css_rule.h:556
DOM::CSSRuleList::item
CSSRule item(unsigned long index)
Used to retrieve a CSS rule by ordinal index.
Definition css_rule.cpp:578
DOM::CSSRuleList::handle
CSSRuleListImpl * handle() const
Definition css_rule.cpp:584
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement .
Definition css_rule.h:53
DOM::CSSRule::CSSRule
CSSRule()
Definition css_rule.cpp:27
DOM::CSSRule::RuleType
RuleType
An integer indicating which type of rule this is.
Definition css_rule.h:67
DOM::CSSRule::STYLE_RULE
@ STYLE_RULE
Definition css_rule.h:69
DOM::CSSRule::MEDIA_RULE
@ MEDIA_RULE
Definition css_rule.h:72
DOM::CSSRule::FONT_FACE_RULE
@ FONT_FACE_RULE
Definition css_rule.h:73
DOM::CSSRule::UNKNOWN_RULE
@ UNKNOWN_RULE
Definition css_rule.h:68
DOM::CSSRule::NAMESPACE_RULE
@ NAMESPACE_RULE
CSSOM,.
Definition css_rule.h:75
DOM::CSSRule::CHARSET_RULE
@ CHARSET_RULE
Definition css_rule.h:70
DOM::CSSRule::IMPORT_RULE
@ IMPORT_RULE
Definition css_rule.h:71
DOM::CSSRule::PAGE_RULE
@ PAGE_RULE
Definition css_rule.h:74
DOM::CSSRule::QUIRKS_RULE
@ QUIRKS_RULE
Definition css_rule.h:76
DOM::CSSRule::assignOther
void assignOther(const CSSRule &other, RuleType thisType)
Definition css_rule.cpp:99
DOM::CSSRule::impl
CSSRuleImpl * impl
Definition css_rule.h:137
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition css_value.h:61
DOM::CSSStyleRule::CSSStyleRule
CSSStyleRule()
Definition css_rule.cpp:377
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:219
DOM::CSSUnknownRule::CSSUnknownRule
CSSUnknownRule()
Definition css_rule.cpp:485
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:378
css_stylesheet.h
css_value.h
dom_string.h
DOM
This library provides a full-featured HTML parser and widget.
Definition design.h:55
rule
The CSSNamespaceRule interface represents an.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal