2 * Copyright 2006-2007, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
8 #ifndef SHAPE_CONTAINER_H
9 #define SHAPE_CONTAINER_H
14 #include "IconBuild.h"
23 class ShapeContainerListener
{
25 ShapeContainerListener();
26 virtual ~ShapeContainerListener();
28 virtual void ShapeAdded(Shape
* shape
, int32 index
) = 0;
29 virtual void ShapeRemoved(Shape
* shape
) = 0;
31 #endif // ICON_O_MATIC
33 class ShapeContainer
{
36 virtual ~ShapeContainer();
38 bool AddShape(Shape
* shape
);
39 bool AddShape(Shape
* shape
, int32 index
);
40 bool RemoveShape(Shape
* shape
);
41 Shape
* RemoveShape(int32 index
);
45 int32
CountShapes() const;
46 bool HasShape(Shape
* shape
) const;
47 int32
IndexOf(Shape
* shape
) const;
49 Shape
* ShapeAt(int32 index
) const;
50 Shape
* ShapeAtFast(int32 index
) const;
59 bool AddListener(ShapeContainerListener
* listener
);
61 ShapeContainerListener
* listener
);
64 void _NotifyShapeAdded(Shape
* shape
,
66 void _NotifyShapeRemoved(Shape
* shape
) const;
69 #endif // ICON_O_MATIC
76 #endif // SHAPE_CONTAINER_H