Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Classes | Public Types | Public Member Functions | Friends | List of all members
hdi::core::CurrentDocument Class Reference

Current (focused) document class to allow for metadata access, updating, dictionary access, selected art access, layer access, etc. More...

#include <hdicoreCurrentDocument.h>

Classes

class  Setup
 Describes the setup options of an existing document. More...
 

Public Types

typedef std::vector< Art * > ArtVector
 
typedef std::vector< MatchArtSpecMatchArtSpecVector
 
typedef std::auto_ptr< SetupSetupAP
 

Public Member Functions

std::auto_ptr< ai::Dictionarydictionary ()
 Gets the built-in document data dictionary object for the current document. More...
 
AIDocumentHandle aiDocumentHandle () const
 Gets the document handle around which the target object is wrapped. More...
 
PlatformDocWindowPtr platformWindow () const
 Gets the platform-specific window handle for the document. More...
 
std::string filePath () const
 Gets the complete path to the current document. More...
 
std::string fileName () const
 Gets the name of the current document. More...
 
ArtboardRect maxBounds () const
 Gets the max bounds rect for the current document. More...
 
RulerUnits rulerUnits () const
 Gets the ruler units for the current document. More...
 
std::auto_ptr< Setupsetup () const
 Gets the setup options for the current document. More...
 
bool hasTextFocus () const
 Gets whether the current document is in text editing mode. More...
 
std::auto_ptr< TextStoryfocusedText () const
 Gets the story that has editing focus (i.e. has some selected range) More...
 
bool setFocusedText (const TextStory &story_)
 Sets the story that should have editing focus, and the editing caret is placed at the start of said story. More...
 
void loseTextFocus ()
 Ends text editing mode for the current document. More...
 
std::auto_ptr< TextRangeSetselectedText () const
 Gets the set of selected text ranges for the current document. More...
 
bool modified () const
 Gets whether the current document has been modified. More...
 
void setModified (const bool mod_)
 Sets whether the current document is in a modified state. More...
 
void sync () const
 Updates cached artwork properties for the current document. More...
 
void redraw () const
 Forces the art in the current document to be redrawn. More...
 
void syncAndRedraw () const
 Updates cached artwork properties for the current document, synchronizes the current context, and forces the art in the current document to be redrawn. More...
 
bool save () const
 Saves the current document, prompting the user if it has not been saved before. More...
 
bool save (const std::string &path_, const FileFormat &ff_, const bool prompt_=true) const
 Saves the current document with the given parameters, even if the document has not been saved before (and without affecting the modification status of the document) More...
 
bool save (const std::string &path_, const FileFormat &ff_, const FileFormat::Options opt_, const bool prompt_=true) const
 Saves the current document with the given parameters and options, even if the document has not been saved before (and without affecting the modification status of the document) More...
 
bool close () const
 Closes the current document. More...
 
void undo () const
 Undoes the most recent undoable transaction for the current document (same as the user using the undo menu item) More...
 
void redo () const
 Redoes the most recent redoable transaction for the current document (same as the user using the redo menu item) More...
 
bool anyArtSelected () const
 Gets whether any art is selected at all in the document. More...
 
ArtVector selectedArt () const
 Gets a vector of all currently selected art in the document. More...
 
void deselectAllArt () const
 Deselects all currently selected art. More...
 
ArtVector matchingArt (const MatchArtSpecVector &specs_) const
 Gets a vector of art in the document whose specs match those given. More...
 
ArtVector artOfType (const MatchArtType type_) const
 Gets a vector of art in the document whose type matches the given type. More...
 
PathStyle selectedArtPathStyle () const
 Gets the path style of the currently selected art in the document. More...
 
bool selectedArtPathStyle (PathStyle &style__, PathStyle::Map &map__) const
 Gets the path style and map of the currently selected art in the document. More...
 
void setSelectedArtPathStyle (const PathStyle &style_)
 Sets the path style of the currently selected art in the document. More...
 
