khtml Library API Documentation

css_stylesheet.h

00001 /*
00002  * This file is part of the DOM implementation for KDE.
00003  *
00004  * (C) 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., 59 Temple Place - Suite 330,
00019  * Boston, MA 02111-1307, 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  * $Id: css_stylesheet.h,v 1.13 2002/04/08 17:53:37 knoll Exp $
00027  */
00028 #ifndef _CSS_css_stylesheet_h_
00029 #define _CSS_css_stylesheet_h_
00030 
00031 #include <dom/dom_string.h>
00032 #include <dom/dom_node.h>
00033 #include <dom/dom_misc.h>
00034 
00035 
00036 namespace DOM {
00037 
00038 class StyleSheetImpl;
00039 class MediaList;
00040 class NodeImpl;
00041 class DocumentImpl;
00042 
00058 class StyleSheet
00059 {
00060 public:
00061     StyleSheet();
00062     StyleSheet(const StyleSheet &other);
00063     StyleSheet(StyleSheetImpl *impl);
00064 public:
00065 
00066     StyleSheet & operator = (const StyleSheet &other);
00067 
00068     ~StyleSheet();
00069 
00086     DOM::DOMString type() const;
00087 
00094     bool disabled() const;
00095 
00099     void setDisabled( bool );
00100 
00109     DOM::Node ownerNode() const;
00110 
00119     StyleSheet parentStyleSheet() const;
00120 
00132     DOM::DOMString href() const;
00133 
00144     DOM::DOMString title() const;
00145 
00156     MediaList media() const;
00157 
00161     bool isCSSStyleSheet() const;
00162     StyleSheetImpl *handle() const { return impl; }
00163     bool isNull() const;
00164 protected:
00165     StyleSheetImpl *impl;
00166 };
00167 
00168 
00173 class CSSException
00174 {
00175 public:
00176     CSSException(unsigned short _code) { code = _code; }
00177     CSSException(const CSSException &other) { code = other.code; }
00178 
00179     CSSException & operator = (const CSSException &other)
00180         { code = other.code; return *this; }
00181 
00182     virtual ~CSSException() {}
00187     unsigned short   code;
00188 
00189     enum ExceptionCode
00190     {
00191         SYNTAX_ERR                     = 0,
00192         INVALID_MODIFICATION_ERR       = 1,
00193         _EXCEPTION_OFFSET              = 1000
00194     };
00195 };
00196 
00197 class CSSStyleSheetImpl;
00198 class CSSRule;
00199 class CSSRuleList;
00200 
00207 class CSSStyleSheet : public StyleSheet
00208 {
00209 public:
00210     CSSStyleSheet();
00211     CSSStyleSheet(const CSSStyleSheet &other);
00212     CSSStyleSheet(const StyleSheet &other);
00213     CSSStyleSheet(CSSStyleSheetImpl *impl);
00214 public:
00215 
00216     CSSStyleSheet & operator = (const CSSStyleSheet &other);
00217     CSSStyleSheet & operator = (const StyleSheet &other);
00218 
00219     ~CSSStyleSheet();
00220 
00233     CSSRule ownerRule() const;
00234 
00244     CSSRuleList cssRules() const;
00245 
00280     unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index );
00281 
00298     void deleteRule ( unsigned long index );
00299 };
00300 
00301 
00302 class StyleSheetListImpl;
00303 class StyleSheet;
00304 
00310 class StyleSheetList
00311 {
00312 public:
00313     StyleSheetList();
00314     StyleSheetList(const StyleSheetList &other);
00315     StyleSheetList(StyleSheetListImpl *impl);
00316 public:
00317 
00318     StyleSheetList & operator = (const StyleSheetList &other);
00319 
00320     ~StyleSheetList();
00321 
00328     unsigned long length() const;
00329 
00340     StyleSheet item ( unsigned long index );
00341 
00345     StyleSheetListImpl *handle() const;
00346     bool isNull() const;
00347 
00348 protected:
00349     StyleSheetListImpl *impl;
00350 };
00351 
00352 
00353 class MediaListImpl;
00354 class CSSRule;
00355 class CSSStyleSheet;
00356 
00364 class MediaList
00365 {
00366 public:
00367     MediaList();
00368     MediaList(const MediaList &other);
00369     MediaList(MediaListImpl *impl);
00370 public:
00371 
00372     MediaList & operator = (const MediaList &other);
00373 
00374     ~MediaList();
00375 
00386     DOM::DOMString mediaText() const;
00387 
00391     void setMediaText(const DOM::DOMString &value);
00392 
00396     unsigned long length() const;
00397 
00398 
00408     DOM::DOMString item(unsigned long index) const;
00409 
00420     void deleteMedium(const DOM::DOMString &oldMedium);
00421 
00434     void appendMedium(const DOM::DOMString &newMedium);
00435 
00439     MediaListImpl *handle() const;
00440     bool isNull() const;
00441 
00442 protected:
00443     MediaListImpl *impl;
00444 };
00445 
00446 class LinkStyleImpl;
00447 
00448 class LinkStyle
00449 {
00450 public:
00451     LinkStyle();
00452     LinkStyle(const LinkStyle &other);
00453 
00454     LinkStyle & operator = (const LinkStyle &other);
00455     LinkStyle & operator = (const Node &other);
00456 
00457     ~LinkStyle();
00458 
00459     StyleSheet sheet();
00460 
00461     bool isNull() const;
00462 
00463 protected:
00464     DOM::NodeImpl *node;
00465     LinkStyleImpl *impl;
00466 };
00467 
00468 class DocumentStyleImpl;
00469 
00470 class DocumentStyle
00471 {
00472 public:
00473     DocumentStyle();
00474     DocumentStyle(const DocumentStyle &other);
00475 
00476     DocumentStyle & operator = (const DocumentStyle &other);
00477     DocumentStyle & operator = (const Document &other);
00478 
00479     ~DocumentStyle();
00480 
00481     StyleSheetList styleSheets();
00482 
00483     bool isNull() const;
00484 
00485 protected:
00486     DOM::DocumentImpl *doc;
00487     DocumentStyleImpl *impl;
00488 };
00489 
00490 }; // namespace
00491 
00492 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:34 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001