InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
id_digpub::Object Class Referenceabstract

Public Types

enum  Type {
  kBoolean, kInteger, kLongInteger, kReal,
  kString, kFile, kDate, kDictionary,
  kArray, kInvalidType = 0xffffffff
}
 

Public Member Functions

virtual Type GetType () const =0
 
virtual ObjectPtr CreateBoolean (bool16 value) const =0
 
virtual ObjectPtr CreateInteger (int32 value) const =0
 
virtual ObjectPtr CreateLongInteger (int64 value) const =0
 
virtual ObjectPtr CreateReal (PMReal const &value) const =0
 
virtual ObjectPtr CreateString (WideString const &value) const =0
 
virtual ObjectPtr CreateFile (IDFile const &value) const =0
 
virtual ObjectPtr CreateDate (IDTime const &value) const =0
 
virtual ObjectPtr CreateDictionary () const =0
 
virtual ObjectPtr CreateArray (size_t size=0) const =0
 
virtual bool GetBoolean (bool16 &value) const =0
 
virtual bool SetBoolean (bool16 value)=0
 
virtual bool GetInteger (int32 &value) const =0
 
virtual bool SetInteger (int32 value)=0
 
virtual bool GetLongInteger (int64 &value) const =0
 
virtual bool SetLongInteger (int64 value)=0
 
virtual bool GetReal (PMReal &value) const =0
 
virtual bool SetReal (PMReal const &value)=0
 
virtual bool GetString (WideString &value) const =0
 
virtual bool SetString (WideString const &value)=0
 
virtual bool GetFile (IDFile &value) const =0
 
virtual bool SetFile (IDFile const &value)=0
 
virtual bool GetDate (IDTime &value) const =0
 
virtual bool SetDate (IDTime const &value)=0
 
virtual bool GetDictionaryKeys (K2Vector< WideString > &keys) const =0
 
virtual bool GetDictionaryValue (WideString const &key, ObjectPtr &value) const =0
 
virtual bool SetDictionaryValue (WideString const &key, ObjectPtr const &value)=0
 
virtual bool RemoveDictionaryValue (WideString const &key)=0
 
virtual bool ClearDictionary ()=0
 
virtual bool GetArraySize (size_t &size) const =0
 
virtual bool SetArraySize (size_t size)=0
 
virtual bool GetNthArrayValue (size_t index, ObjectPtr &value) const =0
 
virtual bool SetNthArrayValue (size_t index, ObjectPtr const &value)=0
 
virtual bool AppendArrayValue (ObjectPtr const &value)=0
 
bool GetBooleanValue (WideString const &key, bool16 &value) const
 
bool SetBooleanValue (WideString const &key, bool16 value)
 
bool GetIntegerValue (WideString const &key, int32 &value) const
 
bool SetIntegerValue (WideString const &key, int32 value)
 
bool GetLongIntegerValue (WideString const &key, int64 &value) const
 
bool SetLongIntegerValue (WideString const &key, int64 value)
 
bool GetRealValue (WideString const &key, PMReal &value) const
 
bool SetRealValue (WideString const &key, PMReal const &value)
 
bool GetStringValue (WideString const &key, WideString &value) const
 
bool SetStringValue (WideString const &key, WideString const &value)
 
bool GetFileValue (WideString const &key, IDFile &value) const
 
bool SetFileValue (WideString const &key, IDFile const &value)
 
bool GetDateValue (WideString const &key, IDTime &value) const
 
bool SetDateValue (WideString const &key, IDTime const &value)
 
bool GetNthArrayRealValue (size_t index, PMReal &value) const
 
bool GetNthArrayFileValue (size_t index, IDFile &value) const
 
ObjectPtr CreatePointObject (PMReal const &x, PMReal const &y) const
 
ObjectPtr CreatePMPointObject (PMPoint const &p) const
 
bool GetPMPointValue (WideString const &key, PMPoint &point) const
 
ObjectPtr CreateRectObject (PMReal const &left, PMReal const &top, PMReal const &right, PMReal const &bottom) const
 
ObjectPtr CreatePMRectObject (PMRect const &r) const
 
bool GetPMRectValue (WideString const &key, PMRect &bounds) const
 
ObjectPtr CreateAssetObject (IDFile const &file, WideString const &id, WideString const &tag=WideString()) const
 
