Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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 
12 namespace 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 
31  enum Alignment
32  {
33  UnknownAlignment = 0,
34  LeftAlignment = 10,
35  CenterAlignment = 20,
36  RightAlignment = 30
37  };
38 
50  TextView();
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::auto_ptr<Label> label() const;
187 
197  virtual void setLabel(Label& label_);
198 
204  virtual void removeLabel();
205 
218  virtual bool selectionRange(uint32_t& pos__, uint32_t& len__) const;
219 
231  virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_);
232 
243  virtual std::string lastCharTyped() const;
244 
250  virtual void valueChanging();
251 
259  virtual Callback* const valueChangingCallback() const;
260 
268  virtual void setValueChangingCallback(const Callback& callback_);
269 
275  virtual void valueChanged();
276 
284  virtual Callback* const valueChangedCallback() const;
285 
293  virtual void setValueChangedCallback(const Callback& callback_);
294  };
295 
296  typedef std::auto_ptr<TextView> TextViewAP;
297  }
298 }
299 
300 #endif
301 // __HDI_CORE_TEXTFIELD__
virtual void removeLabel()
Removes the label that, when clicked, would have focused the target text view.
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
Label widget, for simply displaying text or images inside a window.
Definition: hdicoreLabel.h:24
virtual void valueChanged()
Simulates the text view having its value changed.
virtual bool selectionRange(uint32_t &pos__, uint32_t &len__) const
Gets the selection range of the text in the view, if any.
virtual void setBold(const bool bold_)
Sets the font weight.
Alignment
Text alignment options.
Definition: hdicoreTextView.h:31
virtual Callback *const valueChangedCallback() const
Gets the value changed callback for the text view.
virtual TextView & operator=(const TextView &rhs_)
Allows one TextView object to be assigned from another.
virtual void setValueChangedCallback(const Callback &callback_)
Sets the value changed callback.
virtual Callback *const valueChangingCallback() const
Gets the value changing callback for the text view.
virtual bool italic() const
Gets whether the text is italicized.
virtual bool editable() const
Gets whether the text view is read-only.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual bool bold() const
Gets whether the text is bold.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual void setLabel(Label &label_)
Sets the label that, when clicked, will focus the target text view.
virtual void setSelectionRange(const uint32_t pos_, const uint32_t len_)
Sets the selection range of the text in the view (and focuses it)
Text view widget, which allows the user to enter a large amount of arbitrary text (also useful for di...
Definition: hdicoreTextView.h:23
virtual ~TextView()
TextView destructor.
Definition: hdicoreaiArray.h:12
virtual TextView * clone() const
Convenience method to clone a TextView object on the heap.
virtual std::auto_ptr< Label > label() const
If the target text view has been associated with a label, this gets said label.
Header file for Illustrator user interface widgets.
TextView()
Constructs an empty TextView object.
virtual void valueChanging()
Simulates the value of the text view changing.
virtual std::string lastCharTyped() const
Gets the last character typed into the view.
virtual TextView * duplicate() const
Convenience method to duplicate a TextView object, creating a new and identical UI element to the tar...
virtual void setItalic(const bool italic_)
Sets the font style.
virtual void setValueChangingCallback(const Callback &callback_)
Sets the value changing callback.
virtual void setAlignment(const Alignment alignment_)
Sets the current alignment of the text view.
virtual Alignment alignment() const
Gets the current alignment of the text view.