2
* This file is part of the CSS implementation for KDE.
4
* Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
5
* Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
6
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmial.com)
7
* Copyright (C) 2004, 2006 Apple Computer, Inc.
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Library General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Library General Public License for more details.
19
* You should have received a copy of the GNU Library General Public License
20
* along with this library; see the file COPYING.LIB. If not, write to
21
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
* Boston, MA 02111-1307, USA.
35
// a style class which has a parent (almost all have)
36
class StyleBase : public Shared<StyleBase> {
38
StyleBase(StyleBase* parent)
40
, m_strictParsing(!parent || parent->useStrictParsing())
42
virtual ~StyleBase() { }
44
StyleBase* parent() const { return m_parent; }
45
void setParent(StyleBase* parent) { m_parent = parent; }
47
// returns the url of the style sheet this object belongs to
50
virtual bool isStyleSheet() const { return false; }
51
virtual bool isCSSStyleSheet() const { return false; }
52
virtual bool isXSLStyleSheet() const { return false; }
53
virtual bool isStyleSheetList() const { return false; }
54
virtual bool isMediaList() { return false; }
55
virtual bool isRuleList() { return false; }
56
virtual bool isRule() { return false; }
57
virtual bool isStyleRule() { return false; }
58
virtual bool isCharsetRule() { return false; }
59
virtual bool isImportRule() { return false; }
60
virtual bool isMediaRule() { return false; }
61
virtual bool isFontFaceRule() { return false; }
62
virtual bool isPageRule() { return false; }
63
virtual bool isUnknownRule() { return false; }
64
virtual bool isStyleDeclaration() { return false; }
65
virtual bool isValue() { return false; }
66
virtual bool isPrimitiveValue() const { return false; }
67
virtual bool isValueList() { return false; }
68
virtual bool isValueCustom() { return false; }
70
virtual bool isSVGColor() const { return false; }
71
virtual bool isSVGPaint() const { return false; }
74
virtual bool parseString(const String&, bool /*strict*/ = false) { return false; }
75
virtual void checkLoaded();
77
void setStrictParsing(bool b) { m_strictParsing = b; }
78
bool useStrictParsing() const { return m_strictParsing; }
80
virtual void insertedIntoParent() { }
82
StyleSheet* stylesheet();