Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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
}
 Describes the current layout of Illustrator's window(s)
 

Public Member Functions

 DocumentView ()
 Constructs an empty DocumentView object. More...
 
 DocumentView (const DocumentView &dv_)
 DocumentView copy constructor. More...
 
 DocumentView (const AIDocumentViewHandle aiDocView_)
 Constructs a new DocumentView object from an AIDocumentViewHandle. More...
 
virtual ~DocumentView ()
 DocumentView destructor. More...
 
virtual DocumentViewoperator= (const DocumentView &rhs_)
 Assigns one DocumentView object to another. More...
 
virtual AIDocumentViewHandle aiDocumentViewHandle () const
 Gets the document view handle around which the target object is wrapped. More...
 
virtual bool isEmpty () const
 Gets whether the target DocumentView object is empty (constructed with the default ctor) More...
 
virtual ArtboardRect bounds () const
 Gets the bounds of the portion of the document that is currently visible in its window. More...
 
virtual ArtboardPoint center () const
 Gets the center of the portion of the document that is currently visible in its window. More...
 
virtual void setCenter (const ArtboardPoint &center_)
 Moves the document view to be centered on the given point. More...
 
virtual double zoom () const
 Gets the current zoom level of the document. More...
 
virtual void setZoom (const double zoom_)
 Sets the current zoom level of the document. More...
 
virtual ScreenMode screenMode () const
 Gets the current screen mode of the document (full, windowed, etc.) More...
 
virtual void setScreenMode (const ScreenMode mode_)
 Sets the current screen mode of the document (full, windowed, etc.) More...
 
virtual Point artworkPointToViewPoint (const ArtboardPoint &artPt_)
 Converts a point on the document to an absolute point on the screen. More...
 
virtual ArtboardPoint viewPointToArtworkPoint (const Point &viewPt_)
 Converts a point on the screen to a point on the document. More...
 
virtual Rect artworkRectToViewRect (const ArtboardRect &artRect_)
 Converts a rect on the document to an absolute rect on the screen. More...
 
virtual ArtboardRect viewRectToArtworkRect (const Rect &viewRect_)
 Converts a rect on the screen to a rect on the document. More...
 
bool operator== (const DocumentView &rhs_) const
 Checks whether one DocumentView object represents the same Illustrator view as another. More...
 
bool operator!= (const DocumentView &rhs_) const
 Checks whether one DocumentView object does not represent the same Illustrator view as another. More...
 

Friends

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

Detailed Description

Allow for interacting the document views (windows)

Constructor & Destructor Documentation

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)
hdi::core::DocumentView::DocumentView ( const DocumentView dv_)

DocumentView copy constructor.

Author
GW
Date
08/2013
Parameters
dv_Existing DocumentView object to copy
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
virtual hdi::core::DocumentView::~DocumentView ( )
virtual

DocumentView destructor.

Author
GW
Date
08/2013

Member Function Documentation

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.
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
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
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
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
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
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
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
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
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
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
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
virtual void hdi::core::DocumentView::setZoom ( const double  zoom_)
virtual

Sets the current zoom level of the document.

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.
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
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
virtual double hdi::core::DocumentView::zoom ( ) const
virtual

Gets the current zoom level of the document.

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.