#ifndef Icon_h
#define Icon_h
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
#if PLATFORM(IOS)
#include "NativeImage.h"
#include <CoreGraphics/CoreGraphics.h>
#elif PLATFORM(MAC)
OBJC_CLASS NSImage;
#elif PLATFORM(WIN)
typedef struct HICON__* HICON;
#elif PLATFORM(GTK)
typedef struct _GdkPixbuf GdkPixbuf;
#endif
namespace WebCore {
class GraphicsContext;
class FloatRect;
class Icon : public RefCounted<Icon> {
public:
WEBCORE_EXPORT static RefPtr<Icon> createIconForFiles(const Vector<String>& filenames);
WEBCORE_EXPORT ~Icon();
void paint(GraphicsContext&, const FloatRect&);
#if PLATFORM(WIN)
static RefPtr<Icon> create(HICON hIcon) { return adoptRef(new Icon(hIcon)); }
#endif
#if PLATFORM(IOS)
WEBCORE_EXPORT static RefPtr<Icon> createIconForImage(const NativeImagePtr&);
#endif
#if PLATFORM(MAC)
static RefPtr<Icon> createIconForUTI(const String&);
static RefPtr<Icon> createIconForFileExtension(const String&);
#endif
private:
#if PLATFORM(IOS)
Icon(const RetainPtr<CGImageRef>&);
RetainPtr<CGImageRef> m_cgImage;
#elif PLATFORM(MAC)
Icon(NSImage*);
RetainPtr<NSImage> m_nsImage;
#elif PLATFORM(WIN)
Icon(HICON);
HICON m_hIcon;
#elif PLATFORM(GTK)
Icon();
GdkPixbuf* m_icon;
#endif
};
}
#endif