Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
hdi::core::DocumentView Class Reference

Allow for interacting the document views (windows) More...

#include <hdicoreDocumentView.h>

Public Types

enum  ScreenMode {
  UnknownScreenMode = 0 , NoDocumentsScreenMode = 10 , NormalScreenMode = 20 , FullScreenWithMenuMode = 30 ,
  FullScreenWithoutMenuMode = 40 , PresentationMode = 50
}
 Describes the current layout of Illustrator's window(s)
 

Public Member Functions

 DocumentView ()
 Constructs an empty DocumentView object.
 
 DocumentView (const DocumentView &dv_)
 DocumentView copy constructor.
 
 DocumentView (const AIDocumentViewHandle aiDocView_)
 Constructs a new DocumentView object from an AIDocumentViewHandle.
 
virtual ~DocumentView ()
 DocumentView destructor.
 
virtual DocumentViewoperator= (const DocumentView &rhs_)
 Assigns one DocumentView object to another.
 
virtual AIDocumentViewHandle aiDocumentViewHandle () const
 Gets the document view handle around which the target object is wrapped.
 
virtual bool isEmpty () const
 Gets whether the target DocumentView object is empty (constructed with the default ctor)
 
virtual ArtboardRect bounds () const
 Gets the bounds of the portion of the document that is currently visible in its window.
 
virtual ArtboardPoint center () const
 Gets the center of the portion of the document that is currently visible in its window.
 
virtual void setCenter (const ArtboardPoint &center_)
 Moves the document view to be centered on the given point.
 
virtual double zoom () const
 Gets the current zoom level of the document. This is the scale factor from artwork coordinates to window coordinates.
 
virtual void setZoom (const double zoom_)
 Sets the current zoom level of the document. This is the scale factor from artwork coordinates to window coordinates.
 
virtual double displayZoom () const
 Gets the current display zoom level of the document. This is the zoom value that the user sees on the document status bar.
 
virtual void setDisplayZoom (const double zoom_)
 Sets the current display zoom level of the document. This is the zoom value that the user sees on the document status bar.
 
virtual ScreenMode screenMode () const
 Gets the current screen mode of the document (full, windowed, etc.)
 
virtual void setScreenMode (const ScreenMode mode_)
 Sets the current screen mode of the document (full, windowed, etc.)
 
virtual bool rotation (ArtboardPoint &pt__, Angle &angle__) const
 Gets the point and angle of rotation for the document view.
 
virtual void setRotation (const ArtboardPoint &pt_, const Angle &angle_)
 Sets the point and angle of rotation for the document view.
 
virtual void resetRotation ()
 Resets the angle of rotation for the document view back to zero degrees.
 
virtual Point artworkPointToViewPoint (const ArtboardPoint &artPt_)
 Converts a point on the document to an absolute point on the screen.
 
virtual ArtboardPoint viewPointToArtworkPoint (const Point &viewPt_)
 Converts a point on the screen to a point on the document.
 
virtual Rect artworkRectToViewRect (const ArtboardRect &artRect_)
 Converts a rect on the document to an absolute rect on the screen.
 
virtual ArtboardRect viewRectToArtworkRect (const Rect &viewRect_)
 Converts a rect on the screen to a rect on the document.
 
virtual Point artworkPointToViewPointUnrotated (const ArtboardPoint &artPt_)
 Converts a point on the document to an absolute point on the screen without taking into account the view rotation.
 
virtual ArtboardPoint viewPointToArtworkPointUnrotated (const Point &viewPt_)
 Converts a point on the screen to a point on the document without taking into account the view rotation.
 
virtual Rect artworkRectToViewRectUnrotated (const ArtboardRect &artRect_)
 Converts a rect on the document to an absolute rect on the screen without taking into account the view rotation.
 
virtual ArtboardRect viewRectToArtworkRectUnrotated (const Rect &viewRect_)
 Converts a rect on the screen to a rect on the document without taking into account the view rotation.
 
bool operator== (const DocumentView &rhs_) const
 Checks whether one DocumentView object represents the same Illustrator view as another.
 
bool operator!= (const DocumentView &rhs_) const
 Checks whether one DocumentView object does not represent the same Illustrator view as another.
 

Friends

aip::DocumentView * __accessImpl (const DocumentView &)
 
DocumentView __accessCtor (aip::DocumentView *&)
 

Detailed Description

Allow for interacting the document views (windows)

Constructor & Destructor Documentation

◆ DocumentView() [1/3]

hdi::core::DocumentView::DocumentView ( )

Constructs an empty DocumentView object.

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

◆ DocumentView() [2/3]

hdi::core::DocumentView::DocumentView ( const DocumentView dv_)

DocumentView copy constructor.

Author
GW
Date
08/2013
Parameters
dv_Existing DocumentView object to copy

◆ DocumentView() [3/3]

hdi::core::DocumentView::DocumentView ( const AIDocumentViewHandle  aiDocView_)

Constructs a new DocumentView object from an AIDocumentViewHandle.

