haiku/src/libs/icon/Icon.h
Axel Dörfler 325a6253ce * Put the remaining libicon.a classes into the BPrivate::Icon namespace.
* Minor cleanup (like removing the extra blank line between the copyright and the
  header guard).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-02 09:08:57 +00:00

97 lines
1.7 KiB
C++

/*
* Copyright 2007, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Stephan Aßmus <superstippi@gmx.de>
*/
#ifndef ICON_H
#define ICON_H
#include "ShapeContainer.h"
#ifdef ICON_O_MATIC
# include <List.h>
# include "Observer.h"
# include "Referenceable.h"
#else
# include <SupportDefs.h>
#endif
class BRect;
namespace BPrivate {
namespace Icon {
class PathContainer;
class StyleContainer;
#ifdef ICON_O_MATIC
class IconListener {
public:
IconListener();
virtual ~IconListener();
virtual void AreaInvalidated(const BRect& area) = 0;
};
#endif
#ifdef ICON_O_MATIC
class Icon : public ShapeContainerListener,
public Observer,
public Referenceable {
#else
class Icon {
#endif
public:
Icon();
Icon(const Icon& other);
virtual ~Icon();
status_t InitCheck() const;
StyleContainer* Styles() const
{ return fStyles; }
PathContainer* Paths() const
{ return fPaths; }
ShapeContainer* Shapes() const
{ return fShapes; }
Icon* Clone() const;
void MakeEmpty();
private:
StyleContainer* fStyles;
PathContainer* fPaths;
ShapeContainer* fShapes;
#ifdef ICON_O_MATIC
public:
// ShapeContainerListener interface
virtual void ShapeAdded(Shape* shape, int32 index);
virtual void ShapeRemoved(Shape* shape);
// Observer interface
virtual void ObjectChanged(const Observable* object);
// Icon
bool AddListener(IconListener* listener);
bool RemoveListener(IconListener* listener);
private:
void _NotifyAreaInvalidated(
const BRect& area) const;
BList fListeners;
#endif
};
} // namespace Icon
} // namespace BPrivate
#endif // ICON_H