XSLImportRule.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #ifndef XSLImportRule_h
  23. #define XSLImportRule_h
  24. #if ENABLE(XSLT)
  25. #include "CachedResourceHandle.h"
  26. #include "CachedStyleSheetClient.h"
  27. #include "XSLStyleSheet.h"
  28. #include <wtf/PassOwnPtr.h>
  29. namespace WebCore {
  30. class CachedXSLStyleSheet;
  31. class XSLImportRule : private CachedStyleSheetClient {
  32. WTF_MAKE_FAST_ALLOCATED;
  33. public:
  34. static PassOwnPtr<XSLImportRule> create(XSLStyleSheet* parentSheet, const String& href)
  35. {
  36. return adoptPtr(new XSLImportRule(parentSheet, href));
  37. }
  38. virtual ~XSLImportRule();
  39. const String& href() const { return m_strHref; }
  40. XSLStyleSheet* styleSheet() const { return m_styleSheet.get(); }
  41. XSLStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; }
  42. void setParentStyleSheet(XSLStyleSheet* styleSheet) { m_parentStyleSheet = styleSheet; }
  43. bool isLoading();
  44. void loadSheet();
  45. private:
  46. XSLImportRule(XSLStyleSheet* parentSheet, const String& href);
  47. virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet);
  48. XSLStyleSheet* m_parentStyleSheet;
  49. String m_strHref;
  50. RefPtr<XSLStyleSheet> m_styleSheet;
  51. CachedResourceHandle<CachedXSLStyleSheet> m_cachedSheet;
  52. bool m_loading;
  53. };
  54. } // namespace WebCore
  55. #endif // ENABLE(XSLT)
  56. #endif // XSLImportRule_h