Author
GW
Date
08/2015
Parameters
aiDocView_Raw Illustrator AIDocumentViewHandle

◆ ~DocumentView()

virtual hdi::core::DocumentView::~DocumentView ( )
virtual

DocumentView destructor.

Author
GW
Date
08/2013

Member Function Documentation

◆ aiDocumentViewHandle()

virtual AIDocumentViewHandle hdi::core::DocumentView::aiDocumentViewHandle ( ) const
virtual

Gets the document view handle around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIDocumentViewHandle for this object
Note
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of functionality provided by Illustrator is not handled by this class (or related classes), then it should probably be added to the hdi_core library.

◆ artworkPointToViewPoint()

virtual Point hdi::core::DocumentView::artworkPointToViewPoint ( const ArtboardPoint artPt_)
virtual

Converts a point on the document to an absolute point on the screen.

Author
GW
Date
08/2013
Parameters
artPt_Artboard point to convert to a UI point
Returns
The provided artboard point converted to the same physical coordinates, but as a UI point
Note
In Illustrator 25.3 and later view rotation is supported, so calling this method will return the post-rotation point in those versions. If you want the pre-rotation point, call the artworkPointToViewPointUnrotated() method.

◆ artworkPointToViewPointUnrotated()

virtual Point hdi::core::DocumentView::artworkPointToViewPointUnrotated ( const ArtboardPoint artPt_)
virtual

Converts a point on the document to an absolute point on the screen without taking into account the view rotation.

Author
GW
Date
04/2021
Parameters
artPt_Artboard point to convert to a UI point
Returns
The provided artboard point converted to the same physical coordinates, but as a UI point
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will return the same value as calling the artworkPointToViewPoint() method in those versions.

◆ artworkRectToViewRect()

virtual Rect hdi::core::DocumentView::artworkRectToViewRect ( const ArtboardRect artRect_)
virtual

Converts a rect on the document to an absolute rect on the screen.

Author
GW
Date
08/2013
Parameters
artRect_Artboard rect to convert to a UI rect
Returns
The provided artboard rect converted to the same physical coordinates, but as a UI rect
Note
In Illustrator 25.3 and later view rotation is supported, so calling this method will return the post-rotation rect in those versions. If you want the pre-rotation rect, call the artworkRectToViewRectUnrotated() method.

◆ artworkRectToViewRectUnrotated()

virtual Rect hdi::core::DocumentView::artworkRectToViewRectUnrotated ( const ArtboardRect artRect_)
virtual

Converts a rect on the document to an absolute rect on the screen without taking into account the view rotation.

Author
GW
Date
08/2011
Parameters
artRect_Artboard rect to convert to a UI rect
Returns
The provided artboard rect converted to the same physical coordinates, but as a UI rect
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will return the same value as calling the artworkRectToViewRect() method in those versions.

◆ bounds()

virtual ArtboardRect hdi::core::DocumentView::bounds ( ) const
virtual

Gets the bounds of the portion of the document that is currently visible in its window.

Author
GW
Date
08/2013
Returns
Rect representing the currently visible portion of the document

◆ center()

virtual ArtboardPoint hdi::core::DocumentView::center ( ) const
virtual

Gets the center of the portion of the document that is currently visible in its window.

Author
GW
Date
08/2013
Returns
Point representing the center of the currently visible portion of the document

◆ displayZoom()

virtual double hdi::core::DocumentView::displayZoom ( ) const
virtual

Gets the current display zoom level of the document. This is the zoom value that the user sees on the document status bar.

Author
GW
Date
08/2023
Returns
The document's display zoom level, where 1.0 is 100%, 0.5 is 50%, 2.0 is 200%, etc.

◆ isEmpty()

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

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

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

◆ operator!=()

bool hdi::core::DocumentView::operator!= ( const DocumentView rhs_) const

Checks whether one DocumentView object does not represent the same Illustrator view as another.

Author
GW
Date
08/2013
Parameters
rhs_Existing DocumentView object to compare with
Returns
true if the represented views are not the same, false otherwise

◆ operator=()

virtual DocumentView & hdi::core::DocumentView::operator= ( const DocumentView rhs_)
virtual

Assigns one DocumentView object to another.

Author
GW
Date
08/2013
Parameters
rhs_Existing DocumentView object to copy values from
Returns
The target DocumentView object, but with its values updated to match that of the rhs_ argument

◆ operator==()

bool hdi::core::DocumentView::operator== ( const DocumentView rhs_) const

Checks whether one DocumentView object represents the same Illustrator view as another.

Author
GW
Date
08/2013
Parameters
rhs_Existing DocumentView object to compare with
Returns
true if the represented views are the same, false otherwise

◆ resetRotation()

virtual void hdi::core::DocumentView::resetRotation ( )
virtual

Resets the angle of rotation for the document view back to zero degrees.

Author
GW
Date
04/2021
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will have no effect in those versions.

◆ rotation()

