2006-02-11 18:23:23 +03:00
|
|
|
/*
|
2009-08-27 15:12:41 +04:00
|
|
|
* Copyright 2006-2009, Haiku, Inc. All rights reserved.
|
2006-02-11 18:23:23 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _STRING_ITEM_H
|
|
|
|
#define _STRING_ITEM_H
|
|
|
|
|
|
|
|
|
2006-02-11 18:23:23 +03:00
|
|
|
#include <ListItem.h>
|
2002-10-29 21:41:51 +03:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-02-11 18:23:23 +03:00
|
|
|
class BStringItem : public BListItem {
|
2009-06-17 20:26:17 +04:00
|
|
|
public:
|
2009-08-27 15:12:41 +04:00
|
|
|
BStringItem(const char* text,
|
|
|
|
uint32 outlineLevel = 0,
|
|
|
|
bool expanded = true);
|
|
|
|
BStringItem(BMessage* archive);
|
|
|
|
virtual ~BStringItem();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
virtual status_t Archive(BMessage* archive,
|
|
|
|
bool deep = true) const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void DrawItem(BView* owner, BRect frame,
|
|
|
|
bool complete = false);
|
|
|
|
virtual void SetText(const char* text);
|
|
|
|
const char* Text() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void Update(BView* owner, const BFont* font);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual status_t Perform(perform_code code, void* arg);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-06-17 20:26:17 +04:00
|
|
|
private:
|
2009-08-27 15:12:41 +04:00
|
|
|
// FBC padding and forbidden methods
|
|
|
|
virtual void _ReservedStringItem1();
|
|
|
|
virtual void _ReservedStringItem2();
|
2002-10-29 21:41:51 +03:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
BStringItem(const BStringItem& item);
|
|
|
|
BStringItem& operator=(const BStringItem& item);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
private:
|
|
|
|
char* fText;
|
|
|
|
float fBaselineOffset;
|
|
|
|
uint32 _reserved[2];
|
2002-10-28 04:38:57 +03:00
|
|
|
};
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-02-11 18:23:23 +03:00
|
|
|
#endif // _STRING_ITEM_H
|