Design Patterns
text_view.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef STRUCTURAL_ADAPTER_TEXT_VIEW_H_
7 #define STRUCTURAL_ADAPTER_TEXT_VIEW_H_
8 
9 #include <string>
10 
12 
13 namespace structural
14 {
15 namespace adapter
16 {
18 {
19  public:
20  TextView();
21  explicit TextView(const std::string& text);
22  virtual ~TextView() override;
23 
24  void Draw() override;
25  void Resize() override;
26 
27  void GetOrigin(float& x, float& y) const;
28  void SetOrigin(const float& x, const float& y);
29 
30  void GetExtent(float& width, float& height) const;
31  void SetExtent(const float& width, const float& height);
32 
33  virtual bool IsEmpty() const;
34  std::string content() const;
35  void content(const std::string& text);
36 
37  private:
38  std::string content_;
39  float x_;
40  float y_;
41  float width_;
42  float height_;
43 };
44 }
45 }
46 
47 #endif
48 
TextView()
Definition: text_view.cc:12
Definition: shape_interface.h:11
void GetExtent(float &width, float &height) const
Definition: text_view.cc:34
void SetExtent(const float &width, const float &height)
Definition: text_view.cc:40
Definition: text_view.h:17
void SetOrigin(const float &x, const float &y)
Definition: text_view.cc:28
virtual bool IsEmpty() const
Definition: text_view.cc:46
virtual ~TextView() override
Definition: text_view.cc:16
void GetOrigin(float &x, float &y) const
Definition: text_view.cc:22
void Resize() override
Definition: text_view.cc:20
Definition: visual_component_interface.h:13
std::string content() const
Definition: text_view.cc:51
void Draw() override
Definition: text_view.cc:18