Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hdi::core::Window Class Referenceabstract

Used as a base class for modal dialogs, panels, and control bars. More...

#include <hdicoreWindow.h>

Inheritance diagram for hdi::core::Window:
Inheritance graph
[legend]

Public Types

typedef std::vector< Widget *> WidgetVector
 

Public Member Functions

virtual ~Window ()
 Destructs a Window object. More...
 
virtual Windowclone () const =0
 Convenience method to clone a Window object, taking its subclass type into account for proper memory management. More...
 
virtual bool isEmpty () const
 Gets whether the target Window object is empty (constructed with the default ctor) More...
 
virtual WindowType windowType ()
 Gets the type of window. More...
 
virtual bool operator== (const Window &rhs_) const
 Tests whether a given Window object is the same as another. More...
 
virtual bool operator!= (const Window &rhs_) const
 Tests whether a given Window object is not the same as another. More...
 
virtual bool visible () const =0
 Gets whether the window is visible. More...
 
virtual void show ()=0
 Shows the window. More...
 
virtual const WidgetVector widgets () const
 Gets a list of all widgets contained by the target window. More...
 
virtual bool addWidget (const Widget &widget_)
 Adds a widget (label, button, text field, etc.) to the window. More...
 
virtual bool removeWidget (const Widget &widget_)
 Removes a widget (label, button, text field, etc.) from the window. More...
 
virtual bool addWidgetGroup (const WidgetGroup &wg_)
 Adds a widget group to the window. More...
 
virtual bool removeWidgetGroup (const WidgetGroup &wg_)
 Removes a widget group from the window. More...
 
virtual TabOrder *const tabOrder () const
 Gets the tab order object for the window. More...
 
virtual void update () const =0
 Forces the widgets in the modal dialog to update/redraw. More...
 
virtual double scalingFactor () const
 Gets the factor by which the UI is scaled for the given window (i.e. for HiDPI support) More...
 

Protected Member Functions

 Window ()
 Constructs an empty Window object. More...
 
 Window (const Window &w_)
 Constructs a new Window object from an existing Window object (copy constructor) More...
 
 Window (const WindowType type_)
 Constructs a Window object. More...
 
virtual Windowoperator= (const Window &)
 Internal use only. More...
 

Protected Attributes

void * _data
 Private implementation data.
 

Detailed Description

Used as a base class for modal dialogs, panels, and control bars.

Constructor & Destructor Documentation

◆ ~Window()

virtual hdi::core::Window::~Window ( )
virtual

Destructs a Window object.

Author
GW
Date
09/2013

◆ Window() [1/3]

hdi::core::Window::Window ( )
protected

Constructs an empty Window object.

Author
GW
Date
10/2013
Note
To test if a Window object is empty, call isEmpty() on it
Empty Window objects do not relate to any actual UI window; they are designed to be "receivers" of some other Window object via the overloaded assignment operator. Empty Window objects are useless until such time (though it is safe to call any of their methods).

◆ Window() [2/3]

hdi::core::Window::Window ( const Window w_)
protected

Constructs a new Window object from an existing Window object (copy constructor)

Author
GW
Date
10/2013
Parameters
w_Existing Window object
Note
This constructor should not be called directly; subclasses should "overload" it and call another ctor.

◆ Window() [3/3]

hdi::core::Window::Window ( const WindowType  type_)
protected

Constructs a Window object.

Author
GW
Date
09/2013
Parameters
type_Type of window that is being constructed (indicative of the Window subclass)

Member Function Documentation

◆ addWidget()

virtual bool hdi::core::Window::addWidget ( const Widget widget_)
virtual

Adds a widget (label, button, text field, etc.) to the window.

Author
GW
Date
09/2013
Parameters
widget_Widget to place in the window
Returns
true if the widget could be added, false otherwise

Reimplemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::ControlBar, and hdi::core::FloatingDialog.

◆ addWidgetGroup()

virtual bool hdi::core::Window::addWidgetGroup ( const WidgetGroup wg_)
virtual

Adds a widget group to the window.

Author
GW
Date
02/2015
Parameters
wg_Widget group to place in the window
Returns
true if the widgets could be added, false otherwise

◆ clone()

