29 #ifndef Pt_Forms_Icon_h
30 #define Pt_Forms_Icon_h
32 #include <Pt/Forms/Api.h>
33 #include <Pt/Gfx/Size.h>
34 #include <Pt/Gfx/Image.h>
35 #include <Pt/System/Path.h>
45 class PT_FORMS_API IconProvider
47 friend class IconImpl;
52 virtual ~IconProvider();
54 virtual bool empty()
const = 0;
56 virtual void clear() = 0;
58 virtual void addImage(
const Gfx::SizeF& size,
const Gfx::Image& image) = 0;
60 virtual void addImage(
const Gfx::SizeF& size,
const System::Path& path) = 0;
62 virtual Gfx::SizeF minimumSize()
const = 0;
64 virtual Gfx::SizeF maximumSize()
const = 0;
66 virtual const Gfx::Image& getImage(
const Gfx::SizeF& area) = 0;
69 void attachIcon(IconImpl* parent);
71 void detachIcon(IconImpl* parent);
74 std::vector<IconImpl*> _icons;
78 class PT_FORMS_API Icon
83 Icon(
const Icon& icon);
85 Icon(IconProvider& provider);
89 Icon& operator=(
const Icon& icon);
95 void addImage(
const Gfx::Image& image);
97 void addImage(
const Gfx::SizeF& size,
const Gfx::Image& image);
99 void addImage(
const Gfx::SizeF& size,
const System::Path& path);
101 void addImage(
double width,
double height,
const System::Path& path);
103 const Gfx::Image& getImage(
const Gfx::SizeF& area)
const;
105 Gfx::SizeF minimumSize()
const;
107 Gfx::SizeF maximumSize()
const;
113 mutable class IconImpl* _impl;