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

Allows one to interact with a document and its metadata (differs from CurrentDocument class) More...

#include <hdicoreDocument.h>

Classes

class  Preset
 Represents options when creating a new Illustrator document. More...
 

Public Member Functions

 Document ()
 Constructs an empty Document object.
 
 Document (const Document &doc_)
 Document copy constructor.
 
 Document (const AIDocumentHandle aiDoc_)
 Constructs a new Document object from an AIDocumentHandle.
 
 Document (const std::string &preset_, const bool showDialog_)
 Creates a new document, and makes it current, from a startup preset.
 
 Document (const Preset &preset_, const bool showDialog_)
 Creates a new document, and makes it current, from new document parameters.
 
virtual ~Document ()
 Document destructor.
 
virtual Documentoperator= (const Document &rhs_)
 Assigns one Document object to another.
 
virtual AIDocumentHandle aiDocumentHandle () const
 Gets the document handle around which the target object is wrapped.
 
virtual bool isEmpty () const
 Gets whether the target Document object is empty (constructed with the default ctor)
 
virtual void save () const
 Saves the target document.
 
virtual void close () const
 Closes the target document.
 
virtual void activate () const
 Activates (makes current) the target document.
 
virtual void print (const bool showDialog_) const
 Prints the target document.
 
virtual std::string url () const
 Gets the document URL.
 
virtual bool exists () const
 Gets whether the document exists (is open or in the clipboard)
 
virtual bool operator== (const Document &rhs_) const
 Checks whether one Document object represents the same document as another.
 
virtual bool operator!= (const Document &rhs_) const
 Checks whether one Document object does not represent the same document as another.
 
uint32_t artStyleCount () const
 Gets the number of art styles in the document.
 
std::unique_ptr< ArtStyleartStyleAtIndex (const uint32_t index_) const
 Gets a given art style, by its index, in the target doc.
 
uint32_t symbolDefCount () const
 Gets the number of symbol definitions in the document.
 
std::unique_ptr< SymbolsymbolDefAtIndex (const uint32_t index_) const
 Gets a given symbol definition, by its index, in the target doc.
 

Friends

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

Detailed Description

Allows one to interact with a document and its metadata (differs from CurrentDocument class)

Constructor & Destructor Documentation

◆ Document() [1/5]

hdi::core::Document::Document ( )

Constructs an empty Document object.

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

◆ Document() [2/5]

hdi::core::Document::Document ( const Document doc_)

Document copy constructor.

Author
GW
Date
08/2013
Parameters
doc_Existing Document object to copy

◆ Document() [3/5]

hdi::core::Document::Document ( const AIDocumentHandle  aiDoc_)

Constructs a new Document object from an AIDocumentHandle.

Author
GW
Date
08/2015
Parameters
aiDoc_Raw Illustrator AIDocumentHandle

◆ Document() [4/5]

hdi::core::Document::Document ( const std::string &  preset_,
const bool  showDialog_ 
)

Creates a new document, and makes it current, from a startup preset.

Author
GW
Date
08/2013
Parameters
preset_Name of a startup preset to use when creating the new document, as UTF-8
showDialog_When true, shows the new document dialog to query user for parameters

◆ Document() [5/5]

hdi::core::Document::Document ( const Preset preset_,
const bool  showDialog_ 
)

Creates a new document, and makes it current, from new document parameters.

Author
GW
Date
08/2013
Parameters
preset_Parameters for the new document
showDialog_When true, shows the new document dialog to query user for parameters

◆ ~Document()

virtual hdi::core::Document::~Document ( )
virtual

Document destructor.

Author
GW
Date
08/2013

Member Function Documentation

◆ activate()

virtual void hdi::core::Document::activate ( ) const
virtual

Activates (makes current) the target document.

Author
GW
Date
08/2013

◆ aiDocumentHandle()

virtual AIDocumentHandle hdi::core::Document::aiDocumentHandle ( ) const
virtual

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.

◆ artStyleAtIndex()

std::unique_ptr< ArtStyle > hdi::core::Document::artStyleAtIndex ( const uint32_t  index_) const

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

Author
GW
Date
11/2013
Parameters
index_Index number of the style in question
Returns
The ArtStyle object with the specified index

◆ artStyleCount()

uint32_t hdi::core::Document::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 target document

◆ close()

virtual void hdi::core::Document::close ( ) const
virtual

Closes the target document.

Author
GW
Date
08/2013

◆ exists()

virtual bool hdi::core::Document::exists ( ) const
virtual

Gets whether the document exists (is open or in the clipboard)

Author
GW
Date
08/2013
Returns
true if the document exists, or false if it is closed

◆ isEmpty()

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

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

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

◆ operator!=()

virtual bool hdi::core::Document::operator!= ( const Document rhs_) const
virtual

Checks whether one Document object does not represent the same document as another.

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

◆ operator=()

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

Assigns one Document object to another.

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

◆ operator==()

virtual bool hdi::core::Document::operator== ( const Document rhs_) const
virtual

Checks whether one Document object represents the same document as another.

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

◆ print()

virtual void hdi::core::Document::print ( const bool  showDialog_) const
virtual

Prints the target document.

Author
GW
Date
08/2013
Parameters
showDialog_When true, shows the print dialog to query the user for parameters

◆ save()

virtual void hdi::core::Document::save ( ) const
virtual

Saves the target document.

Author
GW
Date
08/2013

◆ symbolDefAtIndex()

std::unique_ptr< Symbol > hdi::core::Document::symbolDefAtIndex ( const uint32_t  index_) const

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

Author
GW
Date
11/2013
Parameters
index_Index number of the symbol def in question
Returns
The Symbol object with the specified index

◆ symbolDefCount()

uint32_t hdi::core::Document::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 target document

◆ url()

virtual std::string hdi::core::Document::url ( ) const
virtual

Gets the document URL.

Author
GW
Date
08/2013
Returns
The URL (location) of the document, as UTF-8