void setSelectedArtPathStyle (const PathStyle &style_, const PathStyle::Map &map_)
 Sets the path style of the currently selected art in the document, taking a map into account. More...
 
uint32_t viewCount () const
 Gets a count of the views in the current document. More...
 
std::auto_ptr< DocumentViewviewAtIndex (const uint32_t index_) const
 Gets a given document view, by its index, in the current document. More...
 
std::auto_ptr< DocumentViewcurrentView () const
 Gets the current view for the current document. More...
 
uint32_t layerCount () const
 Gets a count of the layers in the current document. More...
 
std::auto_ptr< LayerfirstLayer () const
 Gets the first layer in the list in the current document. More...
 
std::auto_ptr< LayerlastLayer () const
 Gets the last layer in the list in the current document. More...
 
std::auto_ptr< LayerlayerByTitle (const std::string &title_) const
 Gets a given layer, by its name, in the current document (case-insensitive) More...
 
std::auto_ptr< LayerlayerAtIndex (const uint32_t index_) const
 Gets a given layer, by its index, in the current document. More...
 
std::auto_ptr< LayercurrentLayer () const
 Gets the currently selected layer of the current document. More...
 
void setCurrentLayer (const Layer &layer_)
 Sets the currently selected layer in the current document. More...
 
bool inIsolationMode () const
 Gets whether the current document is in isolation mode. More...
 
std::auto_ptr< ArtisolatedArt () const
 Gets the currently isolated art. More...
 
bool enterIsolationMode (const Art &art_, const bool hideOtherArt_)
 Enters isolation mode of the given art object or one of its parents. More...
 
void exitIsolationMode () const
 Ends isolation mode in the current document. More...
 
bool inPatternEditingMode () const
 Gets whether the current document is in pattern editing mode (similar to isolation mode, but for editing a pattern in-place) More...
 
bool enterPatternEditingMode (const Pattern &toEdit_)
 Enters pattern editing mode for the current document. More...
 
bool applyPatternEditingModeChanges (const Pattern &editPatt_)
 Ends pattern editing mode, applying the changes made for the given pattern. More...
 
void exitPatternEditingMode () const
 Ends pattern editing mode in the current document, discarding any changes made to the pattern. More...
 
bool inSymbolEditingMode () const
 Gets whether the current document is in symbol editing mode (similar to isolation mode, but for editing a prototype of the symbol source art in-place) More...
 
bool enterSymbolEditingMode (const Symbol &toEdit_, const Art *const inst_=NULL)
 Enters symbol editing mode for the current document, creating a prototype (i.e. temporary copy) of the symbol source art for in-place editing. More...
 
bool applySymbolEditingModeChanges (const Symbol &editSym_)
 Ends symbol editing mode, applying the changes made for the given symbol prototype to the symbol source art. More...
 
void exitSymbolEditingMode () const
 Ends symbol editing mode in the current document, discarding any changes made to the symbol. More...
 
uint32_t artboardCount () const
 Gets the number of artboards in the document. More...
 
std::auto_ptr< ArtboardartboardByTitle (const std::string &title_) const
 Gets a given artboard, by its name, in the current document (case-insensitive) More...
 
std::auto_ptr< ArtboardartboardAtIndex (const uint32_t index_) const
 Gets a given artboard, by its index, in the current document. More...
 
bool insertArtboard (const uint32_t index_, Artboard &ab__) const
 Inserts a new artboard at a given position in the artboard list in the current document. More...
 
std::auto_ptr< ArtboardcurrentArtboard () const
 Gets the current (active) artboard in the document. More...
 
void setCurrentArtboard (const Artboard &artboard_)
 Sets the currently selected artboard in the current document. More...
 
uint32_t artStyleCount () const
 Gets the number of art styles in the document. More...
 
std::auto_ptr< ArtStyleartStyleAtIndex (const uint32_t index_) const
 Gets a given art style, by its index, in the current doc. More...
 
