InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IControlView Class Referenceabstract

#include <IControlView.h>

Inheritance diagram for IControlView:
IPMUnknownAbstractControlViewDVHostedWidgetViewDVAbstractControlViewDVBasePanelViewDVControlViewDVDropDownElementViewAGMDrawnPanelViewDVPanelViewCusDtLnkUICustomViewDVGIFPlayerViewHiDPIWidgetControlViewPnlTrvCustomViewTableCellViewDVErasablePanelViewDVPanelViewCustomColorCIDErasablePanelViewDVPalettePanelViewDCLSizPalettePanelViewSnipRunControlViewPalettePanelViewCelPnlPanelViewCusCondTxtPanelView

Public Types

enum  { kDefaultIID = IID_ICONTROLVIEW }
 

Public Member Functions

Initialization
virtual void Init (const WidgetID &widgetId=kDefaultWidgetId, const PMRect &fFrame=kZeroRect, RsrcID rsrcID=0)=0
 
virtual void DoPostCreate ()=0
 
Attributes
virtual RsrcID GetRsrcID () const =0
 
virtual void SetRsrcID (const RsrcID &id)=0
 
virtual PluginID GetRsrcPluginID () const =0
 
virtual void SetRsrcPluginID (const PluginID &id)=0
 
virtual WidgetID GetWidgetID () const =0
 
virtual void SetWidgetID (const WidgetID &id)=0
 
virtual void SetClipToSelfEnabled (bool16 clipChildren) const =0
 
Geometry
virtual void SetFrame (const PMRect &newFrame, bool16 invalidate=kTrue)=0
 
virtual const PMRectGetFrame () const =0
 
virtual const PMRect GetLocalFrame () const =0
 
virtual void Resize (const PMPoint &newDimensions, bool16 invalidate=kTrue)=0
 
virtual void MoveTo (const PMPoint &where, bool16 invalidate=kTrue)=0
 
virtual void SetFrameBinding (const FrameBinding &binding)=0
 
virtual FrameBinding GetFrameBinding () const =0
 
virtual void AdaptToParentsSize (const PMPoint &dimensions)=0
 
virtual void AdaptToChildsGeometry (const PMPoint &delta, const FrameBinding &childsBinding, bool16 invalidate=kFalse)=0
 
virtual PMPoint ConstrainDimensions (const PMPoint &dimensions) const =0
 
virtual SysRgn GetDrawRegion ()=0
 
virtual bool16 DrawRegionEncompassesChildRegions () const =0
 
virtual SysRect GetBBox () const =0
 
virtual PMMatrixGetContentToWindowTransform () const =0
 
virtual void ContentToWindowTransform (PMPoint *point) const =0
 
virtual void ContentToWindowTransform (PMRect *rect) const =0
 
virtual void ContentToWindowTransform (PMPolygon4 *poly) const =0
 
virtual void WindowToContentTransform (PMPoint *point) const =0
 
virtual void WindowToContentTransform (PMRect *rect) const =0
 
virtual void WindowToContentTransform (PMPolygon4 *poly) const =0
 
virtual PMMatrix GetContentToWindowMatrix () const =0
 
virtual PMMatrix GetWindowToContentMatrix () const =0
 
virtual PMRect GetContentBounds_ () const =0
 
virtual void InvalidateTransform ()=0
 
virtual void DeleteDrawRegion ()=0
 
virtual int32 HitTest (const SysPoint &where)=0
 
virtual PMRect GlobalToView (const PMRect &convertRect) const =0
 
virtual PMPoint GlobalToView (const PMPoint &convertPoint) const =0
 
virtual PMRect GlobalToWindow (const PMRect &convertRect) const =0
 
virtual PMPoint GlobalToWindow (const PMPoint &convertPoint) const =0
 
virtual PMRect ViewToGlobal (const PMRect &convertRect) const =0
 
virtual PMPoint ViewToGlobal (const PMPoint &convertPoint) const =0
 
virtual PMRect WindowToGlobal (const PMRect &convertRect) const =0
 
virtual PMPoint WindowToGlobal (const PMPoint &convertPoint) const =0
 
Rendering
virtual void Draw (IViewPort *viewPort, SysRgn updateRgn=nil)=0
 
virtual void Invalidate (PMRect *invalidRect=nil)=0
 
virtual void Validate (PMRect *invalidRect=nil)=0
 
