/platform/external/webkit/WebCore/css/CSSImportRule.h

https://github.com/aharish/totoro-gb-opensource-update2 · C Header · 85 lines · 43 code · 18 blank · 24 comment · 0 complexity · 624efe90e0e39b6539ee47d9b49526e0 MD5 · raw file

  1. /*
  2. * (C) 1999-2003 Lars Knoll (knoll@kde.org)
  3. * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
  4. * Copyright (C) 2002, 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. #ifndef CSSImportRule_h
  22. #define CSSImportRule_h
  23. #include "CSSRule.h"
  24. #include "CachedResourceClient.h"
  25. #include "CachedResourceHandle.h"
  26. #include "MediaList.h"
  27. #include "PlatformString.h"
  28. namespace WebCore {
  29. class CachedCSSStyleSheet;
  30. class MediaList;
  31. class CSSImportRule : public CSSRule, private CachedResourceClient {
  32. public:
  33. static PassRefPtr<CSSImportRule> create(CSSStyleSheet* parent, const String& href, PassRefPtr<MediaList> media)
  34. {
  35. return adoptRef(new CSSImportRule(parent, href, media));
  36. }
  37. virtual ~CSSImportRule();
  38. String href() const { return m_strHref; }
  39. MediaList* media() const { return m_lstMedia.get(); }
  40. CSSStyleSheet* styleSheet() const { return m_styleSheet.get(); }
  41. virtual String cssText() const;
  42. // Not part of the CSSOM
  43. bool isLoading() const;
  44. virtual void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
  45. private:
  46. CSSImportRule(CSSStyleSheet* parent, const String& href, PassRefPtr<MediaList>);
  47. virtual bool isImportRule() { return true; }
  48. virtual void insertedIntoParent();
  49. // from CSSRule
  50. virtual unsigned short type() const { return IMPORT_RULE; }
  51. // from CachedResourceClient
  52. virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CachedCSSStyleSheet*);
  53. #ifdef ANDROID_INSTRUMENT
  54. // Overridden to resolve the ambiguous
  55. void* operator new(size_t size);
  56. void* operator new[](size_t size);
  57. void operator delete(void* p, size_t size);
  58. void operator delete[](void* p, size_t size);
  59. #endif
  60. String m_strHref;
  61. RefPtr<MediaList> m_lstMedia;
  62. RefPtr<CSSStyleSheet> m_styleSheet;
  63. CachedResourceHandle<CachedCSSStyleSheet> m_cachedSheet;
  64. bool m_loading;
  65. };
  66. } // namespace WebCore
  67. #endif // CSSImportRule_h