Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
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< std::shared_ptr< Art > > | ArtVector |
typedef std::vector< MatchArtSpec > | MatchArtSpecVector |
typedef std::unique_ptr< Setup > | SetupUP |
typedef std::shared_ptr< Setup > | SetupSP |
typedef std::weak_ptr< Setup > | SetupWP |
Public Member Functions | |
std::unique_ptr< ai::Dictionary > | dictionary () |
Gets the built-in document data dictionary object for the current document. | |
AIDocumentHandle | aiDocumentHandle () const |
Gets the document handle around which the target object is wrapped. | |
PlatformDocWindowPtr | platformWindow () const |
Gets the platform-specific window handle for the document. | |
std::string | filePath () const |
Gets the complete path to the current document. | |
std::string | fileName () const |
Gets the name of the current document. | |
ArtboardRect | maxBounds () const |
Gets the max bounds rect for the current document. | |
double | scale () const |
Gets the scale of the current doc. | |
RulerUnits | rulerUnits () const |
Gets the ruler units for the current document. | |
std::unique_ptr< Setup > | setup () const |
Gets the setup options for the current document. | |
bool | hasTextFocus () const |
Gets whether the current document is in text editing mode. | |
std::unique_ptr< TextStory > | focusedText () const |
Gets the story that has editing focus (i.e. has some selected range) | |
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. | |
void | loseTextFocus () |
Ends text editing mode for the current document. | |
std::unique_ptr< TextRangeSet > | selectedText () const |
Gets the set of selected text ranges for the current document. | |
bool | modified () const |
Gets whether the current document has been modified. | |
void | setModified (const bool mod_) |
Sets whether the current document is in a modified state. | |
void | sync () const |
Updates cached artwork properties for the current document. | |
void | redraw () const |
Forces the art in the current document to be redrawn. | |
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. | |
bool | save () const |
Saves the current document, prompting the user if it has not been saved before. | |
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) | |
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) | |
bool | close () const |
Closes the current document. | |
void | undo () const |
Undoes the most recent undoable transaction for the current document (same as the user using the undo menu item) | |
void | redo () const |
Redoes the most recent redoable transaction for the current document (same as the user using the redo menu item) | |
void | cut () |
Performs a cut operation, removing any selected art objects from the document and placing them in the clipboard. | |
void | copy () |
Performs a copy operation, placing any selected art objects from the current document in the clipboard. | |
void | paste () |
Pastes the contents of the clipboard on the current document. | |
bool | anyArtSelected () const |
Gets whether any art is selected at all in the document. | |
ArtVector | selectedArt () const |
Gets a vector of all currently selected art in the document. | |
void | deselectAllArt () const |
Deselects all currently selected art. | |
ArtVector | matchingArt (const MatchArtSpecVector &specs_) const |
Gets a vector of art in the document whose specs match those given. | |
ArtVector | artOfType (const MatchArtType type_) const |
Gets a vector of art in the document whose type matches the given type. | |
PathStyle | selectedArtPathStyle () const |
Gets the path style of the currently selected art in the document. | |
bool | selectedArtPathStyle (PathStyle &style__, PathStyle::Map &map__) const |
Gets the path style and map of the currently selected art in the document. | |
void | setSelectedArtPathStyle (const PathStyle &style_) |
Sets the path style of the currently selected art in the document. | |
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. | |
uint32_t | viewCount () const |
Gets a count of the views in the current document. | |
std::unique_ptr< DocumentView > | viewAtIndex (const uint32_t index_) const |
Gets a given document view, by its index, in the current document. | |
std::unique_ptr< DocumentView > | currentView () const |
Gets the current view for the current document. | |
uint32_t | layerCount () const |
Gets a count of the layers in the current document. | |
std::unique_ptr< Layer > | firstLayer () const |
Gets the first layer in the list in the current document. | |
std::unique_ptr< Layer > | lastLayer () const |
Gets the last layer in the list in the current document. | |
std::unique_ptr< Layer > | layerByTitle (const std::string &title_) const |
Gets a given layer, by its name, in the current document (case-insensitive) | |
std::unique_ptr< Layer > | layerAtIndex (const uint32_t index_) const |
Gets a given layer, by its index, in the current document. | |
std::unique_ptr< Layer > | currentLayer () const |
Gets the currently selected layer of the current document. | |
void | setCurrentLayer (const Layer &layer_) |
Sets the currently selected layer in the current document. | |
bool | inIsolationMode () const |
Gets whether the current document is in isolation mode. | |
std::unique_ptr< Art > | isolatedArt () const |
Gets the currently isolated art. | |
bool | enterIsolationMode (const Art &art_, const bool hideOtherArt_) |
Enters isolation mode of the given art object or one of its parents. | |
void | exitIsolationMode () const |
Ends isolation mode in the current document. | |
bool | inPatternEditingMode () const |
Gets whether the current document is in pattern editing mode (similar to isolation mode, but for editing a pattern in-place) | |
bool | enterPatternEditingMode (const Pattern &toEdit_) |
Enters pattern editing mode for the current document. | |
bool | applyPatternEditingModeChanges (const Pattern &editPatt_) |
Ends pattern editing mode, applying the changes made for the given pattern. | |
void | exitPatternEditingMode () const |
Ends pattern editing mode in the current document, discarding any changes made to the pattern. | |
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) | |
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. | |
bool | applySymbolEditingModeChanges (const Symbol &editSym_) |
Ends symbol editing mode, applying the changes made for the given symbol prototype to the symbol source art. | |
void | exitSymbolEditingMode () const |
Ends symbol editing mode in the current document, discarding any changes made to the symbol. | |
uint32_t | artboardCount () const |
Gets the number of artboards in the document. | |
std::unique_ptr< Artboard > | artboardByTitle (const std::string &title_) const |
Gets a given artboard, by its name, in the current document (case-insensitive) | |
std::unique_ptr< Artboard > | artboardAtIndex (const uint32_t index_) const |
Gets a given artboard, by its index, in the current document. | |
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. | |
std::unique_ptr< Artboard > | currentArtboard () const |
Gets the current (active) artboard in the document. | |
void | setCurrentArtboard (const Artboard &artboard_) |
Sets the currently selected artboard in the current document. | |
uint32_t | artStyleCount () const |
Gets the number of art styles in the document. | |
std::unique_ptr< ArtStyle > | artStyleAtIndex (const uint32_t index_) const |
Gets a given art style, by its index, in the current doc. | |
uint32_t | patternCount () const |
Gets the number of patterns in the document. | |
std::unique_ptr< Pattern > | patternAtIndex (const uint32_t index_) const |
Gets a given pattern, by its index, in the current doc. | |
uint32_t | symbolDefCount () const |
Gets the number of symbol definitions in the document. | |
std::unique_ptr< Symbol > | symbolDefAtIndex (const uint32_t index_) const |
Gets a given symbol definition, by its index, in the current doc. | |
Grid *const | grid () const |
Gets the grid object for the current document. | |
DocumentColorModel | colorModel () const |
Gets the color model for the current document. | |
PathStyle | defaultPathStyle () const |
Retrieves the default path style that tools should use when creating new objects other than text objects. | |
void | setDefaultPathStyle (const PathStyle &style_) |
Sets the default path style that tools should use when creating new objects other than text objects. | |
PathStyle | defaultTextStyle () const |
Retrieves the default path style that tools should use when creating text objects. | |
void | setDefaultTextStyle (const PathStyle &style_) |
Sets the default path style that tools should use when creating text objects. | |
std::unique_ptr< Font > | currentFont () const |
Gets the current font for the document. | |
void | setCurrentFont (const Font &font_) |
Sets the current font for the document. | |
ArtVector | artAtPoint (const ArtboardPoint &pt_, const HitRequest request_, const double tolerance_=2.0, const bool adjustToZoom_=true) const |
Gets a vector of all art found at a given point on the document. | |
Friends | |
class | Illustrator |
Current (focused) document class to allow for metadata access, updating, dictionary access, selected art access, layer access, etc.
AIDocumentHandle hdi::core::CurrentDocument::aiDocumentHandle | ( | ) | const |
Gets the document handle around which the target object is wrapped.
bool hdi::core::CurrentDocument::anyArtSelected | ( | ) | const |
Gets whether any art is selected at all in the document.
bool hdi::core::CurrentDocument::applyPatternEditingModeChanges | ( | const Pattern & | editPatt_ | ) |
Ends pattern editing mode, applying the changes made for the given pattern.
editPatt_ | The pattern currently being edited |
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.
editSym_ | The symbol currently being edited |
ArtVector hdi::core::CurrentDocument::artAtPoint | ( | const ArtboardPoint & | pt_, |
const HitRequest | request_, | ||
const double | tolerance_ = 2.0 , |
||
const bool | adjustToZoom_ = true |
||
) | const |
Gets a vector of all art found at a given point on the document.
pt_ | Point at which to check for art |
request_ | As art is found with hit requests, this specifies what art to look for |
tolerance_ | Point radius around pt_ in which a hit is valid |
adjustToZoom_ | Adjust the tolerance_ argument to take document zoom into account |
std::unique_ptr< Artboard > hdi::core::CurrentDocument::artboardAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given artboard, by its index, in the current document.
index_ | Index number of the artboard in question |
std::unique_ptr< Artboard > hdi::core::CurrentDocument::artboardByTitle | ( | const std::string & | title_ | ) | const |
Gets a given artboard, by its name, in the current document (case-insensitive)
title_ | Title of the artboard in question, as UTF-8 |
uint32_t hdi::core::CurrentDocument::artboardCount | ( | ) | const |
Gets the number of artboards in the document.
ArtVector hdi::core::CurrentDocument::artOfType | ( | const MatchArtType | type_ | ) | const |
Gets a vector of art in the document whose type matches the given type.
type_ | Logical OR of types of art to find |
std::unique_ptr< ArtStyle > hdi::core::CurrentDocument::artStyleAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given art style, by its index, in the current doc.
index_ | Index number of the style in question |
uint32_t hdi::core::CurrentDocument::artStyleCount | ( | ) | const |
Gets the number of art styles in the document.
bool hdi::core::CurrentDocument::close | ( | ) | const |
Closes the current document.
DocumentColorModel hdi::core::CurrentDocument::colorModel | ( | ) | const |
Gets the color model for the current document.
void hdi::core::CurrentDocument::copy | ( | ) |
Performs a copy operation, placing any selected art objects from the current document in the clipboard.
std::unique_ptr< Artboard > hdi::core::CurrentDocument::currentArtboard | ( | ) | const |
Gets the current (active) artboard in the document.
std::unique_ptr< Font > hdi::core::CurrentDocument::currentFont | ( | ) | const |
Gets the current font for the document.
std::unique_ptr< Layer > hdi::core::CurrentDocument::currentLayer | ( | ) | const |
Gets the currently selected layer of the current document.
std::unique_ptr< DocumentView > hdi::core::CurrentDocument::currentView | ( | ) | const |
Gets the current view for the current document.
void hdi::core::CurrentDocument::cut | ( | ) |
Performs a cut operation, removing any selected art objects from the document and placing them in the clipboard.
PathStyle hdi::core::CurrentDocument::defaultPathStyle | ( | ) | const |
Retrieves the default path style that tools should use when creating new objects other than text objects.
PathStyle hdi::core::CurrentDocument::defaultTextStyle | ( | ) | const |
Retrieves the default path style that tools should use when creating text objects.
void hdi::core::CurrentDocument::deselectAllArt | ( | ) | const |
Deselects all currently selected art.
std::unique_ptr< ai::Dictionary > hdi::core::CurrentDocument::dictionary | ( | ) |
Gets the built-in document data 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.
art_ | Art to be isolated |
hideOtherArt_ | true to make non-isolated invisible, false to dim it instead |
bool hdi::core::CurrentDocument::enterPatternEditingMode | ( | const Pattern & | toEdit_ | ) |
Enters pattern editing mode for the current document.
toEdit_ | The pattern to be edited |
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.
toEdit_ | The symbol to be edited |
inst_ | An optional instance of the symbol |
void hdi::core::CurrentDocument::exitIsolationMode | ( | ) | const |
Ends isolation mode in the current document.
void hdi::core::CurrentDocument::exitPatternEditingMode | ( | ) | const |
Ends pattern editing mode in the current document, discarding any changes made to the pattern.
void hdi::core::CurrentDocument::exitSymbolEditingMode | ( | ) | const |
Ends symbol editing mode in the current document, discarding any changes made to the symbol.
std::string hdi::core::CurrentDocument::fileName | ( | ) | const |
Gets the name of the current document.
std::string hdi::core::CurrentDocument::filePath | ( | ) | const |
Gets the complete path to the current document.
std::unique_ptr< Layer > hdi::core::CurrentDocument::firstLayer | ( | ) | const |
Gets the first layer in the list in the current document.
std::unique_ptr< TextStory > hdi::core::CurrentDocument::focusedText | ( | ) | const |
Gets the story that has editing focus (i.e. has some selected range)
Grid *const hdi::core::CurrentDocument::grid | ( | ) | const |
Gets the grid object for the current document.
bool hdi::core::CurrentDocument::hasTextFocus | ( | ) | const |
Gets whether the current document is in text editing mode.
bool hdi::core::CurrentDocument::inIsolationMode | ( | ) | const |
Gets whether the current document is in isolation mode.
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)
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.
index_ | Index at which to create the new artboard |
ab__ | Return-by-reference for the new Artboard object at the specified index |
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)
std::unique_ptr< Art > hdi::core::CurrentDocument::isolatedArt | ( | ) | const |
std::unique_ptr< Layer > hdi::core::CurrentDocument::lastLayer | ( | ) | const |
Gets the last layer in the list in the current document.
std::unique_ptr< Layer > hdi::core::CurrentDocument::layerAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given layer, by its index, in the current document.
index_ | Index number of the layer in question |
std::unique_ptr< Layer > hdi::core::CurrentDocument::layerByTitle | ( | const std::string & | title_ | ) | const |
Gets a given layer, by its name, in the current document (case-insensitive)
title_ | Title of the layer in question, as UTF-8 |
uint32_t hdi::core::CurrentDocument::layerCount | ( | ) | const |
Gets a count of the layers in the current document.
void hdi::core::CurrentDocument::loseTextFocus | ( | ) |
Ends text editing mode for the current document.
ArtVector hdi::core::CurrentDocument::matchingArt | ( | const MatchArtSpecVector & | specs_ | ) | const |
Gets a vector of art in the document whose specs match those given.
specs_ | Vector of match specifications |
ArtboardRect hdi::core::CurrentDocument::maxBounds | ( | ) | const |
Gets the max bounds rect for the current document.
bool hdi::core::CurrentDocument::modified | ( | ) | const |
Gets whether the current document has been modified.
void hdi::core::CurrentDocument::paste | ( | ) |
Pastes the contents of the clipboard on the current document.
std::unique_ptr< Pattern > hdi::core::CurrentDocument::patternAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given pattern, by its index, in the current doc.
index_ | Index number of the pattern in question |
uint32_t hdi::core::CurrentDocument::patternCount | ( | ) | const |
Gets the number of patterns in the document.
PlatformDocWindowPtr hdi::core::CurrentDocument::platformWindow | ( | ) | const |
Gets the platform-specific window handle for the document.
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)
void hdi::core::CurrentDocument::redraw | ( | ) | const |
Forces the art in the current document to be redrawn.
RulerUnits hdi::core::CurrentDocument::rulerUnits | ( | ) | const |
Gets the ruler units for the current document.
bool hdi::core::CurrentDocument::save | ( | ) | const |
Saves the current document, prompting the user if it has not been saved before.
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)
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 |
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)
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 |
double hdi::core::CurrentDocument::scale | ( | ) | const |
Gets the scale of the current doc.
ArtVector hdi::core::CurrentDocument::selectedArt | ( | ) | const |
Gets a vector of all currently selected art in the document.
PathStyle hdi::core::CurrentDocument::selectedArtPathStyle | ( | ) | const |
Gets the path style of the currently selected art in the document.
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.
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) |
std::unique_ptr< TextRangeSet > hdi::core::CurrentDocument::selectedText | ( | ) | const |
Gets the set of selected text ranges for the current document.
void hdi::core::CurrentDocument::setCurrentArtboard | ( | const Artboard & | artboard_ | ) |
Sets the currently selected artboard in the current document.
artboard_ | The artboard to select |
void hdi::core::CurrentDocument::setCurrentFont | ( | const Font & | font_ | ) |
Sets the current font for the document.
font_ | New font object for the document |
void hdi::core::CurrentDocument::setCurrentLayer | ( | const Layer & | layer_ | ) |
Sets the currently selected layer in the current document.
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.
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.
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.
story_ | Story to put into editing mode |
void hdi::core::CurrentDocument::setModified | ( | const bool | mod_ | ) |
Sets whether the current document is in a modified state.
mod_ | true to put the document in a modified state, false otherwise |
void hdi::core::CurrentDocument::setSelectedArtPathStyle | ( | const PathStyle & | style_ | ) |
Sets the path style of the currently selected art in the document.
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.
style_ | New path styling for the currently selected art |
map_ | Style map, indicating which path style properties are fully known (or unknown) |
std::unique_ptr< Setup > hdi::core::CurrentDocument::setup | ( | ) | const |
Gets the setup options for the current document.
std::unique_ptr< Symbol > hdi::core::CurrentDocument::symbolDefAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given symbol definition, by its index, in the current doc.
index_ | Index number of the symbol def in question |
uint32_t hdi::core::CurrentDocument::symbolDefCount | ( | ) | const |
Gets the number of symbol definitions in the document.
void hdi::core::CurrentDocument::sync | ( | ) | const |
Updates cached artwork properties for the current document.
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.
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)
std::unique_ptr< DocumentView > hdi::core::CurrentDocument::viewAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a given document view, by its index, in the current document.
index_ | Index number of the document view in question |
uint32_t hdi::core::CurrentDocument::viewCount | ( | ) | const |
Gets a count of the views in the current document.