Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicorePanel.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_PANEL__
8 #define __HDI_CORE_PANEL__
9 
10 #include "hdicoreRect.h"
11 #include "hdicoreWindow.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class Panel;
18  }
19 
20  namespace core
21  {
22  class Callback;
23  class Flyout;
24  class Widget;
25 
26  typedef AIPanelRef PlatformPanelPtr;
27 
31  class Panel : public Window
32  {
33  public:
39  static const int16_t noImageID = 0;
40 
44  static const double typicalWidth;
45 
56  Panel();
57 
65  Panel(const Panel& p_);
66 
82  Panel(
83  const std::string& name_,
84  const Size& size_,
85  const bool resizableW_,
86  const bool resizableH_,
87  const int16_t lightIconID_ = noImageID,
88  const int16_t darkIconID_ = noImageID
89  );
90 
96  virtual ~Panel();
97 
106  virtual Panel& operator=(const Panel& rhs_);
107 
121  virtual Panel* clone() const;
122 
133  virtual void destroy();
134 
146  virtual PlatformPanelPtr platformPanel() const;
147 
153  virtual void show();
154 
160  virtual void hide();
161 
169  virtual bool visible() const;
170 
180  virtual void setVisible(const bool visible_);
181 
189  virtual Rect frame() const;
190 
198  virtual void setFrame(const Rect& frame_);
199 
207  virtual void setSize(const Size& s_);
208 
216  virtual void setHeight(const double height_);
217 
226  virtual bool addWidget(const Widget& widget_);
227 
236  virtual bool removeWidget(const Widget& widget_);
237 
245  std::string title() const;
246 
254  void setTitle(const std::string& title_);
255 
266  virtual Flyout* const flyoutMenu() const;
267 
275  virtual void setFlyoutMenu(const Flyout& flyout_);
276 
284  virtual Callback* const showCallback() const;
285 
293  virtual void setShowCallback(const Callback& cb_);
294 
302  virtual Callback* const hideCallback() const;
303 
311  virtual void setHideCallback(const Callback& cb_);
312 
320  virtual Callback* const resizeCallback() const;
321 
329  virtual void setResizeCallback(const Callback& cb_);
330 
336  virtual void update() const;
337 
338 
339  private:
340  friend class Flyout;
341  friend plugin::Panel* __accessImpl(const Panel&);
342  friend Panel __accessCtor(plugin::Panel* const);
343 
349  void* __impl() const;
350 
356  Panel(plugin::Panel* const);
357  };
358 
359  typedef std::auto_ptr<Panel> PanelAP;
360 
361  extern plugin::Panel* __accessImpl(const Panel&);
362  extern Panel __accessCtor(plugin::Panel* const);
363  }
364 }
365 
366 #endif
367 // __HDI_CORE_PANEL__
virtual void show()
Shows the panel.
Base class for all interface widgets; handles many common needs, e.g. text, position, size, etc.
Definition: hdicoreWidget.h:39
virtual void setHideCallback(const Callback &cb_)
Sets/updates the callback for the panel hiding.
virtual PlatformPanelPtr platformPanel() const
Gets the platform-specific panel, around which the target object is wrapped.
virtual ~Panel()
Destructs a Panel object.
static const double typicalWidth
Most Illustrator panels are this width.
Definition: hdicorePanel.h:44
Header file for a class to create and manipulate Illustrator modal dialogs.
virtual Flyout *const flyoutMenu() const
Gets the current flyout menu for the panel, or NULL if none.
virtual void setVisible(const bool visible_)
Sets panel visibility.
virtual Callback *const hideCallback() const
Gets the registered callback for the panel hiding, or NULL if none.
Header file for describing rectangles.
Flyout menu, which can be added to a Panel for additional options.
Definition: hdicoreFlyout.h:30
virtual void hide()
Hides the panel.
virtual Panel & operator=(const Panel &rhs_)
Allows one Panel object to be assigned from another.
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:26
virtual Rect frame() const
Gets the panel's frame.
virtual bool removeWidget(const Widget &widget_)
Removes a widget (label, button, text field, etc.) from the panel.
virtual void setResizeCallback(const Callback &cb_)
Sets/updates the callback for the panel resize.
Base class for templated __Callback class.
Definition: hdicoreCallback.h:67
virtual Callback *const showCallback() const
Gets the registered callback for the panel showing, or NULL if none.
virtual void setFlyoutMenu(const Flyout &flyout_)
Sets/updates the flyout menu for the panel.
Panel()
Constructs an empty Panel object.
virtual bool addWidget(const Widget &widget_)
Adds a widget (label, button, text field, etc.) to the panel.
virtual void setSize(const Size &s_)
Sets the panel's dimensions.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
void setTitle(const std::string &title_)
Sets the current panel title.
Definition: hdicoreaiArray.h:12
virtual void update() const
Forces the widgets in the panel to update/redraw (including the flyout, if any)
Used as a base class for modal dialogs, panels, and control bars.
Definition: hdicoreWindow.h:25
virtual Panel * clone() const
Convenience method to clone a Panel object on the heap.
virtual Callback *const resizeCallback() const
Gets the callback set for the panel resize, or NULL if none.
std::string title() const
Gets the current panel title.
static const int16_t noImageID
Default panel image ID to indicate that it has no images.
Definition: hdicorePanel.h:39
virtual void destroy()
Destroys the UI panel, converting the target object to an empty Panel object (see the default constru...
Used to add a panel to Illustrator's UI and contain various UI widgets.
Definition: hdicorePanel.h:31
virtual bool visible() const
Gets whether the panel is visible.
virtual void setHeight(const double height_)
Sets the panel's height (keeping the location and width the same)
virtual void setShowCallback(const Callback &cb_)
Sets/updates the callback for the panel showing.
virtual void setFrame(const Rect &frame_)
Sets the panel's frame (location and size)