uint32_t patternCount () const
 Gets the number of patterns in the document. More...
 
std::auto_ptr< PatternpatternAtIndex (const uint32_t index_) const
 Gets a given pattern, by its index, in the current doc. More...
 
uint32_t symbolDefCount () const
 Gets the number of symbol definitions in the document. More...
 
std::auto_ptr< SymbolsymbolDefAtIndex (const uint32_t index_) const
 Gets a given symbol definition, by its index, in the current doc. More...
 
Grid *const grid () const
 Gets the grid object for the current document. More...
 
DocumentColorModel colorModel () const
 Gets the color model for the current document. More...
 
PathStyle defaultPathStyle () const
 Retrieves the default path style that tools should use when creating new objects other than text objects. More...
 
void setDefaultPathStyle (const PathStyle &style_)
 Sets the default path style that tools should use when creating new objects other than text objects. More...
 
PathStyle defaultTextStyle () const
 Retrieves the default path style that tools should use when creating text objects. More...
 
void setDefaultTextStyle (const PathStyle &style_)
 Sets the default path style that tools should use when creating text objects. More...
 
std::auto_ptr< FontcurrentFont () const
 Gets the current font for the document. More...
 
void setCurrentFont (const Font &font_)
 Sets the current font for the document. More...
 
ArtVector artAtPoint (const ArtboardPoint &pt_, const HitRequest request_) const
 Gets a vector of all art found at a given point on the document. More...
 

Friends

class Illustrator
 

Detailed Description

Current (focused) document class to allow for metadata access, updating, dictionary access, selected art access, layer access, etc.

Member Function Documentation

AIDocumentHandle hdi::core::CurrentDocument::aiDocumentHandle ( ) const

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

Author
GW
Date
11/2013
Returns
AIDocumentHandle 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.
bool hdi::core::CurrentDocument::anyArtSelected ( ) const

Gets whether any art is selected at all in the document.

Author
GW
Date
12/2015
Returns
true for any art being selected, false otherwise
Note
This method is much faster for large documents with large selections than getting all of the currently selected art and simply checking if the vector is not empty.
bool hdi::core::CurrentDocument::applyPatternEditingModeChanges ( const Pattern editPatt_)

Ends pattern editing mode, applying the changes made for the given pattern.

Author
GW
Date
11/2015
Parameters
editPatt_The pattern currently being edited
Returns
true if editPatt_ is actually being edited and the changes were applied
Note
This method is safe to call if not currently in isolation mode
If you want to exit pattern editing mode without saving any of the changes made, call the exitPatternEditingMode() method instead.
bool hdi::core::CurrentDocument::applySymbolEditingModeChanges ( const Symbol editSym_)

Ends symbol editing mode, applying the changes made for the given symbol prototype to the symbol source art.

Author
GW
Date
11/2015
Parameters
editSym_The symbol currently being edited
Returns
true if editSym_ is actually being edited and the changes were applied
Note
This method is safe to call if not currently in isolation mode
If you want to exit symbol editing mode without saving any of the changes made to the prototype, call the exitSymbolEditingMode() method instead.
ArtVector hdi::core::CurrentDocument::artAtPoint ( const ArtboardPoint pt_,
const HitRequest  request_ 
) const

Gets a vector of all art found at a given point on the document.

Author
GW
Date
08/2013
Parameters
pt_Point at which to check for art
request_As art is found with hit requests, this specifies what art to look for
Returns
An artwork vector whose entries match the provided specs, in order from the top-most art found to the bottom-most
Warning
The caller assumes responsibility for the memory of the contained Art objects.
std::auto_ptr<Artboard> hdi::core::CurrentDocument::artboardAtIndex ( const uint32_t  index_) const

Gets a given artboard, by its index, in the current document.

Author
GW
Date
08/2013
Parameters
index_Index number of the artboard in question
Returns
Artboard object with the specified index
std::auto_ptr<Artboard> hdi::core::CurrentDocument::artboardByTitle ( const std::string &  title_) const

