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

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • 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 
36 namespace DOM {
37 
38 class StyleSheetImpl;
39 class MediaList;
40 class NodeImpl;
41 class DocumentImpl;
42 
58 class KHTML_EXPORT StyleSheet
59 {
60 public:
61  StyleSheet();
62  StyleSheet(const StyleSheet &other);
63  StyleSheet(StyleSheetImpl *impl);
64 public:
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; }
165 protected:
166  StyleSheetImpl *impl;
167 };
168 
169 
174 class KHTML_EXPORT CSSException
175 {
176 public:
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 
208 class CSSStyleSheetImpl;
209 class CSSRule;
210 class CSSRuleList;
211 
218 class KHTML_EXPORT CSSStyleSheet : public StyleSheet
219 {
220 public:
221  CSSStyleSheet();
222  CSSStyleSheet(const CSSStyleSheet &other);
223  CSSStyleSheet(const StyleSheet &other);
224  CSSStyleSheet(CSSStyleSheetImpl *impl);
225 public:
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 
315 class StyleSheetListImpl;
316 class StyleSheet;
317 
323 class KHTML_EXPORT StyleSheetList
324 {
325 public:
326  StyleSheetList();
327  StyleSheetList(const StyleSheetList &other);
328  StyleSheetList(StyleSheetListImpl *impl);
329 public:
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 
361 protected:
362  StyleSheetListImpl *impl;
363 };
364 
365 
366 class MediaListImpl;
367 class CSSRule;
368 class CSSStyleSheet;
369 
377 class KHTML_EXPORT MediaList
378 {
379 public:
380  MediaList();
381  MediaList(const MediaList &other);
382  MediaList(MediaListImpl *impl);
383 public:
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 
455 protected:
456  MediaListImpl *impl;
457 };
458 
459 class LinkStyleImpl;
460 
461 class KHTML_EXPORT LinkStyle
462 {
463 public:
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 
476 protected:
477  DOM::NodeImpl *node;
478  LinkStyleImpl *impl;
479 };
480 
481 class DocumentStyleImpl;
482 
483 class KHTML_EXPORT DocumentStyle
484 {
485 public:
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 
502 protected:
503  DOM::DocumentImpl *doc;
504  DocumentStyleImpl *impl;
505 };
506 
507 } // namespace
508 
509 #endif
dom_string.h
DOM::StyleSheet::impl
StyleSheetImpl * impl
Definition: css_stylesheet.h:166
DOM::StyleSheet::handle
StyleSheetImpl * handle() const
Definition: css_stylesheet.h:163
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:270
DOM::StyleSheet::isNull
bool isNull() const
Definition: css_stylesheet.h:164
KUrl
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i...
Definition: css_stylesheet.h:218
DOM::DocumentStyle
Definition: css_stylesheet.h:483
DOM::MediaList::impl
MediaListImpl * impl
Definition: css_stylesheet.h:456
dom_node.h
DOM::MediaList
The MediaList interface provides the abstraction of an ordered collection of media, without defining or constraining how this collection is implemented.
Definition: css_stylesheet.h:377
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets...
Definition: css_stylesheet.h:323
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::LinkStyle
Definition: css_stylesheet.h:461
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:245
DOM::CSSException::ExceptionCode
ExceptionCode
Definition: css_stylesheet.h:190
DOM::CSSException::CSSException
CSSException(const CSSException &other)
Definition: css_stylesheet.h:178
DOM::LinkStyle::impl
LinkStyleImpl * impl
Definition: css_stylesheet.h:478
dom_misc.h
DOM::DocumentStyle::doc
DOM::DocumentImpl * doc
Definition: css_stylesheet.h:503
DOM::CSSRuleList
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules...
Definition: css_rule.h:512
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:58
khtml_export.h
DOM::LinkStyle::node
DOM::NodeImpl * node
Definition: css_stylesheet.h:477
DOM::DocumentStyle::isNull
bool isNull() const
Definition: css_stylesheet.h:500
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement ...
Definition: css_rule.h:52
DOM::CSSException::~CSSException
virtual ~CSSException()
Definition: css_stylesheet.h:183
DOM::CSSException
This exception is raised when a specific CSS operation is impossible to perform.
Definition: css_stylesheet.h:174
DOM::CSSException::code
unsigned short code
An integer indicating the type of error generated.
Definition: css_stylesheet.h:188
DOM::StyleSheetList::impl
StyleSheetListImpl * impl
Definition: css_stylesheet.h:362
DOM::DocumentStyle::impl
DocumentStyleImpl * impl
Definition: css_stylesheet.h:504
DOM::CSSException::CSSException
CSSException(unsigned short _code)
Definition: css_stylesheet.h:177
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:20 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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