/* * Copyright 2006-2007, 2023, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus * Zardshard */ #ifndef SHAPE_LIST_VIEW_H #define SHAPE_LIST_VIEW_H #include "Container.h" #include "ListViews.h" #include "IconBuild.h" class BMenu; class BMenuItem; class CommandStack; class ShapeListItem; class Selection; _BEGIN_ICON_NAMESPACE class Style; class Shape; class VectorPath; _END_ICON_NAMESPACE _USING_ICON_NAMESPACE enum { MSG_ADD_SHAPE = 'adsh', MSG_ADD_REFERENCE_IMAGE = 'aimg', }; class ShapeListView : public SimpleListView, public ContainerListener { public: ShapeListView(BRect frame, const char* name, BMessage* selectionMessage = NULL, BHandler* target = NULL); virtual ~ShapeListView(); // SimpleListView interface virtual void SelectionChanged(); virtual void MessageReceived(BMessage* message); virtual void MakeDragMessage(BMessage* message) const; virtual bool AcceptDragMessage(const BMessage* message) const; virtual void SetDropTargetRect(const BMessage* message, BPoint where); virtual bool HandleDropMessage(const BMessage* message, int32 dropIndex); virtual void MoveItems(BList& items, int32 toIndex); virtual void CopyItems(BList& items, int32 toIndex); virtual void RemoveItemList(BList& items); virtual BListItem* CloneItem(int32 atIndex) const; virtual int32 IndexOfSelectable(Selectable* selectable) const; virtual Selectable* SelectableFor(BListItem* item) const; // ContainerListener interface virtual void ItemAdded(Shape* shape, int32 index); virtual void ItemRemoved(Shape* shape); // ShapeListView void SetMenu(BMenu* menu); void SetShapeContainer(Container* container); void SetStyleContainer(Container