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

KHTML

  • khtml
  • dom
css_stylesheet.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_stylesheet_h_
28#define _CSS_css_stylesheet_h_
29
30#include <khtml_export.h>
31
32#include <dom/dom_string.h>
33#include <dom/dom_node.h>
34#include <dom/dom_misc.h>
35
36namespace DOM {
37
38class StyleSheetImpl;
39class MediaList;
40class NodeImpl;
41class DocumentImpl;
42
58class KHTML_EXPORT StyleSheet
59{
60public:
61 StyleSheet();
62 StyleSheet(const StyleSheet &other);
63 StyleSheet(StyleSheetImpl *impl);
64public:
65
66 StyleSheet & operator = (const StyleSheet &other);
67
68 ~StyleSheet();
69
86 DOM::DOMString type() const;
87
94 bool disabled() const;
95
99 void setDisabled( bool );
100
109 DOM::Node ownerNode() const;
110
119 StyleSheet parentStyleSheet() const;
120
132 DOM::DOMString href() const;
133
144 DOM::DOMString title() const;
145
156 MediaList media() const;
157
161 KUrl baseUrl();
162 bool isCSSStyleSheet() const;
163 StyleSheetImpl *handle() const { return impl; }
164 bool isNull() const { return !impl; }
165protected:
166 StyleSheetImpl *impl;
167};
168
169
174class KHTML_EXPORT CSSException
175{
176public:
177 CSSException(unsigned short _code) { code = _code; }
178 CSSException(const CSSException &other) { code = other.code; }
179
180 CSSException & operator = (const CSSException &other)
181 { code = other.code; return *this; }
182
183 virtual ~CSSException() {}
188 unsigned short code;
189
190 enum ExceptionCode
191 {
192 SYNTAX_ERR = 0,
193 INVALID_MODIFICATION_ERR = 1,
194 _EXCEPTION_OFFSET = 1000,
195 _EXCEPTION_MAX = 1999
196 };
197
199 DOMString codeAsString() const;
200
202 static DOMString codeAsString(int cssCode);
203
205 static bool isCSSExceptionCode(int exceptioncode);
206};
207
208class CSSStyleSheetImpl;
209class CSSRule;
210class CSSRuleList;
211
218class KHTML_EXPORT CSSStyleSheet : public StyleSheet
219{
220public:
221 CSSStyleSheet();
222 CSSStyleSheet(const CSSStyleSheet &other);
223 CSSStyleSheet(const StyleSheet &other);
224 CSSStyleSheet(CSSStyleSheetImpl *impl);
225public:
226
227 CSSStyleSheet & operator = (const CSSStyleSheet &other);
228 CSSStyleSheet & operator = (const StyleSheet &other);
229
230 ~CSSStyleSheet();
231
243 CSSRule ownerRule() const;
244
254 CSSRuleList cssRules() const;
255
290 unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index );
291
308 void deleteRule ( unsigned long index );
309
311 DOM::DOMString charset() const;
312};
313
314
315class StyleSheetListImpl;
316class StyleSheet;
317
323class KHTML_EXPORT StyleSheetList
324{
325public:
326 StyleSheetList();
327 StyleSheetList(const StyleSheetList &other);
328 StyleSheetList(StyleSheetListImpl *impl);
329public:
330
331 StyleSheetList & operator = (const StyleSheetList &other);
332
333 ~StyleSheetList();
334
341 unsigned long length() const;
342
353 StyleSheet item ( unsigned long index );
354
358 StyleSheetListImpl *handle() const;
359 bool isNull() const;
360
361protected:
362 StyleSheetListImpl *impl;
363};
364
365
366class MediaListImpl;
367class CSSRule;
368class CSSStyleSheet;
369
377class KHTML_EXPORT MediaList
378{
379public:
380 MediaList();
381 MediaList(const MediaList &other);
382 MediaList(MediaListImpl *impl);
383public:
384
385 MediaList & operator = (const MediaList &other);
386
387 ~MediaList();
388
399 DOM::DOMString mediaText() const;
400
404 void setMediaText(const DOM::DOMString &value);
405
409 unsigned long length() const;
410
411
421 DOM::DOMString item(unsigned long index) const;
422
433 void deleteMedium(const DOM::DOMString &oldMedium);
434
447 void appendMedium(const DOM::DOMString &newMedium);
448
452 MediaListImpl *handle() const;
453 bool isNull() const;
454
455protected:
456 MediaListImpl *impl;
457};
458
459class LinkStyleImpl;
460
461class KHTML_EXPORT LinkStyle
462{
463public:
464 LinkStyle();
465 LinkStyle(const LinkStyle &other);
466
467 LinkStyle & operator = (const LinkStyle &other);
468 LinkStyle & operator = (const Node &other);
469
470 ~LinkStyle();
471
472 StyleSheet sheet();
473
474 bool isNull() const;
475
476protected:
477 DOM::NodeImpl *node;
478 LinkStyleImpl *impl;
479};
480
481class DocumentStyleImpl;
482
483class KHTML_EXPORT DocumentStyle
484{
485public:
486 DocumentStyle();
487 DocumentStyle(const DocumentStyle &other);
488
489 DocumentStyle & operator = (const DocumentStyle &other);
490 DocumentStyle & operator = (const Document &other);
491
492 ~DocumentStyle();
493
494 StyleSheetList styleSheets() const ;
495
496 DOMString preferredStylesheetSet() const;
497 DOMString selectedStylesheetSet() const;
498 void setSelectedStylesheetSet( const DOMString& aString );
499
500 bool isNull() const { return !impl; }
501
502protected:
503 DOM::DocumentImpl *doc;
504 DocumentStyleImpl *impl;
505};
506
507} // namespace
508
509#endif
DOM::CSSException
This exception is raised when a specific CSS operation is impossible to perform.
Definition: css_stylesheet.h:175
DOM::CSSException::CSSException
CSSException(const CSSException &other)
Definition: css_stylesheet.h:178
DOM::CSSException::ExceptionCode
ExceptionCode
Definition: css_stylesheet.h:191
DOM::CSSException::~CSSException
virtual ~CSSException()
Definition: css_stylesheet.h:183
DOM::CSSException::code
unsigned short code
An integer indicating the type of error generated.
Definition: css_stylesheet.h:188
DOM::CSSException::CSSException
CSSException(unsigned short _code)
Definition: css_stylesheet.h:177
DOM::CSSRuleList
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules.
Definition: css_rule.h:513
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement .
Definition: css_rule.h:53
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i....
Definition: css_stylesheet.h:219
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::DocumentStyle
Definition: css_stylesheet.h:484
DOM::DocumentStyle::isNull
bool isNull() const
Definition: css_stylesheet.h:500
DOM::DocumentStyle::doc
DOM::DocumentImpl * doc
Definition: css_stylesheet.h:503
DOM::DocumentStyle::impl
DocumentStyleImpl * impl
Definition: css_stylesheet.h:504
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOM::LinkStyle
Definition: css_stylesheet.h:462
DOM::LinkStyle::node
DOM::NodeImpl * node
Definition: css_stylesheet.h:477
DOM::LinkStyle::impl
LinkStyleImpl * impl
Definition: css_stylesheet.h:478
DOM::MediaList
The MediaList interface provides the abstraction of an ordered collection of media,...
Definition: css_stylesheet.h:378
DOM::MediaList::impl
MediaListImpl * impl
Definition: css_stylesheet.h:456
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:271
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets.
Definition: css_stylesheet.h:324
DOM::StyleSheetList::impl
StyleSheetListImpl * impl
Definition: css_stylesheet.h:362
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:59
DOM::StyleSheet::isNull
bool isNull() const
Definition: css_stylesheet.h:164
DOM::StyleSheet::impl
StyleSheetImpl * impl
Definition: css_stylesheet.h:166
DOM::StyleSheet::handle
StyleSheetImpl * handle() const
Definition: css_stylesheet.h:163
KUrl
dom_misc.h
dom_node.h
dom_string.h
khtml_export.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-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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