Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreLabel.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_LABEL__
8 #define __HDI_CORE_LABEL__
9 
10 #include "hdicoreWidget.h"
11 
12 namespace hdi
13 {
14  namespace core
15  {
16  class Callback;
17  class Panel;
18  class TextField;
19  class TextView;
20 
24  class Label : public Widget
25  {
26  public:
27  friend class TextField;
28  friend class TextView;
29 
33  enum Alignment
34  {
35  UnknownAlignment = 0,
36  LeftAlignment = 10,
37  CenterAlignment = 20,
38  RightAlignment = 30
39  };
40 
51  Label();
52 
60  Label(const Label& label_);
61 
76  Label(const Point& loc_, const std::string& title_, const WindowType containerType_);
77 
87  Label(const Point& loc_, const std::string& title_, const double width_);
88 
97  Label(const Rect& frame_, const ImageIDs& imageIDs_);
98 
104  virtual ~Label();
105 
114  virtual Label& operator=(const Label& rhs_);
115 
129  virtual Label* clone() const;
130 
141  virtual Label* duplicate() const;
142 
152  virtual std::string text() const;
153 
163  virtual void setText(const std::string& text_);
164 
172  virtual Alignment alignment() const;
173 
181  virtual void setAlignment(const Alignment alignment_);
182 
190  virtual bool bold() const;
191 
201  virtual void setBold(const bool bold_);
202 
210  virtual bool italic() const;
211 
221  virtual void setItalic(const bool italic_);
222 
230  virtual std::auto_ptr<TextField> textField() const;
231 
241  virtual void setTextField(TextField& field_);
242 
248  virtual void removeTextField();
249 
257  virtual std::auto_ptr<TextView> textView() const;
258 
268  virtual void setTextView(TextView& view_);
269 
275  virtual void removeTextView();
276 
284  virtual std::auto_ptr<Panel> linkedPanel() const;
285 
295  virtual void setLinkedPanel(const Panel& p_);
296 
302  virtual void removeLinkedPanel();
303 
309  virtual void click();
310 
318  virtual Callback* const clickCallback() const;
319 
327  virtual void setClickCallback(const Callback& callback_);
328 
334  virtual void doubleClick();
335 
343  virtual Callback* const doubleClickCallback() const;
344 
352  virtual void setDoubleClickCallback(const Callback& callback_);
353 
361  virtual ImageIDs imageIDs() const;
362 
370  virtual void setImageIDs(const ImageIDs& ids_);
371 
379  virtual bool backgroundRollover() const;
380 
388  virtual void setBackgroundRollover(const bool ro_);
389 
400  static double idealHeight(const std::string& text_, const double width_, const WindowType containerType_);
401 
412  static double idealWidth(const std::string& text_, const double height_, const WindowType containerType_);
413  };
414 
415  typedef std::auto_ptr<Label> LabelAP;
416  }
417 }
418 
419 #endif
420 // __HDI_CORE_LABEL__
Text field widget, which allows the user to enter arbitrary text values.
Definition: hdicoreTextField.h:22
virtual void setBold(const bool bold_)
Sets the font weight.
virtual void setBackgroundRollover(const bool ro_)
Sets whether the background of the label should change in appearance upon mouse-over.
virtual std::string text() const
Gets the current text value of the label.
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 Alignment alignment() const
Gets the current alignment of the label.
virtual bool backgroundRollover() const
Gets whether the background of the label should change in appearance upon mouse-over.
virtual bool italic() const
Gets whether the text is italicized.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
virtual std::auto_ptr< Panel > linkedPanel() const
Gets the panel that the target label has been associated with.
virtual std::auto_ptr< TextView > textView() const
Gets the text view that the target label has been associated with.
Label()
Constructs an empty Label object.
virtual Label & operator=(const Label &rhs_)
Allows one Label object to be assigned from another.
Alignment
Text alignment options.
Definition: hdicoreLabel.h:33
virtual void removeTextView()
Removes the text view that should be focused when the label is clicked.
virtual void removeLinkedPanel()
Removes the panel that should be shown when the label is clicked.
virtual void setItalic(const bool italic_)
Sets the font style.
virtual void setClickCallback(const Callback &callback_)
Sets the click callback for the label.
virtual Label * duplicate() const
Convenience method to duplicate a Label object, creating a new and identical UI element to the target...
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual Callback *const clickCallback() const
Gets the current click callback for the label.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
static double idealWidth(const std::string &text_, const double height_, const WindowType containerType_)
Gets the ideal width for a label, given its value and a known height.
virtual void doubleClick()
Simulates a double-click on the label.
virtual bool bold() const
Gets whether the text is bold.
Text view widget, which allows the user to enter a large amount of arbitrary text (also useful for di...
Definition: hdicoreTextView.h:23
virtual void click()
Simulates a click on the label.
virtual std::auto_ptr< TextField > textField() const
Gets the text field that the target label has been associated with.
virtual void setAlignment(const Alignment alignment_)
Sets the current alignment of the label.
virtual void setTextView(TextView &view_)
Sets the text view that should be focused when the label is clicked.
Definition: hdicoreaiArray.h:12
Header file for Illustrator user interface widgets.
virtual void setLinkedPanel(const Panel &p_)
Sets the panel that should be shown when the label is clicked.
virtual void removeTextField()
Removes the text field that should be focused when the label is clicked.
virtual void setText(const std::string &text_)
Sets the current text value of the label.
static double idealHeight(const std::string &text_, const double width_, const WindowType containerType_)
Gets the ideal height for a label, given its value and a known width.
virtual ImageIDs imageIDs() const
Gets the PNGI resource IDs of the widget.
virtual Label * clone() const
Convenience method to clone a Label object on the heap.
virtual void setTextField(TextField &field_)
Sets the text field that should be focused when the label is clicked.
virtual ~Label()
Label destructor.
Used to add a panel to Illustrator's UI and contain various UI widgets.
Definition: hdicorePanel.h:31
virtual void setDoubleClickCallback(const Callback &callback_)
Sets the double-click callback for the label.
virtual Callback *const doubleClickCallback() const
Gets the current double-click callback for the label.
virtual void setImageIDs(const ImageIDs &ids_)
Sets the PNGI resource IDs of the widget.