Gets a given artboard, by its name, in the current document (case-insensitive)

Author
GW
Date
01/2017
Parameters
title_Title of the artboard in question, as UTF-8
Returns
The artboard in question, or NULL for none
uint32_t hdi::core::CurrentDocument::artboardCount ( ) const

Gets the number of artboards in the document.

Author
GW
Date
08/2013
Returns
A count of the number of artboards in the current document
ArtVector hdi::core::CurrentDocument::artOfType ( const MatchArtType  type_) const

Gets a vector of art in the document whose type matches the given type.

Author
GW
Date
08/2013
Parameters
type_Logical OR of types of art to find
Returns
An artwork vector whose entries match the provided art type(s)
Warning
The caller assumes responsibility for the memory of the contained Art objects.
std::auto_ptr<ArtStyle> hdi::core::CurrentDocument::artStyleAtIndex ( const uint32_t  index_) const

Gets a given art style, by its index, in the current doc.

Author
GW
Date
11/2013
Parameters
index_Index number of the style in question
Returns
The ArtStyle object with the specified index
uint32_t hdi::core::CurrentDocument::artStyleCount ( ) const

Gets the number of art styles in the document.

Author
GW
Date
11/2013
Returns
A count of the number of art styles in the current document
bool hdi::core::CurrentDocument::close ( ) const

Closes the current document.

Author
GW
Date
10/2013
Returns
true if the document was closed, false otherwise
DocumentColorModel hdi::core::CurrentDocument::colorModel ( ) const

Gets the color model for the current document.

Author
GW
Date
08/2013
Returns
Current color model for the target document
std::auto_ptr<Artboard> hdi::core::CurrentDocument::currentArtboard ( ) const

Gets the current (active) artboard in the document.

Author
GW
Date
08/2013
Returns
An Artboard object for the currently selected artboard, or NULL if none
std::auto_ptr<Font> hdi::core::CurrentDocument::currentFont ( ) const

Gets the current font for the document.

Author
GW
Date
04/2016
Returns
The current document's current font, or NULL for none/error
std::auto_ptr<Layer> hdi::core::CurrentDocument::currentLayer ( ) const

Gets the currently selected layer of the current document.

Author
GW
Date
08/2013
Returns
A Layer object for the currently selected layer, or NULL if none
std::auto_ptr<DocumentView> hdi::core::CurrentDocument::currentView ( ) const

Gets the current view for the current document.

Author
GW
Date
08/2013
Returns
The current document view, or NULL if none/error
PathStyle hdi::core::CurrentDocument::defaultPathStyle ( ) const

Retrieves the default path style that tools should use when creating new objects other than text objects.

Author
GW
Date
08/2014
Returns
The default path style
PathStyle hdi::core::CurrentDocument::defaultTextStyle ( ) const

Retrieves the default path style that tools should use when creating text objects.

Author
GW
Date
08/2014
Returns
The default text style
void hdi::core::CurrentDocument::deselectAllArt ( ) const

Deselects all currently selected art.

Author
GW
Date
08/2013
std::auto_ptr<ai::Dictionary> hdi::core::CurrentDocument::dictionary ( )

Gets the built-in document data dictionary object for the current document.

Author
GW
Date
08/2013
Returns
The Dictionary object for the current document
bool hdi::core::CurrentDocument::enterIsolationMode ( const Art art_,
const bool  hideOtherArt_ 
)

Enters isolation mode of the given art object or one of its parents.

Author
GW
Date
11/2015
Parameters
art_Art to be isolated
hideOtherArt_true to make non-isolated invisible, false to dim it instead
Returns
true for successful isolation, false otherwise
Note
When isolating a piece of art, this will look up the parent lineage and automatically isolate the first parent that can be isolated (as Illustrator does not allow "leaf art", such as paths, to be isolated).
bool hdi::core::CurrentDocument::enterPatternEditingMode ( const Pattern toEdit_)

Enters pattern editing mode for the current document.

