InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ScriptInfo::TypeInfo Class Reference

#include <ScriptInfo.h>

Public Types

typedef object_type data_type
 

Public Member Functions

 TypeInfo (const ScriptElementID &siid=kInvalidScriptElementID, int32 length=1)
 
 TypeInfo (const TypeInfoList &variableTypes, int32 length=1)
 
void AddType (const TypeInfo &subType)
 
void SetLength (int32 length)
 
const ScriptElementIDGetType () const
 
int32 GetLength () const
 
const ScriptDataGetMinimum () const
 
const ScriptDataGetMaximum () const
 
const ScriptDataGetDefault () const
 
const TypeInfoListGetVariableTypes () const
 
const TypeInfoListGetStructFields () const
 
const PMStringGetStructFieldName () const
 
PMString GetFormattedStructFieldName (const RequestContext &context) const
 
const ObjectScriptElementGetRecordTypeObject (const RequestContext &context) const
 
bool16 HasRangeData () const
 
bool16 HasDefault () const
 
bool16 IsBaseType () const
 
bool16 IsArrayType () const
 
bool16 IsVariableType () const
 
bool16 IsStructType () const
 
bool16 IsRecordType () const
 
bool16 IsObjectType (const RequestContext &context) const
 
bool16 IsEnumType (const RequestContext &context) const
 
bool16 IsTypeDef (const RequestContext &context) const
 
bool16 IsValidType (const RequestContext &context) const
 
bool16 HasAnyValidType (const RequestContext &context) const
 
bool16 IsValidValue (const ScriptData &value, const ObjectScriptElement *) const
 
void FormatType (const ObjectScriptElement *)
 
PMString GetTypeAsString (const ObjectScriptElement *, int32 includeInfo=kIncludeRangeData) const
 
PMString GetTypeAsString (const RequestContext &context, int32 includeInfo=kIncludeRangeData) const
 
bool16 operator== (const TypeInfo &) const
 
void ReadWrite (IPMStream *s)
 

Detailed Description

TypeInfo represents the type of a property, method parameter, or method return value in a scripting DOM. Base types are defined in ScriptingID.h. Objects and Enums defined in a scripting document object model (DOM) may also be valid types.

Constructor & Destructor Documentation

ScriptInfo::TypeInfo::TypeInfo (const ScriptElementIDsiid = kInvalidScriptElementID,
int32 length = 1 
)
inline

Base type constructor

ScriptInfo::TypeInfo::TypeInfo (const TypeInfoListvariableTypes,
int32 length = 1 
)
inline

Variable type constructor

Member Function Documentation

void ScriptInfo::TypeInfo::AddType (const TypeInfosubType)

Add an additional subtype (making this a variable type)

void ScriptInfo::TypeInfo::FormatType (const ObjectScriptElement)

Revise the type in the context of the supplied object (i.e., if the specified type is kContainerObjectScriptElement or kContainerParentScriptElement).

Parameters
theobject context (may be nil)
const ScriptData& ScriptInfo::TypeInfo::GetDefault () const
inline

Get the default value

PMString ScriptInfo::TypeInfo::GetFormattedStructFieldName (const RequestContextcontext) const

Get the formatted name

Parameters
contextthe request context in which to format the name
int32 ScriptInfo::TypeInfo::GetLength () const
inline

Get the length

const ScriptData& ScriptInfo::TypeInfo::GetMaximum () const
inline

Get the maximum value

const ScriptData& ScriptInfo::TypeInfo::GetMinimum () const
inline

Get the minimum value

const ObjectScriptElement* ScriptInfo::TypeInfo::GetRecordTypeObject (const RequestContextcontext) const

For a record type, get the object that governs the property ids

Parameters
contextfor the query
Returns
the governing object's element
const PMString& ScriptInfo::TypeInfo::GetStructFieldName () const
inline

Get the name of a struct field

const TypeInfoList& ScriptInfo::TypeInfo::GetStructFields () const

Get the subtypes in a struct type

const ScriptElementID& ScriptInfo::TypeInfo::GetType (void ) const
inline

Get the type

PMString ScriptInfo::TypeInfo::GetTypeAsString (const ObjectScriptElement,
int32 includeInfo = kIncludeRangeData 
) const

Convert this type into a string representation. This is the preferred overload.

Parameters
theobject context for the conversion (must not be nil)
includeInfooptions are defined in enum TypeFormattingInfo
Returns
the string representation
PMString ScriptInfo::TypeInfo::GetTypeAsString (const RequestContextcontext,
int32 includeInfo = kIncludeRangeData 
) const

Convert this type into a string representation. Use this overload only if no ObjectScriptElement is relevant.

Parameters
contextfor the conversion
includeInfooptions are defined in enum TypeFormattingInfo
Returns
the string representation
const TypeInfoList& ScriptInfo::TypeInfo::GetVariableTypes () const

Get the subtypes in a variable type

bool16 ScriptInfo::TypeInfo::HasAnyValidType (const RequestContextcontext) const

Returns kTrue if this type is valid or, if a variable type, if ANY of its subtypes is valid

Parameters
contextfor the query
bool16 ScriptInfo::TypeInfo::HasDefault () const
inline

Returns kTrue if the type has a default value

bool16 ScriptInfo::TypeInfo::HasRangeData () const
inline

Returns kTrue if the type has a max and/or min value

bool16 ScriptInfo::TypeInfo::IsArrayType () const
inline

Returns kTrue if the length is not 1 (could be a record type)

bool16 ScriptInfo::TypeInfo::IsBaseType () const
inline

Returns kTrue if the type is valid and not an object or enum type

bool16 ScriptInfo::TypeInfo::IsEnumType (const RequestContextcontext) const

Returns kTrue if the type is a valid enum type (doesn't check variable subtypes)

Parameters
contextfor the query
bool16 ScriptInfo::TypeInfo::IsObjectType (const RequestContextcontext) const

Returns kTrue if the type is a valid object type (doesn't check variable subtypes)

Parameters
contextfor the query
bool16 ScriptInfo::TypeInfo::IsRecordType () const
inline

Returns kTrue if the type is a record type (doesn't check variable subtypes)

bool16 ScriptInfo::TypeInfo::IsStructType () const
inline

Returns kTrue if the type is a struct type

bool16 ScriptInfo::TypeInfo::IsTypeDef (const RequestContextcontext) const

Returns kTrue if the type is a valid type def (doesn't check variable subtypes)

Parameters
contextfor the query
bool16 ScriptInfo::TypeInfo::IsValidType (const RequestContextcontext) const

Returns kTrue if the type is valid or, if a variable or struct type, if ALL of its subtypes are valid

Parameters
contextfor the query
bool16 ScriptInfo::TypeInfo::IsValidValue (const ScriptDatavalue,
const ObjectScriptElement 
) const

Returns kTrue if the value is valid for this type

Parameters
valueis the value to test
theobject context for the test (must not be nil)
bool16 ScriptInfo::TypeInfo::IsVariableType () const
inline

Returns kTrue if the type is a variable type

void ScriptInfo::TypeInfo::ReadWrite (IPMStreams)

Persist this object

void ScriptInfo::TypeInfo::SetLength (int32 length)
inline

Change the length