css_stylesheet.h
/*
* This file is part of the DOM implementation for KDE.
*
* (C) 1999 Lars Knoll (knoll@kde.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* This file includes excerpts from the Document Object Model (DOM)
* Level 2 Specification (Candidate Recommendation)
* http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/
* Copyright © 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved.
*
*/
#ifndef _CSS_css_stylesheet_h_
#define _CSS_css_stylesheet_h_
#include <dom/dom_string.h>
#include <dom/dom_node.h>
#include <dom/dom_misc.h>
#include <kdelibs_export.h>
namespace DOM {
class StyleSheetImpl;
class MediaList;
class NodeImpl;
class DocumentImpl;
class KHTML_EXPORT StyleSheet
{
public:
StyleSheet();
StyleSheet(const StyleSheet &other);
StyleSheet(StyleSheetImpl *impl);
public:
StyleSheet & operator = (const StyleSheet &other);
~StyleSheet();
DOM::DOMString type() const;
bool disabled() const;
void setDisabled( bool );
DOM::Node ownerNode() const;
StyleSheet parentStyleSheet() const;
DOM::DOMString href() const;
DOM::DOMString title() const;
MediaList media() const;
bool isCSSStyleSheet() const;
StyleSheetImpl *handle() const { return impl; }
bool isNull() const { return !impl; }
protected:
StyleSheetImpl *impl;
};
class KHTML_EXPORT CSSException
{
public:
CSSException(unsigned short _code) { code = _code; }
CSSException(const CSSException &other) { code = other.code; }
CSSException & operator = (const CSSException &other)
{ code = other.code; return *this; }
virtual ~CSSException() {}
unsigned short code;
enum ExceptionCode
{
SYNTAX_ERR = 0,
INVALID_MODIFICATION_ERR = 1,
_EXCEPTION_OFFSET = 1000
};
};
class CSSStyleSheetImpl;
class CSSRule;
class CSSRuleList;
class KHTML_EXPORT CSSStyleSheet : public StyleSheet
{
public:
CSSStyleSheet();
CSSStyleSheet(const CSSStyleSheet &other);
CSSStyleSheet(const StyleSheet &other);
CSSStyleSheet(CSSStyleSheetImpl *impl);
public:
CSSStyleSheet & operator = (const CSSStyleSheet &other);
CSSStyleSheet & operator = (const StyleSheet &other);
~CSSStyleSheet();
CSSRule ownerRule() const;
CSSRuleList cssRules() const;
unsigned long insertRule ( const DOM::DOMString &rule, unsigned long index );
void deleteRule ( unsigned long index );
};
class StyleSheetListImpl;
class StyleSheet;
class KHTML_EXPORT StyleSheetList
{
public:
StyleSheetList();
StyleSheetList(const StyleSheetList &other);
StyleSheetList(StyleSheetListImpl *impl);
public:
StyleSheetList & operator = (const StyleSheetList &other);
~StyleSheetList();
unsigned long length() const;
StyleSheet item ( unsigned long index );
StyleSheetListImpl *handle() const;
bool isNull() const;
protected:
StyleSheetListImpl *impl;
};
class MediaListImpl;
class CSSRule;
class CSSStyleSheet;
class KHTML_EXPORT MediaList
{
public:
MediaList();
MediaList(const MediaList &other);
MediaList(MediaListImpl *impl);
public:
MediaList & operator = (const MediaList &other);
~MediaList();
DOM::DOMString mediaText() const;
void setMediaText(const DOM::DOMString &value);
unsigned long length() const;
DOM::DOMString item(unsigned long index) const;
void deleteMedium(const DOM::DOMString &oldMedium);
void appendMedium(const DOM::DOMString &newMedium);
MediaListImpl *handle() const;
bool isNull() const;
protected:
MediaListImpl *impl;
};
class LinkStyleImpl;
class KHTML_EXPORT LinkStyle
{
public:
LinkStyle();
LinkStyle(const LinkStyle &other);
LinkStyle & operator = (const LinkStyle &other);
LinkStyle & operator = (const Node &other);
~LinkStyle();
StyleSheet sheet();
bool isNull() const;
protected:
DOM::NodeImpl *node;
LinkStyleImpl *impl;
};
class DocumentStyleImpl;
class KHTML_EXPORT DocumentStyle
{
public:
DocumentStyle();
DocumentStyle(const DocumentStyle &other);
DocumentStyle & operator = (const DocumentStyle &other);
DocumentStyle & operator = (const Document &other);
~DocumentStyle();
// KDE 4:: make const
StyleSheetList styleSheets();
DOMString preferredStylesheetSet() const;
DOMString selectedStylesheetSet() const;
void setSelectedStylesheetSet( const DOMString& aString );
bool isNull() const { return !impl; }
protected:
DOM::DocumentImpl *doc;
DocumentStyleImpl *impl;
};
} // namespace
#endif
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:274
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i...
Definition: css_stylesheet.h:207
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:363
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets...
Definition: css_stylesheet.h:309
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::CSSRuleList
The CSSRuleList interface provides the abstraction of an ordered collection of CSS rules...
Definition: css_rule.h:484
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:58
DOM::CSSRule
The CSSRule interface is the abstract base interface for any type of CSS statement ...
Definition: css_rule.h:52
DOM::CSSException
This exception is raised when a specific CSS operation is impossible to perform.
Definition: css_stylesheet.h:173
DOM::CSSException::code
unsigned short code
An integer indicating the type of error generated.
Definition: css_stylesheet.h:187

KDE Home | KDE Accessibility Home | Description of Access Keys