virtual Window* hdi::core::Window::clone ( ) const
pure virtual

Convenience method to clone a Window object, taking its subclass type into account for proper memory management.

Author
GW
Date
10/2013
Returns
A pointer to the new Window object
Warning
The caller must manage the memory for the returned Window object.

Implemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::ControlBar, and hdi::core::FloatingDialog.

◆ isEmpty()

virtual bool hdi::core::Window::isEmpty ( ) const
virtual

Gets whether the target Window object is empty (constructed with the default ctor)

Author
GW
Date
09/2013
Returns
true if the target Window object is empty, false otherwise

◆ operator!=()

virtual bool hdi::core::Window::operator!= ( const Window rhs_) const
virtual

Tests whether a given Window object is not the same as another.

Author
GW
Date
09/2013
Parameters
rhs_Window to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different UI windows, false otherwise

◆ operator=()

virtual Window& hdi::core::Window::operator= ( const Window )
protectedvirtual

Internal use only.

Author
GW
Date
12/2014

◆ operator==()

virtual bool hdi::core::Window::operator== ( const Window rhs_) const
virtual

Tests whether a given Window object is the same as another.

Author
GW
Date
09/2013
Parameters
rhs_Window to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same UI window, false otherwise

◆ removeWidget()

virtual bool hdi::core::Window::removeWidget ( const Widget widget_)
virtual

Removes a widget (label, button, text field, etc.) from the window.

Author
GW
Date
09/2013
Parameters
widget_Widget to remove from the window
Returns
true if the widget was removed, false otherwise

Reimplemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::ControlBar, and hdi::core::FloatingDialog.

◆ removeWidgetGroup()

virtual bool hdi::core::Window::removeWidgetGroup ( const WidgetGroup wg_)
virtual

Removes a widget group from the window.

Author
GW
Date
02/2015
Parameters
wg_Widget group to remove from the window
Returns
true if the widgets were removed, false otherwise

◆ scalingFactor()

virtual double hdi::core::Window::scalingFactor ( ) const
virtual

Gets the factor by which the UI is scaled for the given window (i.e. for HiDPI support)

Author
GW
Date
02/2017
Returns
The scaling factor for the target window; 1.0 means e.g. @1x image variants should be used, 2.0 means @2x image variants should be used, etc.
Note
On Illustrator 16 this will always return 1.0.
On Windows, it is possible to have a variety of non-round scaling factors (e.g. 1.25 or 1.5). However, all scaling factors in Illustrator 17-20 are completely ignored, as Adobe always draws the app UI at 100% (Illustrator 21 optionally respects scaling factors). As such, it might be worthwhile to call hdi::core::Illustrator::uiScalesDownOrUpFor125() to determine how to handle 1.25.

◆ show()

virtual void hdi::core::Window::show ( )
pure virtual

Shows the window.

Author
GW
Date
09/2013

Implemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::FloatingDialog, and hdi::core::ControlBar.

◆ tabOrder()

virtual TabOrder* const hdi::core::Window::tabOrder ( ) const
virtual

Gets the tab order object for the window.

Author
GW
Date
10/2013
Returns
A pointer to the TabOrder object for the target window (all Window objects have one)

◆ update()

virtual void hdi::core::Window::update ( ) const
pure virtual

Forces the widgets in the modal dialog to update/redraw.

Author
GW
Date
09/2013

Implemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::ControlBar, and hdi::core::FloatingDialog.

◆ visible()

virtual bool hdi::core::Window::visible ( ) const
pure virtual

Gets whether the window is visible.

Author
GW
Date
09/2013
Returns
true if the window is visible, false otherwise

Implemented in hdi::core::ModalDialog, hdi::core::Panel, hdi::core::ControlBar, and hdi::core::FloatingDialog.

◆ widgets()

virtual const WidgetVector hdi::core::Window::widgets ( ) const
virtual

Gets a list of all widgets contained by the target window.

Author
GW
Date
09/2013
Returns
A list of all widgets contained by the window

◆ windowType()

virtual WindowType hdi::core::Window::windowType ( )
virtual

Gets the type of window.

Author
GW
Date
09/2013
Returns
The type of the window
Note
This is useful for knowing how to cast a Window object to its proper subclass