Author
GW
Date
11/2015
Parameters
toEdit_The pattern to be edited
Returns
true if pattern editing mode was entered successfully, false otherwise
bool hdi::core::CurrentDocument::enterSymbolEditingMode ( const Symbol toEdit_,
const Art *const  inst_ = NULL 
)

Enters symbol editing mode for the current document, creating a prototype (i.e. temporary copy) of the symbol source art for in-place editing.

Author
GW
Date
11/2015
Parameters
toEdit_The symbol to be edited
inst_An optional instance of the symbol
Returns
true if symbol editing mode was entered successfully, false otherwise
Note
If inst_ is NULL, then editing will take place in the center of the artboard. Otherwise, editing will take place wherever the instance is located.
void hdi::core::CurrentDocument::exitIsolationMode ( ) const

Ends isolation mode in the current document.

Author
GW
Date
08/2013
Note
This method is safe to call if not currently in isolation mode
void hdi::core::CurrentDocument::exitPatternEditingMode ( ) const

Ends pattern editing mode in the current document, discarding any changes made to the pattern.

Author
GW
Date
11/2015
Note
This method is safe to call if not currently in pattern editing mode
void hdi::core::CurrentDocument::exitSymbolEditingMode ( ) const

Ends symbol editing mode in the current document, discarding any changes made to the symbol.

Author
GW
Date
11/2015
Note
This method is safe to call if not currently in symbol editing mode
std::string hdi::core::CurrentDocument::fileName ( ) const

Gets the name of the current document.

Author
GW
Date
08/2013
Returns
The name of the target document, as UTF-8
std::string hdi::core::CurrentDocument::filePath ( ) const

Gets the complete path to the current document.

Author
GW
Date
08/2013
Returns
The URL (location) of the target document, as UTF-8
Note
In the case of a new (never saved) document, this simply returns the file name
std::auto_ptr<Layer> hdi::core::CurrentDocument::firstLayer ( ) const

Gets the first layer in the list in the current document.

Author
GW
Date
08/2013
Returns
The Layer object for the first layer in the document
std::auto_ptr<TextStory> hdi::core::CurrentDocument::focusedText ( ) const

Gets the story that has editing focus (i.e. has some selected range)

Author
GW
Date
10/2015
Returns
The focused story, or NULL for none/error
Grid* const hdi::core::CurrentDocument::grid ( ) const

Gets the grid object for the current document.

Author
GW
Date
08/2013
Returns
A Grid object for the grid of the current document
bool hdi::core::CurrentDocument::hasTextFocus ( ) const

Gets whether the current document is in text editing mode.

Author
GW
Date
08/2013
Returns
true if the target document has text editing focus, false otherwise
bool hdi::core::CurrentDocument::inIsolationMode ( ) const

Gets whether the current document is in isolation mode.

Author
GW
Date
08/2013
Returns
true if in isolation mode, false otherwise
bool hdi::core::CurrentDocument::inPatternEditingMode ( ) const

Gets whether the current document is in pattern editing mode (similar to isolation mode, but for editing a pattern in-place)

Author
GW
Date
11/2015
Returns
true if in pattern editing mode, false otherwise
Note
When a document is in pattern editing mode, the inIsolationMode() method will also return true. To determine if in pattern editing mode, use this method instead.
bool hdi::core::CurrentDocument::insertArtboard ( const uint32_t  index_,
Artboard ab__ 
) const

Inserts a new artboard at a given position in the artboard list in the current document.

Author
GW
Date
08/2013
Parameters
index_Index at which to create the new artboard
ab__Return-by-reference for the new Artboard object at the specified index
Returns
true if the artboard was created and inserted, false otherwise
bool hdi::core::CurrentDocument::inSymbolEditingMode ( ) const

Gets whether the current document is in symbol editing mode (similar to isolation mode, but for editing a prototype of the symbol source art in-place)

