• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef XSLImportRule_h
24 #define XSLImportRule_h
25 
26 #if ENABLE(XSLT)
27 
28 #include "CachedResourceClient.h"
29 #include "CachedResourceHandle.h"
30 #include "StyleBase.h"
31 #include "XSLStyleSheet.h"
32 
33 namespace WebCore {
34 
35 class CachedXSLStyleSheet;
36 
37 class XSLImportRule : public StyleBase, private CachedResourceClient {
38 public:
create(XSLStyleSheet * parentSheet,const String & href)39     static PassRefPtr<XSLImportRule> create(XSLStyleSheet* parentSheet, const String& href)
40     {
41         return adoptRef(new XSLImportRule(parentSheet, href));
42     }
43 
44     virtual ~XSLImportRule();
45 
href()46     const String& href() const { return m_strHref; }
styleSheet()47     XSLStyleSheet* styleSheet() const { return m_styleSheet.get(); }
48 
49     XSLStyleSheet* parentStyleSheet() const;
50 
51     bool isLoading();
52     void loadSheet();
53 
54 private:
55     XSLImportRule(XSLStyleSheet* parentSheet, const String& href);
56 
isImportRule()57     virtual bool isImportRule() { return true; }
58 
59     // from CachedResourceClient
60     virtual void setXSLStyleSheet(const String& url, const String& sheet);
61 
62     String m_strHref;
63     RefPtr<XSLStyleSheet> m_styleSheet;
64     CachedResourceHandle<CachedXSLStyleSheet> m_cachedSheet;
65     bool m_loading;
66 };
67 
68 } // namespace WebCore
69 
70 #endif // ENABLE(XSLT)
71 
72 #endif // XSLImportRule_h
73