virtual void ForceRedraw (SysRgn invalidRgn=nil, bool16 forceRedraw=kTrue)=0
 
virtual void Hilite (bool16 doHilite=kTrue)=0
 
virtual void Unhilite ()=0
 
virtual bool16 IsHilited () const =0
 
virtual bool16 IsRolledOver () const =0
 
Window attributes
virtual void WindowActivated ()=0
 
virtual void WindowDeactivated ()=0
 
virtual void WindowShown ()=0
 
virtual void WindowHidden ()=0
 
virtual void WindowChanged ()=0
 
virtual void WindowClosed ()=0
 
Notification
virtual void ParentPurged ()=0
 
Auto attaching-detaching
virtual void DoAutoAttach ()=0
 
virtual void DoAutoDetach ()=0
 
virtual void SetRsrcID (const RsrcID &id, const bool isDarkIcon)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Show-Enable attributes

void ShowView (bool16 doShow=kTrue)
 
void HideView ()
 
virtual bool16 GetVisibleState () const =0
 
virtual bool16 IsVisible (bool16 requireVisibleWindow=kFalse) const =0
 
virtual void ParentsVisibleStateChanged (bool16 visible)=0
 
virtual void Enable (bool16 doEnable=kTrue, bool16 invalidate=kTrue)=0
 
virtual void Disable (bool16 invalidate=kTrue)=0
 
virtual bool16 GetEnableState () const =0
 
virtual bool16 IsEnabled () const =0
 
virtual void ParentsEnableStateChanged (bool16 visible, bool16 invalidate=kTrue)=0
 

Detailed Description

Interface responsible for determining the visual appearance of widgets. Handles drawing in various states. Also involved in hit testing and Auto attaching/detaching observers.

Member Function Documentation

virtual void IControlView::AdaptToChildsGeometry (const PMPointdelta,
const FrameBinding & childsBinding,
bool16 invalidate = kFalse 
)
pure virtual

The widget should adapt it geometry based on one of its children geometry changing. Only called when child changes and if propagate is set.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::AdaptToParentsSize (const PMPointdimensions)
pure virtual

The widget should adapt its geometry based on the parent's geometry. Called on changes in parent's size.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual PMPoint IControlView::ConstrainDimensions (const PMPointdimensions) const
pure virtual

Before resizing a widget, the client can ask if the size makes sense by calling this method. Return size constraints.

Implemented in AbstractControlView, CelPnlPanelView, DCLSizPalettePanelView, CusCondTxtPanelView, and SnipRunControlView.

virtual void IControlView::DeleteDrawRegion ()
pure virtual

Deletes cached DrawRegion, causing it to be recalculated next time they're asked for.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::DoAutoAttach ()
pure virtual

Call to automatically attach observers. Shouldn't generally be called. Called on making view visible.

Implemented in AbstractControlView.

virtual void IControlView::DoAutoDetach ()
pure virtual

Call to automatically detach observers. Shouldn't generally be called. Called on making view invisible.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::DoPostCreate ()
pure virtual

Called after the widget hierarchy is created. Can be overriden to do initialization that may need the hierarchy to perform.

Implemented in AGMDrawnPanelView, DVGIFPlayerView, AbstractControlView, CelPnlPanelView, DVBasePanelView, DVHostedWidgetView, and DVPanelView.

virtual void IControlView::Draw (IViewPortviewPort,
SysRgn updateRgn = nil 
)
pure virtual
virtual bool16 IControlView::DrawRegionEncompassesChildRegions () const
pure virtual

Returns kTrue if all potential children of this view should be contained within this views DrawRegion Returns kFalse if this is not the case.

By default, the draw region for a widget is an intersection of it's bounding box and it's parent's draw region, since typically, the parent widget clips the child widgets drawing. In some cases, a widget may not want to restrict it's children's drawing to it's bounds. For these cases, DrawRegionEncompassesChildRegions() should return kFalse.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::ForceRedraw (SysRgn invalidRgn = nil,
bool16 forceRedraw = kTrue 
)
pure virtual

Redraws the invalid region directly. If 'forceRedraw' is true the redraw will happen immediately otherwise it just invals the region.

Parameters
invalidRgnregion of the window to draw. This region will NOT be disposed by ForceRedraw. If nil, then entire view (default)
forceRedrawkTrue if you'd like to draw now (default), kFalse to just inval.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual SysRect IControlView::GetBBox () const
pure virtual