virtual bool hdi::core::DocumentView::rotation ( ArtboardPoint pt__,
Angle angle__ 
) const
virtual

Gets the point and angle of rotation for the document view.

Author
GW
Date
04/2021
Parameters
pt__Return-by-reference for the point in the document around which the view is rotated
angle__Return-by-reference for the angle of rotation around the point
Returns
true if the return-by-reference values were acquired successfully
Note
In Illustrator 25.2 and earlier rotation is unsupported, so the returned values will always be the document origin and zero degrees in those versions.

◆ screenMode()

virtual ScreenMode hdi::core::DocumentView::screenMode ( ) const
virtual

Gets the current screen mode of the document (full, windowed, etc.)

Author
GW
Date
08/2013
Returns
Current document view screen mode

◆ setCenter()

virtual void hdi::core::DocumentView::setCenter ( const ArtboardPoint center_)
virtual

Moves the document view to be centered on the given point.

Author
GW
Date
08/2013
Parameters
center_Point in the document on which to center in the document's containing window

◆ setDisplayZoom()

virtual void hdi::core::DocumentView::setDisplayZoom ( const double  zoom_)
virtual

Sets the current display zoom level of the document. This is the zoom value that the user sees on the document status bar.

Author
GW
Date
08/2023
Parameters
zoom_New document display zoom level, where 1.0 is 100%, 0.5 is 50%, 2.0 is 200%, etc.

◆ setRotation()

virtual void hdi::core::DocumentView::setRotation ( const ArtboardPoint pt_,
const Angle angle_ 
)
virtual

Sets the point and angle of rotation for the document view.

Author
GW
Date
04/2021
Parameters
pt_Point in the document around which to rotate the view
angle_Angle of rotation around the point
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will have no effect in those versions.

◆ setScreenMode()

virtual void hdi::core::DocumentView::setScreenMode ( const ScreenMode  mode_)
virtual

Sets the current screen mode of the document (full, windowed, etc.)

Author
GW
Date
08/2013
Parameters
mode_New screen mode for the document view

◆ setZoom()

virtual void hdi::core::DocumentView::setZoom ( const double  zoom_)
virtual

Sets the current zoom level of the document. This is the scale factor from artwork coordinates to window coordinates.

Author
GW
Date
08/2013
Parameters
zoom_New document zoom level, where 1.0 is 100%, 0.5 is 50%, 2.0 is 200%, etc.

◆ viewPointToArtworkPoint()

virtual ArtboardPoint hdi::core::DocumentView::viewPointToArtworkPoint ( const Point viewPt_)
virtual

Converts a point on the screen to a point on the document.

Author
GW
Date
08/2013
Parameters
viewPt_UI point to convert to an artboard point
Returns
The provided UI point converted to the same physical coordinates, but as an artboard point
Note
In Illustrator 25.3 and later view rotation is supported, so calling this method will return the post-rotation point in those versions. If you want the pre-rotation point, call the viewPointToArtworkPointUnrotated() method.

◆ viewPointToArtworkPointUnrotated()

virtual ArtboardPoint hdi::core::DocumentView::viewPointToArtworkPointUnrotated ( const Point viewPt_)
virtual

Converts a point on the screen to a point on the document without taking into account the view rotation.

Author
GW
Date
08/2011
Parameters
viewPt_UI point to convert to an artboard point
Returns
The provided UI point converted to the same physical coordinates, but as an artboard point
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will return the same value as calling the viewPointToArtworkPoint() method in those versions.

◆ viewRectToArtworkRect()

virtual ArtboardRect hdi::core::DocumentView::viewRectToArtworkRect ( const Rect viewRect_)
virtual

Converts a rect on the screen to a rect on the document.

Author
GW
Date
08/2013
Parameters
viewRect_UI rect to convert to an artboard rect
Returns
The provided UI rect converted to the same physical coordinates, but as an artboard rect
Note
In Illustrator 25.3 and later view rotation is supported, so calling this method will return the post-rotation rect in those versions. If you want the pre-rotation rect, call the viewRectToArtworkRectUnrotated() method.

◆ viewRectToArtworkRectUnrotated()

virtual ArtboardRect hdi::core::DocumentView::viewRectToArtworkRectUnrotated ( const Rect viewRect_)
virtual

Converts a rect on the screen to a rect on the document without taking into account the view rotation.

Author
GW
Date
08/2011
Parameters
viewRect_UI rect to convert to an artboard rect
Returns
The provided UI rect converted to the same physical coordinates, but as an artboard rect
Note
In Illustrator 25.2 and earlier rotation is unsupported, so calling this method will return the same value as calling the viewRectToArtworkRect() method in those versions.

◆ zoom()

virtual double hdi::core::DocumentView::zoom ( ) const
virtual

Gets the current zoom level of the document. This is the scale factor from artwork coordinates to window coordinates.

Author
GW
Date
08/2013
Returns
The document's zoom level, where 1.0 is 100%, 0.5 is 50%, 2.0 is 200%, etc.