![]() | InDesign SDK 20.5 |
#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 ScriptElementID & | GetType () const |
| int32 | GetLength () const |
| const ScriptData & | GetMinimum () const |
| const ScriptData & | GetMaximum () const |
| const ScriptData & | GetDefault () const |
| const TypeInfoList & | GetVariableTypes () const |
| const TypeInfoList & | GetStructFields () const |
| const PMString & | GetStructFieldName () const |
| PMString | GetFormattedStructFieldName (const RequestContext &context) const |
| const ObjectScriptElement * | GetRecordTypeObject (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) |
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.
| inline |
Base type constructor
| inline |
Variable type constructor
| void ScriptInfo::TypeInfo::AddType | ( | const TypeInfo & | subType | ) |
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).
| the | object context (may be nil) |
| inline |
Get the default value
| PMString ScriptInfo::TypeInfo::GetFormattedStructFieldName | ( | const RequestContext & | context | ) | const |
Get the formatted name
| context | the request context in which to format the name |
| inline |
Get the length
| inline |
Get the maximum value
| inline |
Get the minimum value
| const ObjectScriptElement* ScriptInfo::TypeInfo::GetRecordTypeObject | ( | const RequestContext & | context | ) | const |
For a record type, get the object that governs the property ids
| context | for the query |
| inline |
Get the name of a struct field
| const TypeInfoList& ScriptInfo::TypeInfo::GetStructFields | ( | ) | const |
Get the subtypes in a struct type
| 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.
| the | object context for the conversion (must not be nil) |
| includeInfo | options are defined in enum TypeFormattingInfo |
| PMString ScriptInfo::TypeInfo::GetTypeAsString | ( | const RequestContext & | context, |
| int32 | includeInfo = kIncludeRangeData | ||
| ) | const |
Convert this type into a string representation. Use this overload only if no ObjectScriptElement is relevant.
| context | for the conversion |
| includeInfo | options are defined in enum TypeFormattingInfo |
| const TypeInfoList& ScriptInfo::TypeInfo::GetVariableTypes | ( | ) | const |
Get the subtypes in a variable type
| bool16 ScriptInfo::TypeInfo::HasAnyValidType | ( | const RequestContext & | context | ) | const |
Returns kTrue if this type is valid or, if a variable type, if ANY of its subtypes is valid
| context | for the query |
| inline |
Returns kTrue if the type has a default value
| inline |
Returns kTrue if the type has a max and/or min value
| inline |
Returns kTrue if the length is not 1 (could be a record type)
| inline |
Returns kTrue if the type is valid and not an object or enum type
| bool16 ScriptInfo::TypeInfo::IsEnumType | ( | const RequestContext & | context | ) | const |
Returns kTrue if the type is a valid enum type (doesn't check variable subtypes)
| context | for the query |
| bool16 ScriptInfo::TypeInfo::IsObjectType | ( | const RequestContext & | context | ) | const |
Returns kTrue if the type is a valid object type (doesn't check variable subtypes)
| context | for the query |
| inline |
Returns kTrue if the type is a record type (doesn't check variable subtypes)
| inline |
Returns kTrue if the type is a struct type
| bool16 ScriptInfo::TypeInfo::IsTypeDef | ( | const RequestContext & | context | ) | const |
Returns kTrue if the type is a valid type def (doesn't check variable subtypes)
| context | for the query |
| bool16 ScriptInfo::TypeInfo::IsValidType | ( | const RequestContext & | context | ) | const |
Returns kTrue if the type is valid or, if a variable or struct type, if ALL of its subtypes are valid
| context | for the query |
| bool16 ScriptInfo::TypeInfo::IsValidValue | ( | const ScriptData & | value, |
| const ObjectScriptElement * | |||
| ) | const |
Returns kTrue if the value is valid for this type
| value | is the value to test |
| the | object context for the test (must not be nil) |
| inline |
Returns kTrue if the type is a variable type
| inline |
Change the length