repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haikudepot / textview / TextView.h
blob890ab28809ac7b80c5c4306257c144f854a175e0
1 /*
2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef TEXT_VIEW_H
6 #define TEXT_VIEW_H
8 #include <String.h>
9 #include <View.h>
11 #include "Paragraph.h"
12 #include "ParagraphLayout.h"
15 class TextView : public BView {
16 public:
17 TextView(const char* name = NULL);
18 virtual ~TextView();
20 virtual void Draw(BRect updateRect);
22 virtual void AttachedToWindow();
23 virtual void FrameResized(float width, float height);
25 virtual BSize MinSize();
26 virtual BSize MaxSize();
27 virtual BSize PreferredSize();
29 virtual bool HasHeightForWidth();
30 virtual void GetHeightForWidth(float width, float* min,
31 float* max, float* preferred);
33 void SetText(const BString& text);
34 void SetParagraphStyle(const ::ParagraphStyle& style);
35 const ::ParagraphStyle& ParagraphStyle() const
36 { return fText.Style(); }
38 private:
39 Paragraph fText;
40 ParagraphLayout fTextLayout;
43 #endif // TEXT_VIEW_H