Return the bounding box, in window coordinates, of the view. Its preferable to use GetFrame.

Note: Listbox controls(kStdListBoxWidgetNewBoss) on the Windows platform behave differently. They will always return a bounding box in their own coordinates instead of the window coordinates. They will always return a bounding box with an origin of 0,0. Also, all children of listbox controls will return a bounding box relative to the listbox instead of the window.

Implemented in AbstractControlView.

virtual PMMatrix* IControlView::GetContentToWindowTransform () const
pure virtual

Returns a transform for mapping geometry in content coordinate space to window cooridinate space.

Note: Listbox controls(kStdListBoxWidgetNewBoss) on the Windows platform behave differently. They do not include the transform from listbox to window All children of listbox controls will get a content to listbox transform.

Implemented in AbstractControlView.

virtual SysRgn IControlView::GetDrawRegion ()
pure virtual

Return a region that represents the area that the view draws in. The graphics context clips drawing to this region. The returned region is in window coordinates.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual bool16 IControlView::GetEnableState () const
pure virtual

Return true if this view's enabled flag is set.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual const PMRect& IControlView::GetFrame () const
pure virtual

Get the frame of the widget within the parent's co-ordinate system.

Returns
reference to the frame enclosing the widget

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual FrameBinding IControlView::GetFrameBinding () const
pure virtual

Get the frame binding. Each side of a widget's frame can be bound to the same side of its parent frame.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual const PMRect IControlView::GetLocalFrame () const
pure virtual

Get the frame of the widget within the widget's inner co-ordinate system.

Returns
PMRect contraining the frame enclosing the widget

Implemented in DVHostedWidgetView.

virtual RsrcID IControlView::GetRsrcID () const
pure virtual

Get the resource ID for the widget.

Implemented in AbstractControlView.

virtual PluginID IControlView::GetRsrcPluginID () const
pure virtual

Get the resources plugin id for the widget.

Implemented in AbstractControlView.

virtual bool16 IControlView::GetVisibleState () const
pure virtual

Return true if this view's visible flag is set.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual WidgetID IControlView::GetWidgetID () const
pure virtual

Get the widget ID. The widget ID is used to uniquely identify a particular child widget within a panel.

Returns
ID for this widget

Implemented in AbstractControlView.

virtual PMRect IControlView::GlobalToView (const PMRectconvertRect) const
pure virtual

Converts the specified rectangle/point from global (screen) coordinates to local coordinates.

Implemented in DVHostedWidgetView.

virtual void IControlView::Hilite (bool16 doHilite = kTrue)
pure virtual

Set hiliting on or off.

Parameters
doHilitecan be set to kFalse to turn hilite off.

Implemented in AbstractControlView, DVHostedWidgetView, and DVBasePanelView.

virtual int32 IControlView::HitTest (const SysPointwhere)
pure virtual

Returns true if the point 'where' is within the bounds of the view. Note this method really returns a boolean. Not sure why the return type is an int32.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::Init (const WidgetIDwidgetId = kDefaultWidgetId,
const PMRectfFrame = kZeroRect,
RsrcID rsrcID = 0 
)
pure virtual

Initialize the control view.

Parameters
widgetIdspecifies WidgetID to associate with this widget
fFramebounding box for the control
rsrcIDidentifies resource to associate with this widget

Implemented in DVHostedWidgetView, CusDtLnkUICustomView, PnlTrvCustomView, and AbstractControlView.

virtual void IControlView::Invalidate (PMRectinvalidRect = nil)
pure virtual

Invalidate a portion of the control view.

Parameters
invalidRectshould be in content coordinates(i.e. GetFrame()). nil invalidates the whole control view.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::InvalidateTransform ()
pure virtual

Invalidates transforms, causing them to be recalculated next time they're asked for.

Implemented in AbstractControlView, and DVBasePanelView.

virtual bool16 IControlView::IsEnabled () const
pure virtual

Return true if this view is enabled. A view is enabled if its enable flag is set and all of its ancestors are enabled.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual bool16 IControlView::IsHilited () const
pure virtual

Inspect the current hilite state.

Parameters
returnthe current hilite state

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual bool16 IControlView::IsRolledOver () const
pure virtual