bool GetAssetObjectValues (IDFile &file, WideString &id, WideString &tag) const
 

Member Enumeration Documentation

Member Function Documentation

virtual bool id_digpub::Object::AppendArrayValue (ObjectPtr const & value)
pure virtual

Appends a value to an array object. Fails if the object is not an array or if the value is invalid (null).

Parameters
valueThe value to be appended
Returns
true if the value was successfully appended
virtual bool id_digpub::Object::ClearDictionary ()
pure virtual

Clears a dictionary object. Fails if the object isn't a dictionary.

Returns
true if the operation was successful
virtual ObjectPtr id_digpub::Object::CreateArray (size_t size = 0) const
pure virtual

Factory method for creating an instance of an array object.

Parameters
sizeThe array's initial size
Returns
a new object instance
ObjectPtr id_digpub::Object::CreateAssetObject (IDFile const & file,
WideString const & id,
WideString const & tag = WideString() 
) const
inline

Factory method for creating an asset object. An asset is a 3-tuple comprised of a file, an ID, and a tag. The returned object is a dictionary.

Parameters
fileThe file portion of the asset
idThe asset's ID
tagThe asset's tag (optional)
Returns
the new object
virtual ObjectPtr id_digpub::Object::CreateBoolean (bool16 value) const
pure virtual

Factory method for creating an instance of a boolean object.

Parameters
valueThe object's initial value
Returns
a new object instance
virtual ObjectPtr id_digpub::Object::CreateDate (IDTime const & value) const
pure virtual

Factory method for creating an instance of a date object.

Parameters
valueThe object's initial value
Returns
a new object instance
virtual ObjectPtr id_digpub::Object::CreateDictionary () const
pure virtual

Factory method for creating an instance of a dictionary object.

Returns
a new object instance
virtual ObjectPtr id_digpub::Object::CreateFile (IDFile const & value) const
pure virtual

Factory method for creating an instance of a file object.

Parameters
valueThe object's initial value
Returns
a new object instance
virtual ObjectPtr id_digpub::Object::CreateInteger (int32 value) const
pure virtual

Factory method for creating an instance of an integer object.

Parameters
valueThe object's initial value
Returns
a new object instance
virtual ObjectPtr id_digpub::Object::CreateLongInteger (int64 value) const
pure virtual

Factory method for creating an instance of a long integer object.

Parameters
valueThe object's initial value
Returns
a new object instance
ObjectPtr id_digpub::Object::CreatePMPointObject (PMPoint const & p) const
inline

Factory method for creating an object to represent a PMPoint

Parameters
rThe point whose value is used to create the object
Returns
the new object instance
ObjectPtr id_digpub::Object::CreatePMRectObject (PMRect const & r) const
inline

Factory method for creating an object to represent a PMRect

Parameters
rThe rectangle whose value is used to create the object
Returns
the new object instance
ObjectPtr id_digpub::Object::CreatePointObject (PMReal const & x,
PMReal const & y 
) const
inline

Factory method for creating an object to represent a PMPoint

Parameters
xThe point's x value
yThe point's y value
Returns
the new object instance
virtual ObjectPtr id_digpub::Object::CreateReal (PMReal const & value) const
pure virtual

Factory method for creating an instance of a real (floating point) object.

Parameters
valueThe object's initial value
Returns
a new object instance
ObjectPtr id_digpub::Object::CreateRectObject (PMReal const & left,
PMReal const & top,
PMReal const & right,
PMReal const & bottom 
) const
inline

Factory method for creating an object to represent a PMRect

Parameters
leftThe rectangle's left value
topThe rectangle's top value
rightThe rectangle's right value
bottomThe rectangle's bottom value
Returns
the new object instance
virtual ObjectPtr id_digpub::Object::CreateString (WideString const & value) const
pure virtual

Factory method for creating an instance of a string object.

Parameters
valueThe object's initial value
Returns
a new object instance
virtual bool id_digpub::Object::GetArraySize (size_t & size) const
pure virtual

Retrieves the size of an array object. Fails if the object is not an array.

Parameters
sizeOut param that receives the size of the array
Returns
true if the size of the array was received successfully
bool id_digpub::Object::GetAssetObjectValues (IDFilefile,
WideStringid,
WideStringtag 
) const
inline

Convenience method for retrieving the values for an asset from an object, which is assumed to be a dictionary with File and ID values. Fails if not.

