2002-10-29 21:38:31 +03:00
|
|
|
/*******************************************************************************
|
|
|
|
/
|
|
|
|
/ File: ListItem.h
|
|
|
|
/
|
|
|
|
/ Description: BListView represents a one-dimensional list view.
|
|
|
|
/
|
|
|
|
/ Copyright 1996-98, Be Incorporated, All Rights Reserved
|
|
|
|
/
|
|
|
|
*******************************************************************************/
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#ifndef _LIST_ITEM_H
|
|
|
|
#define _LIST_ITEM_H
|
|
|
|
|
|
|
|
#include <BeBuild.h>
|
|
|
|
#include <Archivable.h>
|
|
|
|
#include <Rect.h>
|
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
class BFont;
|
|
|
|
class BMessage;
|
|
|
|
class BOutlineListView;
|
|
|
|
class BView;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------*/
|
|
|
|
/*----- BListItem class ------------------------------------------*/
|
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
class BListItem : public BArchivable {
|
2002-07-09 16:24:59 +04:00
|
|
|
public:
|
2002-10-29 21:38:31 +03:00
|
|
|
BListItem(uint32 outlineLevel = 0, bool expanded = true);
|
|
|
|
BListItem(BMessage *data);
|
|
|
|
virtual ~BListItem();
|
|
|
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
float Height() const;
|
|
|
|
float Width() const;
|
|
|
|
bool IsSelected() const;
|
|
|
|
void Select();
|
|
|
|
void Deselect();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
virtual void SetEnabled(bool on);
|
|
|
|
bool IsEnabled() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
void SetHeight(float height);
|
|
|
|
void SetWidth(float width);
|
|
|
|
virtual void DrawItem(BView *owner,
|
|
|
|
BRect bounds,
|
|
|
|
bool complete = false) = 0;
|
|
|
|
virtual void Update(BView *owner, const BFont *font);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
virtual status_t Perform(perform_code d, void *arg);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 21:38:31 +03:00
|
|
|
bool IsExpanded() const;
|
|
|
|
void SetExpanded(bool expanded);
|
|
|
|
uint32 OutlineLevel() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
/*----- Private or reserved -----------------------------------------*/
|
|
|
|
private:
|
2002-10-29 21:38:31 +03:00
|
|
|
friend class BOutlineListView;
|
|
|
|
|
|
|
|
bool HasSubitems() const;
|
|
|
|
|
|
|
|
virtual void _ReservedListItem1();
|
|
|
|
virtual void _ReservedListItem2();
|
|
|
|
|
|
|
|
BListItem(const BListItem &);
|
|
|
|
BListItem &operator=(const BListItem &);
|
|
|
|
|
|
|
|
/* calls used by BOutlineListView*/
|
|
|
|
bool IsItemVisible() const;
|
|
|
|
void SetItemVisible(bool);
|
|
|
|
|
|
|
|
uint32 _reserved[2];
|
|
|
|
float fWidth;
|
|
|
|
float fHeight;
|
|
|
|
uint32 fLevel;
|
|
|
|
bool fSelected;
|
|
|
|
bool fEnabled;
|
|
|
|
bool fExpanded;
|
|
|
|
bool fHasSubitems : 1;
|
|
|
|
bool fVisible : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------*/
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-29 22:52:00 +03:00
|
|
|
#include <StringItem.h> /* to maintain compatibility */
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif /* _LIST_ITEM_H */
|