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

https://github.com/aharish/totoro-gb-opensource-update2 · C Header · 59 lines · 27 code · 13 blank · 19 comment · 0 complexity · a60b3004363c6ebca5485046c6f87c4b MD5 · raw file

  1. /*
  2. * (C) 1999-2003 Lars Knoll (knoll@kde.org)
  3. * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
  4. *
  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.
  9. *
  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.
  14. *
  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.
  19. */
  20. #ifndef CSSImageValue_h
  21. #define CSSImageValue_h
  22. #include "CSSPrimitiveValue.h"
  23. #include "CachedResourceClient.h"
  24. #include <wtf/RefPtr.h>
  25. namespace WebCore {
  26. class DocLoader;
  27. class StyleCachedImage;
  28. class CSSImageValue : public CSSPrimitiveValue, private CachedResourceClient {
  29. public:
  30. static PassRefPtr<CSSImageValue> create() { return adoptRef(new CSSImageValue); }
  31. static PassRefPtr<CSSImageValue> create(const String& url) { return adoptRef(new CSSImageValue(url)); }
  32. virtual ~CSSImageValue();
  33. virtual StyleCachedImage* cachedImage(DocLoader*);
  34. virtual bool isImageValue() const { return true; }
  35. protected:
  36. CSSImageValue(const String& url);
  37. StyleCachedImage* cachedImage(DocLoader*, const String& url);
  38. String cachedImageURL();
  39. void clearCachedImage();
  40. private:
  41. CSSImageValue();
  42. RefPtr<StyleCachedImage> m_image;
  43. bool m_accessedImage;
  44. };
  45. } // namespace WebCore
  46. #endif // CSSImageValue_h