Note: This assumes that the assets used by calling code require both the File and ID values. If this is not the case, you should consider simply calling yourAssetObject->GetFileValue(WideString("File"), file).

Parameters
fileOut param to receive the file portion of this asset
idOut param to receive the asset's ID
tagOut param to receive the asset's tag
Returns
true if the asset's values were successfully retrieved
virtual bool id_digpub::Object::GetBoolean (bool16 & value) const
pure virtual

Boolean getter. Assumes object is a boolean. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetBooleanValue (WideString const & key,
bool16 & value 
) const
inline

Boolean getter. Assumes object is a dictionary and the child value indexed by key is a boolean. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual bool id_digpub::Object::GetDate (IDTimevalue) const
pure virtual

Date getter. Assumes object is a date. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetDateValue (WideString const & key,
IDTimevalue 
) const
inline

Date getter. Assumes object is a dictionary and the child value indexed by key is a date. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual bool id_digpub::Object::GetDictionaryKeys (K2Vector< WideString > & keys) const
pure virtual

Retrieves the set of keys stored in the object, which is assumed to be a dictionary. Fails if object isn't a dictionary.

Parameters
keysOut param that receives the list of defined keys
Returns
true if the list of keys was retrieved successfully
virtual bool id_digpub::Object::GetDictionaryValue (WideString const & key,
ObjectPtr & value 
) const
pure virtual

Retrieves a value from a dictionary object. Fails if the key isn't defined or if the object isn't a dictionary (use GetType to distinguish).

Parameters
keyThe key whose value is to be retrieved
valueOut param to receive the object associated with key
Returns
true if the value was successfully retrieved
virtual bool id_digpub::Object::GetFile (IDFilevalue) const
pure virtual

File getter. Assumes object is a file. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetFileValue (WideString const & key,
IDFilevalue 
) const
inline

File getter. Assumes object is a dictionary and the child value indexed by key is a file. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual bool id_digpub::Object::GetInteger (int32 & value) const
pure virtual

Integer getter. Assumes object is an integer. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetIntegerValue (WideString const & key,
int32 & value 
) const
inline

Integer getter. Assumes object is a dictionary and the child value indexed by key is an integer. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual bool id_digpub::Object::GetLongInteger (int64 & value) const
pure virtual

Long integer getter. Assumes object is a long integer. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetLongIntegerValue (WideString const & key,
int64 & value 
) const
inline

Long integer getter. Assumes object is a dictionary and the child value indexed by key is a long integer. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetNthArrayFileValue (size_t index,
IDFilevalue 
) const
inline

Retrieves the nth file value from an array object. Fails if object is not an array, if index is out of range, or value at index is not a file.

Parameters
indexThe index to query
valueOut param to receive the file value
Returns
true if the value was retrieved
bool id_digpub::Object::GetNthArrayRealValue (size_t index,
PMRealvalue 
) const
inline

Retrieves the nth real (floating point) value from an array object. Fails if object is not an array, if index is out of range, or value at index is not a real.

Parameters
indexThe index to query
valueOut param to receive the real value
Returns
true if the value was retrieved
virtual bool id_digpub::Object::GetNthArrayValue (size_t index,
ObjectPtr & value 
) const
pure virtual

Retrieves the nth value in an array object. Fails if the object is not an array or if the index is invalid.

Parameters
indexThe index of the value to retrieve
valueOut param to receive the object at index
Returns
true if the value was successfully retrieved
bool id_digpub::Object::GetPMPointValue (WideString const & key,
PMPointpoint 
) const
inline

Retrieves the PMPoint value associated with a key from a dictionary. Fails if object is not a dictionary or if value at key is undefined or invalid.

Parameters
keyThe key to query
boundsOut param to receive the rectangle value
Returns
true if the rectangle was retrieved successfully
bool id_digpub::Object::GetPMRectValue (WideString const & key,
PMRectbounds 
) const
inline

Retrieves the PMRect value associated with a key from a dictionary. Fails if object is not a dictionary or if value at key is undefined or invalid.

Parameters
keyThe key to query
boundsOut param to receive the rectangle value
Returns
true if the rectangle was retrieved successfully
virtual bool id_digpub::Object::GetReal (PMRealvalue) const
pure virtual

