Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreWidget.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_WIDGET__
8 #define __HDI_CORE_WIDGET__
9 
10 #include "hdicoreImageIDs.h"
11 #include "hdicoreRect.h"
12 
13 #if defined(MAC_ENV)
14  @class NSView;
15 #elif defined(WIN_ENV)
16  class CWnd;
17 #endif
18 
19 namespace hdi
20 {
21  namespace plugin
22  {
23  class Widget;
24  }
25 
26  namespace core
27  {
28  class Window;
29 
30  #if defined(MAC_ENV)
31  typedef NSView* PlatformWidgetPtr;
32  #elif defined(WIN_ENV)
33  typedef CWnd* PlatformWidgetPtr;
34  #endif
35 
39  class Widget
40  {
41  public:
45  enum Type
46  {
47  UnknownType = 0,
48  BoxType = 10, // Box class
49  ButtonType = 20, // Button class
50  CheckboxType = 30, // Checkbox class
51  ColumnViewType = 40, // ColumnView class
52  ComboBoxType = 50, // ComboBox class
53  ColorWellType = 60, // ColorWell class
54  CustomType = 70, // CustomWidget class
55  DividerType = 80, // Divider class
56  HierarchicalColumnViewType = 85, // HierarchicalColumnView class
57  HierarchicalViewType = 90, // HierarchicalView class
58  LabelType = 100, // Label class
59  ListViewType = 110, // ListView class
60  PopupMenuType = 120, // PopupMenu class
61  RadioButtonType = 130, // RadioButton class
62  SliderType = 140, // Slider class
63  StepperType = 150, // Stepper class
64  TextFieldType = 160, // TextField class
65  TextViewType = 170, // TextView class
66  WebViewType = 180 // WebView class
67  };
68 
74  virtual ~Widget();
75 
85  static bool isCoreWidget(const PlatformWidgetPtr widget_);
86 
97  virtual Widget* clone() const = 0;
98 
109  virtual Widget* duplicate() const = 0;
110 
122  virtual PlatformWidgetPtr platformWidget() const;
123 
131  virtual bool isEmpty() const;
132 
141  virtual bool operator==(const Widget& rhs_) const;
142 
151  virtual bool operator!=(const Widget& rhs_) const;
152 
160  virtual Type type() const;
161 
169  virtual Window* const window() const;
170 
179  virtual Rect frame() const;
180 
188  virtual void setFrame(const Rect& frame_);
189 
198  virtual void offset(const double x_, const double y_);
199 
207  virtual std::string text() const;
208 
219  virtual void setText(const std::string& text_);
220 
228  virtual bool enabled();
229 
237  virtual void setEnabled(const bool enable_);
238 
246  virtual bool visible();
247 
255  virtual void setVisible(const bool visible_);
256 
264  virtual void setOrigin(const Point& p_);
265 
273  virtual void setSize(const Size& s_);
274 
282  virtual void setWidth(const double w_);
283 
291  virtual void setHeight(const double h_);
292 
300  virtual bool hasFocus() const;
301 
307  virtual void focus() const;
308 
314  virtual void blur() const;
315 
323  virtual std::string tooltip() const;
324 
332  virtual void setTooltip(const std::string& tip_);
333 
339  virtual void update();
340 
348  static std::auto_ptr<Widget> lastClickedWidget();
349 
358  static std::auto_ptr<Widget> lastValueChangingWidget();
359 
368  static std::auto_ptr<Widget> lastValueChangedWidget();
369 
370  #if defined(WIN_ENV)
371 
388  static bool forceIdeographicFontSize(bool& larger__);
389 
409  static void setForceIdeographicFontSize(const bool force_, const bool larger_);
410  #endif
411 
412 
413  protected:
414  friend class ModalDialog;
415  friend class Window;
416  friend plugin::Widget* __accessImpl(const Widget&);
417 
421  void* _data;
422 
428  void* _impl() const;
429 
440  Widget();
441 
452  Widget(const Widget& w_);
453 
459  Widget(plugin::Widget*&);
460 
466  virtual Widget& operator=(const Widget&);
467  };
468 
469  typedef std::auto_ptr<Widget> WidgetAP;
470 
471  extern plugin::Widget* __accessImpl(const Widget&);
472  }
473 }
474 
475 #endif
476 // __HDI_CORE_WIDGET__
void * _data
Private implementation data.
Definition: hdicoreWidget.h:421
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
Header file for describing rectangles.
Used to create and display a modal dialog to the user, blocking input to other UI elements...
Definition: hdicoreModalDialog.h:30
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
Definition: hdicoreaiArray.h:12
bool text(const std::string &text_, const Point &pt_, const bool hasCJK_=false)
Draws text with the current font and left justification.
Used as a base class for modal dialogs, panels, and control bars.
Definition: hdicoreWindow.h:25
Header file for handling image IDs and their higher resolution variants.
Type
Supported widget types.
Definition: hdicoreWidget.h:45