Author
GW
Date
11/2015
Returns
true if in symbol editing mode, false otherwise
Note
When a document is in symbol editing mode, the inIsolationMode() method will also return true. To determine if in symbol editing mode, use this method instead.
std::auto_ptr<Art> hdi::core::CurrentDocument::isolatedArt ( ) const

Gets the currently isolated art.

Author
GW
Date
08/2013
Returns
Art object for the currently isolated art
std::auto_ptr<Layer> hdi::core::CurrentDocument::lastLayer ( ) const

Gets the last layer in the list in the current document.

Author
GW
Date
08/2013
Returns
The Layer object for the last layer in the document
std::auto_ptr<Layer> hdi::core::CurrentDocument::layerAtIndex ( const uint32_t  index_) const

Gets a given layer, by its index, in the current document.

Author
GW
Date
08/2013
Parameters
index_Index number of the layer in question
Returns
The layer in question, or NULL for none
std::auto_ptr<Layer> hdi::core::CurrentDocument::layerByTitle ( const std::string &  title_) const

Gets a given layer, by its name, in the current document (case-insensitive)

Author
GW
Date
08/2013
Parameters
title_Title of the layer in question, as UTF-8
Returns
The layer in question, or NULL for none
uint32_t hdi::core::CurrentDocument::layerCount ( ) const

Gets a count of the layers in the current document.

Author
GW
Date
08/2013
Returns
A count of the number of layers in the current document
void hdi::core::CurrentDocument::loseTextFocus ( )

Ends text editing mode for the current document.

Author
GW
Date
10/2015
ArtVector hdi::core::CurrentDocument::matchingArt ( const MatchArtSpecVector &  specs_) const

Gets a vector of art in the document whose specs match those given.

Author
GW
Date
08/2013
Parameters
specs_Vector of match specifications
Returns
An artwork vector whose entries match the provided specifications
Note
This method takes a vector of specs so the caller can specify a multitude of artwork properties, thereby acquiring a vector of artwork that (currently) exhibit all of the provided properties.
Warning
The caller assumes responsibility for the memory of the contained Art objects.
ArtboardRect hdi::core::CurrentDocument::maxBounds ( ) const

Gets the max bounds rect for the current document.

Author
GW
Date
08/2013
Returns
Maximum bounds for the target document
bool hdi::core::CurrentDocument::modified ( ) const

Gets whether the current document has been modified.

Author
GW
Date
08/2013
Returns
true if the target document has been edited since it was last saved, or false otherwise
std::auto_ptr<Pattern> hdi::core::CurrentDocument::patternAtIndex ( const uint32_t  index_) const

Gets a given pattern, by its index, in the current doc.

Author
GW
Date
11/2013
Parameters
index_Index number of the pattern in question
Returns
The Pattern object with the specified index
uint32_t hdi::core::CurrentDocument::patternCount ( ) const

Gets the number of patterns in the document.

Author
GW
Date
11/2013
Returns
A count of the number of patterns in the current document
PlatformDocWindowPtr hdi::core::CurrentDocument::platformWindow ( ) const

Gets the platform-specific window handle for the document.

Author
GW
Date
02/2015
Returns
Pointer to platform-specific window. See PlatformDocWindowPtr typedef.
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 UI functionality is not handled by this class (or related classes), then it should probably be added to the hdi_core library.
void hdi::core::CurrentDocument::redo ( ) const

Redoes the most recent redoable transaction for the current document (same as the user using the redo menu item)

Author
GW
Date
11/2015
Note
Use only when this plug-in is issuing a command and is entirely in control of that command. Do not call when responding to messages invoked by other commands, such as save, close, update, and so on.
void hdi::core::CurrentDocument::redraw ( ) const

Forces the art in the current document to be redrawn.

Author
GW
Date
08/2013
Note
With large documents, this method can have a significant performance hit.
RulerUnits hdi::core::CurrentDocument::rulerUnits ( ) const

Gets the ruler units for the current document.

Author
GW
Date
08/2013
Returns
The current ruler units for the target document
bool hdi::core::CurrentDocument::save ( ) const