Returns true if mouse is in a rollover state, requires rolloverboss

Parameters
returnthe current hilite state

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual bool16 IControlView::IsVisible (bool16 requireVisibleWindow = kFalse) const
pure virtual

Return true if this view is visible. A view is visible if its visible flag is set and all of its ancestors are visible.

Parameters
requireVisibleWindowspecifies what to do if this widget and all it's parent widgets are visible, but it's not in a visible window.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::MoveTo (const PMPointwhere,
bool16 invalidate = kTrue 
)
pure virtual

Move the widget to a specific position within the parent's coordinate system.

Parameters
wherenew top-left location for widget frame in parent's co-ordinate system
invalidateif set to kTrue, indicates that the widget should be marked for redraw

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::ParentPurged ()
pure virtual

Called when this widget's parent will be purged in the near future.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::ParentsEnableStateChanged (bool16 visible,
bool16 invalidate = kTrue 
)
pure virtual

Called whenever the widget's parent's enable state changes.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::Resize (const PMPointnewDimensions,
bool16 invalidate = kTrue 
)
pure virtual
virtual void IControlView::SetClipToSelfEnabled (bool16 clipChildren) const
pure virtual

This flag will instruct view to clip it's children drawing within it's view

Implemented in DVHostedWidgetView.

virtual void IControlView::SetFrame (const PMRectnewFrame,
bool16 invalidate = kTrue 
)
pure virtual

Set a frame for the widget within the parent's co-ordinate system.

Parameters
newFramespecifies frame for the widget
invalidateif set to kTrue, indicates that the widget should be marked for redraw

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::SetFrameBinding (const FrameBinding & binding)
pure virtual

Set the frame binding. Each side of a widget's frame can be bound to the same side of its parent frame. Whenever the parent widget is moved/resized, child widgets which have binding other than kBindNone will adapt to their parent's new size/position.

Binding choices are kBindNone, kBindLeft, kBindTop, kBindRight, kBindBottom, kBindAll. Bindings can be logically composed using the '|' operator.

Parameters
bindingspecifies the new binding

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual void IControlView::SetRsrcID (const RsrcID & id)
pure virtual

Set the resource ID for the widget.

Parameters
idresource ID to associate with this widget

Implemented in AbstractControlView.

virtual void IControlView::SetRsrcID (const RsrcID & id,
const bool isDarkIcon 
)
pure virtual

This function should be used only for Icon Widgets. Sets the resource ID for the widget and the theme to use for the icon.

Parameters
idresource ID to associate with this widget.
isDarkIconwhether the icon should be dark or bright.

Implemented in AbstractControlView.

virtual void IControlView::SetRsrcPluginID (const PluginIDid)
pure virtual

Set the resources plugin id for the widget.

Implemented in AbstractControlView.

virtual void IControlView::SetWidgetID (const WidgetIDid)
pure virtual

Set the widget ID.

Implemented in AbstractControlView.

virtual void IControlView::Unhilite ()
pure virtual

Set hiliting off.

Implemented in AbstractControlView, DVHostedWidgetView, and DVBasePanelView.

virtual void IControlView::Validate (PMRectinvalidRect = nil)
pure virtual

Validate a portion of the control view.

Parameters
invalidRectshould be in window coordinates(i.e. GetBBox()). nil validates the whole control view.

Implemented in AbstractControlView, and DVHostedWidgetView.

virtual PMRect IControlView::ViewToGlobal (const PMRectconvertRect) const
pure virtual

Converts the specified rectangle from local coordinates to global (screen) coordinates.

Implemented in DVHostedWidgetView.

virtual void IControlView::WindowActivated ()
pure virtual

Called when a window containing this widget is made active or inactive. Do things like dim selections, hide scroll bars, etc.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::WindowChanged ()
pure virtual

Called when window containing this widget changes. i.e. This widget is moved from one window to another.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::WindowClosed ()
pure virtual

Called when window containing this widget closes.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::WindowDeactivated ()
pure virtual

Called when a window containing this widget is made active or inactive. Do things like dim selections, hide scroll bars, etc.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::WindowHidden ()
pure virtual

Called when a window containing this widget is hidden.

Implemented in AbstractControlView, and DVBasePanelView.

virtual void IControlView::WindowShown ()
pure virtual

Called when a window containing this widget is shown.

Implemented in AbstractControlView, and DVBasePanelView.