00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef Icon_h
00022 #define Icon_h
00023
00024 #include "Shared.h"
00025 #include <wtf/Forward.h>
00026
00027 #if PLATFORM(MAC)
00028 #include <wtf/RetainPtr.h>
00029 #ifdef __OBJC__
00030 @class NSImage;
00031 #else
00032 class NSImage;
00033 #endif
00034 #elif PLATFORM(WIN)
00035 typedef struct HICON__* HICON;
00036 #elif PLATFORM(QT)
00037 #include <QIcon>
00038 #endif
00039
00040 namespace WebCore {
00041
00042 class GraphicsContext;
00043 class IntRect;
00044 class String;
00045
00046 class Icon : public Shared<Icon> {
00047 public:
00048 Icon();
00049 ~Icon();
00050
00051 static PassRefPtr<Icon> newIconForFile(const String& filename);
00052
00053 void paint(GraphicsContext*, const IntRect&);
00054
00055 #if PLATFORM(WIN)
00056 Icon(HICON);
00057 #endif
00058
00059 private:
00060 #if PLATFORM(MAC)
00061 Icon(NSImage*);
00062 #endif
00063 #if PLATFORM(MAC)
00064 RetainPtr<NSImage> m_nsImage;
00065 #elif PLATFORM(WIN)
00066 HICON m_hIcon;
00067 #elif PLATFORM(QT)
00068 QIcon m_icon;
00069 #endif
00070 };
00071
00072 }
00073
00074 #endif