HaikuDepot: notify work status from main window
[haiku.git] / src / libs / icon / Icon.h
blobdeb890648ffb345895eaaeaaab0cea0d49210fc1
1 /*
2 * Copyright 2007, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
8 #ifndef ICON_H
9 #define ICON_H
12 #include "IconBuild.h"
13 #include "ShapeContainer.h"
15 #ifdef ICON_O_MATIC
16 # include <List.h>
17 # include <Referenceable.h>
19 # include "Observer.h"
20 #else
21 # include <SupportDefs.h>
22 #endif
24 class BRect;
27 _BEGIN_ICON_NAMESPACE
30 class PathContainer;
31 class StyleContainer;
33 #ifdef ICON_O_MATIC
34 class IconListener {
35 public:
36 IconListener();
37 virtual ~IconListener();
39 virtual void AreaInvalidated(const BRect& area) = 0;
41 #endif
43 #ifdef ICON_O_MATIC
44 class Icon : public ShapeContainerListener,
45 public Observer,
46 public BReferenceable {
47 #else
48 class Icon {
49 #endif
51 public:
52 Icon();
53 Icon(const Icon& other);
54 virtual ~Icon();
56 status_t InitCheck() const;
58 StyleContainer* Styles() const
59 { return fStyles; }
60 PathContainer* Paths() const
61 { return fPaths; }
62 ShapeContainer* Shapes() const
63 { return fShapes; }
65 Icon* Clone() const;
66 void MakeEmpty();
68 private:
70 StyleContainer* fStyles;
71 PathContainer* fPaths;
72 ShapeContainer* fShapes;
74 #ifdef ICON_O_MATIC
75 public:
76 // ShapeContainerListener interface
77 virtual void ShapeAdded(Shape* shape, int32 index);
78 virtual void ShapeRemoved(Shape* shape);
80 // Observer interface
81 virtual void ObjectChanged(const Observable* object);
83 // Icon
84 bool AddListener(IconListener* listener);
85 bool RemoveListener(IconListener* listener);
87 private:
88 void _NotifyAreaInvalidated(
89 const BRect& area) const;
90 BList fListeners;
91 #endif
95 _END_ICON_NAMESPACE
98 #endif // ICON_H