2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
25 #include "PlatformString.h"
26 #include "StyleList.h"
27 #include <wtf/ListHashSet.h>
31 class CachedCSSStyleSheet;
35 class StyleSheet : public StyleList {
37 virtual ~StyleSheet();
39 bool disabled() const { return m_disabled; }
40 void setDisabled(bool disabled) { m_disabled = disabled; styleSheetChanged(); }
42 Node* ownerNode() const { return m_parentNode; }
43 StyleSheet *parentStyleSheet() const;
45 // Note that href is the URL that started the redirect chain that led to
46 // this style sheet. This property probably isn't useful for much except
47 // the JavaScript binding (which needs to use this value for security).
48 const String& href() const { return m_originalURL; }
50 void setFinalURL(const KURL& finalURL) { m_finalURL = finalURL; }
51 const KURL& finalURL() const { return m_finalURL; }
53 const String& title() const { return m_strTitle; }
54 void setTitle(const String& s) { m_strTitle = s; }
55 MediaList* media() const { return m_media.get(); }
56 void setMedia(PassRefPtr<MediaList>);
58 virtual String type() const = 0;
59 virtual bool isLoading() = 0;
60 virtual void styleSheetChanged() { }
62 virtual KURL completeURL(const String& url) const;
63 virtual void addSubresourceStyleURLs(ListHashSet<KURL>&) { }
65 virtual bool parseString(const String&, bool strict = true) = 0;
68 StyleSheet(Node* ownerNode, const String& href, const KURL& finalURL);
69 StyleSheet(StyleSheet* parentSheet, const String& href, const KURL& finalURL);
70 StyleSheet(StyleBase* owner, const String& href, const KURL& finalURL);
73 virtual bool isStyleSheet() const { return true; }
79 RefPtr<MediaList> m_media;