Saves the current document, prompting the user if it has not been saved before.

Author
GW
Date
10/2013
Returns
true if the document was saved, false otherwise
bool hdi::core::CurrentDocument::save ( const std::string &  path_,
const FileFormat ff_,
const bool  prompt_ = true 
) const

Saves the current document with the given parameters, even if the document has not been saved before (and without affecting the modification status of the document)

Author
GW
Date
12/2014
Parameters
path_Path, as UTF-8, to which the document should be saved
ff_File format to use when writing the document to disk
prompt_Whether to prompt the user for configuration of the file before writing
Returns
true if the document was written to disk successfully
Note
If inadequate formatting parameters are available, then the user will be prompted for configuration even if prompt_ is false.
bool hdi::core::CurrentDocument::save ( const std::string &  path_,
const FileFormat ff_,
const FileFormat::Options  opt_,
const bool  prompt_ = true 
) const

Saves the current document with the given parameters and options, even if the document has not been saved before (and without affecting the modification status of the document)

Author
GW
Date
12/2014
Parameters
path_Path, as UTF-8, to which the document should be saved
ff_File format to use when writing the document to disk
opt_Bitwise OR of write options
prompt_Whether to prompt the user for configuration of the file before writing
Returns
true if the document was written to disk successfully
Note
If inadequate formatting parameters are available, then the user will be prompted for configuration even if prompt_ is false.
ArtVector hdi::core::CurrentDocument::selectedArt ( ) const

Gets a vector of all currently selected art in the document.

Author
GW
Date
08/2013
Returns
An artwork vector of all currently selected art
Warning
The caller assumes responsibility for the memory of the contained Art objects.
PathStyle hdi::core::CurrentDocument::selectedArtPathStyle ( ) const

Gets the path style of the currently selected art in the document.

Author
GW
Date
08/2013
Returns
A path style representing the style of the currently selected art
bool hdi::core::CurrentDocument::selectedArtPathStyle ( PathStyle style__,
PathStyle::Map map__ 
) const

Gets the path style and map of the currently selected art in the document.

Author
GW
Date
08/2013
Parameters
style__Return-by-reference for the path style of the currently selected art
map__Return-by-reference for a path style map, indicating which path style properties are fully known (or unknown)
Returns
true if the style and map could be acquired, false otherwise
Note
In general, the purpose of a map is to indicate which values are known/common across all target artwork. For example, if two pieces of art were selected, one with a stroke and the other with no stroke, then the map would indicate that the stroke is "unknown". If the same pieces of both had a fill, then the map would indicate that the fill is "known".
std::auto_ptr<TextRangeSet> hdi::core::CurrentDocument::selectedText ( ) const

Gets the set of selected text ranges for the current document.

Author
GW
Date
10/2015
Returns
The selected text ranges (see notes)
Note
The text selection can describe multiple discontiguous ranges of text across multiple art objects. If the document is in text editing mode, the result is a range representing the caret or the user selection. If the document is not in text editing mode, there might be multiple ranges for the selected text frame object(s).
void hdi::core::CurrentDocument::setCurrentArtboard ( const Artboard artboard_)

Sets the currently selected artboard in the current document.

Author
GW
Date
08/2013
Parameters
artboard_The artboard to select
void hdi::core::CurrentDocument::setCurrentFont ( const Font font_)

Sets the current font for the document.

Author
GW
Date
04/2016
Parameters
font_New font object for the document
void hdi::core::CurrentDocument::setCurrentLayer ( const Layer layer_)

Sets the currently selected layer in the current document.

Author
GW
Date
08/2013
Parameters
layer_The layer to select
void hdi::core::CurrentDocument::setDefaultPathStyle ( const PathStyle style_)

Sets the default path style that tools should use when creating new objects other than text objects.

Author
GW
Date
08/2014
Parameters
style_New default path style
void hdi::core::CurrentDocument::setDefaultTextStyle ( const PathStyle style_)