Real getter. Assumes object is a real (floating point value). Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetRealValue (WideString const & key,
PMRealvalue 
) const
inline

Real getter. Assumes object is a dictionary and the child value indexed by key is a real (floating point value). Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual bool id_digpub::Object::GetString (WideStringvalue) const
pure virtual

String getter. Assumes object is a string. Fails if not.

Parameters
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
bool id_digpub::Object::GetStringValue (WideString const & key,
WideStringvalue 
) const
inline

String getter. Assumes object is a dictionary and the child value indexed by key is a string. Fails if not.

Parameters
keyThe key to retrieve
valueOut param to receive the object's value
Returns
true if the value was retrieved successfully
virtual Type id_digpub::Object::GetType () const
pure virtual
Returns
the type of the object
virtual bool id_digpub::Object::RemoveDictionaryValue (WideString const & key)
pure virtual

Removes a key from a dictionary object. Fails if the object isn't a dictionary.

Note: Return value does not reflect whether a key was actually removed, only if the operation itself was successful (i.e., this object is a dictioanry)

Parameters
keyThe key to remove
Returns
true if the operation was successful
virtual bool id_digpub::Object::SetArraySize (size_t size)
pure virtual

Sets the size of an array object. Fails if the object is not an array.

Note: If the array is made larger, it is padded with invalid (null) objects. These are not considered valid objects and care should be exercised when doing this. Recommended use is to immediately fill open slots with valid values or to use the simpler AppendArrayValue method instead.

Parameters
sizeThe new size of the array
Returns
true if the array was successfully resized
virtual bool id_digpub::Object::SetBoolean (bool16 value)
pure virtual

Boolean setter. Assumes object is a boolean. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetBooleanValue (WideString const & key,
bool16 value 
)
inline

Boolean setter. Assumes object is a dictionary. Fails if not.

Note: If a boolean value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetDate (IDTime const & value)
pure virtual

Date setter. Assumes object is a date. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetDateValue (WideString const & key,
IDTime const & value 
)
inline

Date setter. Assumes object is a dictionary. Fails if not.

Note: If a date value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetDictionaryValue (WideString const & key,
ObjectPtr const & value 
)
pure virtual

Sets a value in a dictionary object. Fails if the object isn't a dictionary.

Note: Any value currently associated with key will be replaced

Parameters
keyThe key whose value is to be set
valueThe value to associate with key
Returns
true if the value was successfully set
virtual bool id_digpub::Object::SetFile (IDFile const & value)
pure virtual

File setter. Assumes object is a file. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetFileValue (WideString const & key,
IDFile const & value 
)
inline

File setter. Assumes object is a dictionary. Fails if not.

Note: If a file value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetInteger (int32 value)
pure virtual

Integer setter. Assumes object is an integer. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetIntegerValue (WideString const & key,
int32 value 
)
inline

Integer setter. Assumes object is a dictionary. Fails if not.

Note: If a integer value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetLongInteger (int64 value)
pure virtual

Long integer setter. Assumes object is a long integer. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetLongIntegerValue (WideString const & key,
int64 value 
)
inline

Long integer setter. Assumes object is a dictionary. Fails if not.

Note: If a long integer value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetNthArrayValue (size_t index,
ObjectPtr const & value 
)
pure virtual

Sets the nth value in an array object. Fails if the object is not an array, if the index is invalid, or if the value is invalid (null).

Parameters
indexThe index at which to store the value
valueThe value to be stored
Returns
true if the value was successfully set
virtual bool id_digpub::Object::SetReal (PMReal const & value)
pure virtual

Real setter. Assumes object is a real (floating point value). Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetRealValue (WideString const & key,
PMReal const & value 
)
inline

Real (floating point) setter. Assumes object is a dictionary. Fails if not.

Note: If a real value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully
virtual bool id_digpub::Object::SetString (WideString const & value)
pure virtual

String setter. Assumes object is a string. Fails if not.

Parameters
valueThe object's new value
Returns
true if the value was set successfully
bool id_digpub::Object::SetStringValue (WideString const & key,
WideString const & value 
)
inline

String setter. Assumes object is a dictionary. Fails if not.

Note: If a string value already exists under key in the dictionary, its value is replaced; otherwise a new value is created and stored.

Parameters
keyThe key to set
valueThe value to be stored
Returns
true if the value was set successfully