~ubuntu-branches/ubuntu/maverick/webkit/maverick

« back to all changes in this revision

Viewing changes to WebCore/css/StyleBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Mike Hommey
  • Date: 2007-08-19 15:54:12 UTC
  • Revision ID: james.westby@ubuntu.com-20070819155412-uxxg1h9plpghmtbi
Tags: upstream-0~svn25144
ImportĀ upstreamĀ versionĀ 0~svn25144

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the CSS implementation for KDE.
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
18
 *
 
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.
 
23
 */
 
24
 
 
25
#ifndef StyleBase_h
 
26
#define StyleBase_h
 
27
 
 
28
#include "Shared.h"
 
29
 
 
30
namespace WebCore {
 
31
 
 
32
    class String;
 
33
    class StyleSheet;
 
34
 
 
35
    // a style class which has a parent (almost all have)
 
36
    class StyleBase : public Shared<StyleBase> {
 
37
    public:
 
38
        StyleBase(StyleBase* parent)
 
39
            : m_parent(parent)
 
40
            , m_strictParsing(!parent || parent->useStrictParsing())
 
41
        { }
 
42
        virtual ~StyleBase() { }
 
43
 
 
44
        StyleBase* parent() const { return m_parent; }
 
45
        void setParent(StyleBase* parent) { m_parent = parent; }
 
46
 
 
47
        // returns the url of the style sheet this object belongs to
 
48
        String baseURL();
 
49
 
 
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; }
 
69
#if ENABLE(SVG)
 
70
        virtual bool isSVGColor() const { return false; }
 
71
        virtual bool isSVGPaint() const { return false; }
 
72
#endif
 
73
 
 
74
        virtual bool parseString(const String&, bool /*strict*/ = false) { return false; }
 
75
        virtual void checkLoaded();
 
76
 
 
77
        void setStrictParsing(bool b) { m_strictParsing = b; }
 
78
        bool useStrictParsing() const { return m_strictParsing; }
 
79
 
 
80
        virtual void insertedIntoParent() { }
 
81
 
 
82
        StyleSheet* stylesheet();
 
83
 
 
84
    private:
 
85
        StyleBase* m_parent;
 
86
        bool m_strictParsing;
 
87
    };
 
88
}
 
89
 
 
90
#endif