17c74b12bSAxel Dörfler /* 289208c77SStephan Aßmus * Copyright 2006-2009, Haiku, Inc. All rights reserved. 37c74b12bSAxel Dörfler * Distributed under the terms of the MIT License. 47c74b12bSAxel Dörfler */ 552a38012Sejakowatz #ifndef _STRING_ITEM_H 652a38012Sejakowatz #define _STRING_ITEM_H 752a38012Sejakowatz 87c74b12bSAxel Dörfler 952a38012Sejakowatz #include <ListItem.h> 1052a38012Sejakowatz 1152a38012Sejakowatz 127c74b12bSAxel Dörfler class BStringItem : public BListItem { 1352a38012Sejakowatz public: 14f3b1ada5SAxel Dörfler BStringItem(const char* text, 1589208c77SStephan Aßmus uint32 outlineLevel = 0, 1689208c77SStephan Aßmus bool expanded = true); 177c74b12bSAxel Dörfler BStringItem(BMessage* archive); 18d7e489f8Sbeveloper virtual ~BStringItem(); 1952a38012Sejakowatz 207c74b12bSAxel Dörfler static BArchivable* Instantiate(BMessage* archive); 2189208c77SStephan Aßmus virtual status_t Archive(BMessage* archive, 2289208c77SStephan Aßmus bool deep = true) const; 2352a38012Sejakowatz 24f3b1ada5SAxel Dörfler virtual void DrawItem(BView* owner, BRect frame, 25f3b1ada5SAxel Dörfler bool complete = false); 2652a38012Sejakowatz virtual void SetText(const char* text); 2752a38012Sejakowatz const char* Text() const; 28a6918280SAxel Dörfler 2952a38012Sejakowatz virtual void Update(BView* owner, const BFont* font); 3052a38012Sejakowatz 31a6918280SAxel Dörfler virtual status_t Perform(perform_code code, void* arg); 3252a38012Sejakowatz 33*7ba0381dSOliver Tappe protected: 34*7ba0381dSOliver Tappe float BaselineOffset() const; 35*7ba0381dSOliver Tappe 3652a38012Sejakowatz private: 3789208c77SStephan Aßmus // FBC padding and forbidden methods 38d3ed67d7SAxel Dörfler virtual void _ReservedStringItem1(); 39d3ed67d7SAxel Dörfler virtual void _ReservedStringItem2(); 40d3ed67d7SAxel Dörfler 417c74b12bSAxel Dörfler BStringItem(const BStringItem& item); 427c74b12bSAxel Dörfler BStringItem& operator=(const BStringItem& item); 4352a38012Sejakowatz 4489208c77SStephan Aßmus private: 4552a38012Sejakowatz char* fText; 4652a38012Sejakowatz float fBaselineOffset; 47d3ed67d7SAxel Dörfler uint32 _reserved[2]; 4852a38012Sejakowatz }; 4952a38012Sejakowatz 507c74b12bSAxel Dörfler #endif // _STRING_ITEM_H 51