Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
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. More...
 
 Document (const Document &doc_)
 Document copy constructor. More...
 
 Document (const AIDocumentHandle aiDoc_)
 Constructs a new Document object from an AIDocumentHandle. More...
 
 Document (const std::string &preset_, const bool showDialog_)
 Creates a new document, and makes it current, from a startup preset. More...
 
 Document (const Preset &preset_, const bool showDialog_)
 Creates a new document, and makes it current, from new document parameters. More...
 
virtual ~Document ()
 Document destructor. More...
 
virtual Documentoperator= (const Document &rhs_)
 Assigns one Document object to another. More...
 
virtual AIDocumentHandle aiDocumentHandle () const
 Gets the document handle around which the target object is wrapped. More...
 
virtual bool isEmpty () const
 Gets whether the target Document object is empty (constructed with the default ctor) More...
 
virtual void save () const
 Saves the target document. More...
 
virtual void close () const
 Closes the target document. More...
 
virtual void activate () const
 Activates (makes current) the target document. More...
 
virtual void print (const bool showDialog_) const
 Prints the target document. More...
 
virtual std::string url () const
 Gets the document URL. More...
 
virtual bool exists () const
 Gets whether the document exists (is open or in the clipboard) More...
 
virtual bool operator== (const Document &rhs_) const
 Checks whether one Document object represents the same Illustrator document as another. More...
 
virtual bool operator!= (const Document &rhs_) const
 Checks whether one Document object does not represent the same Illustrator document as another. 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 target 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 target doc. More...
 

Friends

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

Detailed Description

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

Constructor & Destructor Documentation

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 Illustrator 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)
hdi::core::Document::Document ( const Document doc_)

Document copy constructor.

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

Document destructor.

Author
GW
Date
08/2013

Member Function Documentation

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

Activates (makes current) the target document.

Author
GW
Date
08/2013
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.
std::auto_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
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
virtual void hdi::core::Document::close ( ) const
virtual

Closes the target document.

Author
GW
Date
08/2013
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
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
virtual bool hdi::core::Document::operator!= ( const Document rhs_) const
virtual

Checks whether one Document object does not represent the same Illustrator 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
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
virtual bool hdi::core::Document::operator== ( const Document rhs_) const
virtual

Checks whether one Document object represents the same Illustrator 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
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
virtual void hdi::core::Document::save ( ) const
virtual

Saves the target document.

Author
GW
Date
08/2013
std::auto_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
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
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