KHTML
SVGResource.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef SVGResource_h
00027 #define SVGResource_h
00028
00029 #if ENABLE(SVG)
00030 #include "PlatformString.h"
00031
00032
00033 #include <wtf/HashMap.h>
00034 #include <wtf/HashSet.h>
00035 #include <wtf/RefCounted.h>
00036
00037 #include "Document.h"
00038
00039 namespace WebCore {
00040
00041
00042
00043 class SVGStyledElement;
00044
00045
00046 enum SVGResourceType {
00047
00048 ClipperResourceType = 0,
00049 MarkerResourceType,
00050 ImageResourceType,
00051 FilterResourceType,
00052 MaskerResourceType,
00053 PaintServerResourceType,
00054
00055
00056 _ResourceTypeCount
00057 };
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 class SVGResource : public RefCounted<SVGResource> {
00070 public:
00071 virtual ~SVGResource();
00072
00073 virtual void invalidate();
00074
00075 void addClient(SVGStyledElement*);
00076 virtual SVGResourceType resourceType() const = 0;
00077
00078 bool isPaintServer() const { return resourceType() == PaintServerResourceType; }
00079 bool isFilter() const { return resourceType() == FilterResourceType; }
00080 bool isClipper() const { return resourceType() == ClipperResourceType; }
00081 bool isMarker() const { return resourceType() == MarkerResourceType; }
00082 bool isMasker() const { return resourceType() == MaskerResourceType; }
00083
00084
00085
00086 static void invalidateClients(HashSet<SVGStyledElement*>);
00087 static void removeClient(SVGStyledElement*);
00088
00089 protected:
00090 SVGResource();
00091
00092 private:
00093 HashSet<SVGStyledElement*> m_clients;
00094 };
00095
00096 SVGResource* getResourceById(Document*, const AtomicString&);
00097
00098
00099
00100 }
00101
00102 #endif
00103 #endif // SVGResource_h