Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreTextView.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_TEXTVIEW__
8#define __HDI_CORE_TEXTVIEW__
9
10#include "hdicoreWidget.h"
11
12namespace hdi
13{
14 namespace core
15 {
16 class Callback;
17 class Label;
18
23 class TextView : public Widget
24 {
25 public:
26 friend class Label;
27
32 {
33 UnknownAlignment = 0,
34 LeftAlignment = 10,
35 CenterAlignment = 20,
36 RightAlignment = 30
37 };
38
51
59 TextView(const TextView& view_);
60
70 TextView(const Rect& frame_, const std::string& text_, const bool edit_ = true);
71
77 virtual ~TextView();
78
87 virtual TextView& operator=(const TextView& rhs_);
88
102 virtual TextView* clone() const;
103
114 virtual TextView* duplicate() const;
115
123 virtual bool editable() const;
124
132 virtual Alignment alignment() const;
133
141 virtual void setAlignment(const Alignment alignment_);
142
150 virtual bool bold() const;
151
159 virtual void setBold(const bool bold_);
160
168 virtual bool italic() const;
169
177 virtual void setItalic(const bool italic_);
178
186 virtual std::unique_ptr<Label> label() const;
187
197 virtual void setLabel(Label& label_);
198
204 virtual void removeLabel();
205
221 virtual bool selectionRange(uint32_t& pos__, uint32_t& len__) const;
222
237 virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_);
238
254 virtual bool selectionRangeUTF32(uint32_t& pos__, uint32_t& len__) const;
255
270 virtual void setSelectionRangeUTF32(const uint32_t pos_, const uint32_t len_);
271
282 virtual std::string lastCharTyped() const;
283
289 virtual void valueChanging();
290
298 virtual Callback* const valueChangingCallback() const;
299
307 virtual void setValueChangingCallback(const Callback& callback_);
308
314 virtual void valueChanged();
315
323 virtual Callback* const valueChangedCallback() const;
324
332 virtual void setValueChangedCallback(const Callback& callback_);
333 };
334
335 typedef std::unique_ptr<TextView> TextViewUP;
336 typedef std::shared_ptr<TextView> TextViewSP;
337 typedef std::weak_ptr<TextView> TextViewWP;
338 }
339}
340
341#endif
342// __HDI_CORE_TEXTFIELD__
Base class for templated __Callback class.
Definition: hdicoreCallback.h:68
Label widget, for simply displaying text or images inside a window.
Definition: hdicoreLabel.h:29
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Text view widget, which allows the user to enter a large amount of arbitrary text (also useful for di...
Definition: hdicoreTextView.h:24
virtual bool editable() const
Gets whether the text view is read-only.
TextView()
Constructs an empty TextView object.
virtual Alignment alignment() const
Gets the current alignment of the text view.
virtual TextView * clone() const
Convenience method to clone a TextView object on the heap.
virtual void setBold(const bool bold_)
Sets the font weight.
virtual void setAlignment(const Alignment alignment_)
Sets the current alignment of the text view.
virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the view, in UTF-8 (and focuses it)
virtual void setValueChangingCallback(const Callback &callback_)
Sets the value changing callback.
virtual void setSelectionRangeUTF32(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the view, in UTF-32 (and focuses it)
virtual void valueChanged()
Simulates the text view having its value changed.
virtual void setItalic(const bool italic_)
Sets the font style.
virtual std::unique_ptr< Label > label() const
If the target text view has been associated with a label, this gets said label.
virtual bool italic() const
Gets whether the text is italicized.
virtual TextView & operator=(const TextView &rhs_)
Allows one TextView object to be assigned from another.
virtual bool selectionRange(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the view, if any, in UTF-8.
virtual void removeLabel()
Removes the label that, when clicked, would have focused the target text view.
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the text view.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual bool selectionRangeUTF32(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the view, if any, in UTF-32.
virtual std::string lastCharTyped() const
Gets the last character typed into the view.
virtual bool bold() const
Gets whether the text is bold.
virtual void setLabel(Label &label_)
Sets the label that, when clicked, will focus the target text view.
Alignment
Text alignment options.
Definition: hdicoreTextView.h:32
virtual void valueChanging()
Simulates the value of the text view changing.
virtual ~TextView()
TextView destructor.
virtual Callback *const valueChangingCallback() const
Gets the value changing callback for the text view.
TextView(const TextView &view_)
Constructs a new TextView object from an existing TextView object (copy constructor)
virtual TextView * duplicate() const
Convenience method to duplicate a TextView object, creating a new and identical UI element to the tar...
TextView(const Rect &frame_, const std::string &text_, const bool edit_=true)
Constructs a text view, which can be editable or read-only.
Base class for all interface widgets; handles many common needs, e.g. text, position,...
Definition: hdicoreWidget.h:30
Header file for plugin user interface widgets.