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  */
00027 #ifndef _CSS_css_stylesheet_h_
00028 #define _CSS_css_stylesheet_h_
00029 
00030 #include <dom/dom_string.h>
00031 #include <dom/dom_node.h>
00032 #include <dom/dom_misc.h>
00033 
00034 
00035 namespace DOM {
00036 
00037 class StyleSheetImpl;
00038 class MediaList;
00039 class NodeImpl;
00040 class DocumentImpl;
00041 
00057 class StyleSheet
00058 {
00059 public:
00060     StyleSheet();
00061     StyleSheet(const StyleSheet &other);
00062     StyleSheet(StyleSheetImpl *impl);
00063 public:
00064 
00065     StyleSheet & operator = (const StyleSheet &other);
00066 
00067     ~StyleSheet();
00068 
00085     DOM::DOMString type() const;
00086 
00093     bool disabled() const;
00094 
00098     void setDisabled( bool );
00099 
00108     DOM::Node ownerNode() const;
00109 
00118     StyleSheet parentStyleSheet() const;
00119 
00131     DOM::DOMString href() const;
00132 
00143     DOM::DOMString title() const;
00144 
00155     MediaList media() const;
00156 
00160     bool isCSSStyleSheet() const;
00161     StyleSheetImpl *handle() const { return impl; }
00162     bool isNull() const { return !impl; }
00163 protected:
00164     StyleSheetImpl *impl;
00165 };
00166 
00167 
00172 class CSSException
00173 {
00174 public:
00175     CSSException(unsigned short _code) { code = _code; }
00176     CSSException(const CSSException &other) { code = other.code; }
00177 
00178     CSSException & operator = (const CSSException &other)
00179         { code = other.code; return *this; }
00180 
00181     virtual ~CSSException() {}
00186     unsigned short   code;
00187 
00188     enum ExceptionCode
00189     {
00190         SYNTAX_ERR                     = 0,
00191         INVALID_MODIFICATION_ERR       = 1,
00192         _EXCEPTION_OFFSET              = 1000
00193     };
00194 };
00195 
00196 class CSSStyleSheetImpl;
00197 class CSSRule;
00198 class CSSRuleList;
00199 
00206 class CSSStyleSheet : public StyleSheet
00207 {
00208 public:
00209     CSSStyleSheet();
00210     CSSStyleSheet(const CSSStyleSheet &other);
00211     CSSStyleSheet(const StyleSheet &other);
00212     CSSStyleSheet(CSSStyleSheetImpl *impl);
00213 public:
00214 
00215     CSSStyleSheet & operator = (const CSSStyleSheet &other);
00216     CSSStyleSheet & operator = (const StyleSheet &other);
00217 
00218     ~CSSStyleSheet();
00219 
00231     CSSRule ownerRule() const;
00232 
00242     CSSRuleList cssRules() const;
00243 
00278     unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index );
00279 
00296     void deleteRule ( unsigned long index );
00297 };
00298 
00299 
00300 class StyleSheetListImpl;
00301 class StyleSheet;
00302 
00308 class StyleSheetList
00309 {
00310 public:
00311     StyleSheetList();
00312     StyleSheetList(const StyleSheetList &other);
00313     StyleSheetList(StyleSheetListImpl *impl);
00314 public:
00315 
00316     StyleSheetList & operator = (const StyleSheetList &other);
00317 
00318     ~StyleSheetList();
00319 
00326     unsigned long length() const;
00327 
00338     StyleSheet item ( unsigned long index );
00339 
00343     StyleSheetListImpl *handle() const;
00344     bool isNull() const;
00345 
00346 protected:
00347     StyleSheetListImpl *impl;
00348 };
00349 
00350 
00351 class MediaListImpl;
00352 class CSSRule;
00353 class CSSStyleSheet;
00354 
00362 class MediaList
00363 {
00364 public:
00365     MediaList();
00366     MediaList(const MediaList &other);
00367     MediaList(MediaListImpl *impl);
00368 public:
00369 
00370     MediaList & operator = (const MediaList &other);
00371 
00372     ~MediaList();
00373 
00384     DOM::DOMString mediaText() const;
00385 
00389     void setMediaText(const DOM::DOMString &value);
00390 
00394     unsigned long length() const;
00395 
00396 
00406     DOM::DOMString item(unsigned long index) const;
00407 
00418     void deleteMedium(const DOM::DOMString &oldMedium);
00419 
00432     void appendMedium(const DOM::DOMString &newMedium);
00433 
00437     MediaListImpl *handle() const;
00438     bool isNull() const;
00439 
00440 protected:
00441     MediaListImpl *impl;
00442 };
00443 
00444 class LinkStyleImpl;
00445 
00446 class LinkStyle
00447 {
00448 public:
00449     LinkStyle();
00450     LinkStyle(const LinkStyle &other);
00451 
00452     LinkStyle & operator = (const LinkStyle &other);
00453     LinkStyle & operator = (const Node &other);
00454 
00455     ~LinkStyle();
00456 
00457     StyleSheet sheet();
00458 
00459     bool isNull() const;
00460 
00461 protected:
00462     DOM::NodeImpl *node;
00463     LinkStyleImpl *impl;
00464 };
00465 
00466 class DocumentStyleImpl;
00467 
00468 class DocumentStyle
00469 {
00470 public:
00471     DocumentStyle();
00472     DocumentStyle(const DocumentStyle &other);
00473 
00474     DocumentStyle & operator = (const DocumentStyle &other);
00475     DocumentStyle & operator = (const Document &other);
00476 
00477     ~DocumentStyle();
00478 
00479     // KDE 4:: make const
00480     StyleSheetList styleSheets();
00481 
00482     DOMString preferredStylesheetSet() const;
00483     DOMString selectedStylesheetSet() const;
00484     void setSelectedStylesheetSet( const DOMString& aString );
00485 
00486     bool isNull() const { return !impl; }
00487 
00488 protected:
00489     DOM::DocumentImpl *doc;
00490     DocumentStyleImpl *impl;
00491 };
00492 
00493 } // namespace
00494 
00495 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:51:09 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003