Sets the default path style that tools should use when creating text objects.

Author
GW
Date
08/2014
Parameters
style_New default text style
bool hdi::core::CurrentDocument::setFocusedText ( const TextStory story_)

Sets the story that should have editing focus, and the editing caret is placed at the start of said story.

Author
GW
Date
10/2015
Parameters
story_Story to put into editing mode
Returns
true if the story was focused, false otherwise
void hdi::core::CurrentDocument::setModified ( const bool  mod_)

Sets whether the current document is in a modified state.

Author
GW
Date
08/2013
Parameters
mod_true to put the document in a modified state, false otherwise
Note
This method is useful if you've made some small/internal change to the document that you do not wish the user to become aware of
void hdi::core::CurrentDocument::setSelectedArtPathStyle ( const PathStyle style_)

Sets the path style of the currently selected art in the document.

Author
GW
Date
08/2013
Parameters
style_New path styling for the currently selected art
void hdi::core::CurrentDocument::setSelectedArtPathStyle ( const PathStyle style_,
const PathStyle::Map map_ 
)

Sets the path style of the currently selected art in the document, taking a map into account.

Author
GW
Date
08/2013
Parameters
style_New path styling for the currently selected art
map_Style map, indicating which path style properties are fully known (or unknown)
std::auto_ptr<Setup> hdi::core::CurrentDocument::setup ( ) const

Gets the setup options for the current document.

Author
GW
Date
08/2013
Returns
The current setup options for the target document
std::auto_ptr<Symbol> hdi::core::CurrentDocument::symbolDefAtIndex ( const uint32_t  index_) const

Gets a given symbol definition, by its index, in the current doc.

Author
GW
Date
11/2013
Parameters
index_Index number of the symbol def in question
Returns
The Symbol object with the specified index
uint32_t hdi::core::CurrentDocument::symbolDefCount ( ) const

Gets the number of symbol definitions in the document.

Author
GW
Date
11/2013
Returns
A count of the number of symbol definitions in the current document
void hdi::core::CurrentDocument::sync ( ) const

Updates cached artwork properties for the current document.

Author
GW
Date
08/2013
Note
In general, when Illustrator behaves in a mildly erroneous (but consistent) manner, e.g. artwork not selecting properly under certain repeatable circumstances, calling this method (either before or after the call that introduced the erroneous behavior) will sometimes resolve the problem. The only people that know why are on the Illustrator team...
void hdi::core::CurrentDocument::syncAndRedraw ( ) const

Updates cached artwork properties for the current document, synchronizes the current context, and forces the art in the current document to be redrawn.

Author
GW
Date
09/2014
Note
Does nothing on Illustrator 16 and below.
It is well known that after creating text art objects anew and setting their contents, this method must be called thereafter if you would like to select the text art objects before your plugin's context exits. Otherwise, you would have to select the text after a delay (i.e. in a timer) of some sort.
Do not confuse this with the sync() and redraw() methods, as the underlying Illustrator suite call for this method is not the same as the others. It is entirely possible that the underlying suite call performs additional tasks over calling sync() and redraw() together, but the only people that know for sure are on the Illustrator team...
void hdi::core::CurrentDocument::undo ( ) const

Undoes the most recent undoable transaction for the current document (same as the user using the undo menu item)

Author
GW
Date
11/2015
Note
Use only when this plug-in is issuing a command and is entirely in control of that command. Do not call when responding to messages invoked by other commands, such as save, close, update, and so on.
std::auto_ptr<DocumentView> hdi::core::CurrentDocument::viewAtIndex ( const uint32_t  index_) const

Gets a given document view, by its index, in the current document.

Author
GW
Date
08/2013
Parameters
index_Index number of the document view in question
Returns
The view in question, or NULL for none
uint32_t hdi::core::CurrentDocument::viewCount ( ) const

Gets a count of the views in the current document.

Author
GW
Date
08/2013
Returns
A count of the number of views in the current document