1/*
2 * This file is part of the XSL implementation.
3 *
4 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#pragma once
24
25#if ENABLE(XSLT)
26
27#include "CachedResourceHandle.h"
28#include "CachedStyleSheetClient.h"
29#include "XSLStyleSheet.h"
30
31namespace WebCore {
32
33class CachedXSLStyleSheet;
34
35class XSLImportRule : private CachedStyleSheetClient {
36 WTF_MAKE_FAST_ALLOCATED;
37public:
38 XSLImportRule(XSLStyleSheet* parentSheet, const String& href);
39 virtual ~XSLImportRule();
40
41 const String& href() const { return m_strHref; }
42 XSLStyleSheet* styleSheet() const { return m_styleSheet.get(); }
43
44 XSLStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; }
45 void setParentStyleSheet(XSLStyleSheet* styleSheet) { m_parentStyleSheet = styleSheet; }
46
47 bool isLoading();
48 void loadSheet();
49
50private:
51 void setXSLStyleSheet(const String& href, const URL& baseURL, const String& sheet) override;
52
53 XSLStyleSheet* m_parentStyleSheet;
54 String m_strHref;
55 RefPtr<XSLStyleSheet> m_styleSheet;
56 CachedResourceHandle<CachedXSLStyleSheet> m_cachedSheet;
57 bool m_loading;
58};
59
60} // namespace WebCore
61
62#endif // ENABLE(XSLT)
63