Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / StringView.h
blobd75dfc2987f5d634150b80e722347999c8413b9e
1 /*
2 * Copyright 2001-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _STRING_VIEW_H
6 #define _STRING_VIEW_H
9 #include <View.h>
12 class BStringView : public BView {
13 public:
14 BStringView(BRect frame, const char* name,
15 const char* text, uint32 resizingMode
16 = B_FOLLOW_LEFT_TOP,
17 uint32 flags = B_WILL_DRAW);
18 BStringView(const char* name, const char* text,
19 uint32 flags = B_WILL_DRAW);
20 BStringView(BMessage* archive);
21 virtual ~BStringView();
23 static BArchivable* Instantiate(BMessage* archive);
24 virtual status_t Archive(BMessage* archive,
25 bool deep = true) const;
27 void SetText(const char* text);
28 const char* Text() const;
29 void SetAlignment(alignment flag);
30 alignment Alignment() const;
31 void SetTruncation(uint32 truncationMode);
32 uint32 Truncation() const;
34 virtual void AttachedToWindow();
35 virtual void DetachedFromWindow();
36 virtual void AllAttached();
37 virtual void AllDetached();
39 virtual void MakeFocus(bool focus = true);
41 virtual void GetPreferredSize(float* _width,
42 float* _height);
43 virtual BSize MinSize();
44 virtual BSize MaxSize();
45 virtual BSize PreferredSize();
46 virtual void ResizeToPreferred();
47 virtual BAlignment LayoutAlignment();
48 virtual void FrameMoved(BPoint newPosition);
49 virtual void FrameResized(float newWidth, float newHeight);
51 virtual void Draw(BRect bounds);
53 virtual void MessageReceived(BMessage* message);
54 virtual void MouseDown(BPoint point);
55 virtual void MouseUp(BPoint point);
56 virtual void MouseMoved(BPoint point, uint32 transit,
57 const BMessage* dragMessage);
59 virtual BHandler* ResolveSpecifier(BMessage* message,
60 int32 index, BMessage* specifier,
61 int32 form, const char* property);
62 virtual status_t GetSupportedSuites(BMessage* data);
64 virtual void SetFont(const BFont* font,
65 uint32 mask = B_FONT_ALL);
67 protected:
68 virtual void LayoutInvalidated(bool descendants = false);
70 private:
71 // FBC padding and forbidden methods
72 virtual status_t Perform(perform_code code, void* data);
74 virtual void _ReservedStringView1();
75 virtual void _ReservedStringView2();
76 virtual void _ReservedStringView3();
78 BStringView& operator=(const BStringView& other);
80 private:
81 BSize _ValidatePreferredSize();
83 private:
84 char* fText;
85 uint32 fTruncation;
86 alignment fAlign;
87 BSize fPreferredSize;
91 #endif // _STRING_VIEW_H