xref: /haiku/headers/os/interface/StringItem.h (revision 9fe35223cf4eb9714865152d62e8efc36b327fef)
1 /*
2  * Copyright 2006-2009, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _STRING_ITEM_H
6 #define _STRING_ITEM_H
7 
8 
9 #include <ListItem.h>
10 
11 
12 class BStringItem : public BListItem {
13 public:
14 								BStringItem(const char* text,
15 									uint32 outlineLevel = 0,
16 									bool expanded = true);
17 								BStringItem(BMessage* archive);
18 	virtual						~BStringItem();
19 
20 	static	BArchivable*		Instantiate(BMessage* archive);
21 	virtual	status_t			Archive(BMessage* archive,
22 									bool deep = true) const;
23 
24 	virtual	void				DrawItem(BView* owner, BRect frame,
25 									bool complete = false);
26 	virtual	void				SetText(const char* text);
27 			const char*			Text() const;
28 
29 	virtual	void				Update(BView* owner, const BFont* font);
30 
31 	virtual	status_t			Perform(perform_code code, void* arg);
32 
33 private:
34 	// FBC padding and forbidden methods
35 	virtual	void				_ReservedStringItem1();
36 	virtual	void				_ReservedStringItem2();
37 
38 								BStringItem(const BStringItem& item);
39 			BStringItem&		operator=(const BStringItem& item);
40 
41 private:
42 			char*				fText;
43 			float				fBaselineOffset;
44 			uint32				_reserved[2];
45 };
46 
47 #endif	// _STRING_ITEM_H
48