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

#include <IScriptArgs.h>

Inheritance diagram for IScriptArgs:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISCRIPTARGS }
 

Public Member Functions

virtual void Set (const PMString &name, const PMString &value)=0
 
virtual PMString Get (const PMString &name) const =0
 
virtual bool IsDefined (const PMString &name) const =0
 
virtual void Clear ()=0
 
virtual void Save ()=0
 
virtual ErrorCode Restore ()=0
 
virtual const adobe::vector
< PMString
GetParameters ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Set and get parameters that are accessible from scripts. There is a concept of a current context, where a context is simply a set of script parameters. When you save the current context, a new context is created and the existing one pushed on a stack of saved contexts. When a context is restored, the existing one is replaced by the top context on the saved context stack. This makes it easy to make nested calls to scripts with parameters. SaveContext/RestoreContext should be used in pairs.

Member Function Documentation

virtual void IScriptArgs::Clear ()
pure virtual

Removes all scripting parameters, in the current context.

virtual PMString IScriptArgs::Get (const PMStringname) const
pure virtual

Get the value of a scripting parameter in the current context.

Parameters
nameof scripting parameter to get
Returns
the value of the scripting parameter.
virtual const adobe::vector<PMString> IScriptArgs::GetParameters ()
pure virtual

Get all scripting parameter in the current context.

Returns
the vector of all scripting parameters.
virtual bool IScriptArgs::IsDefined (const PMStringname) const
pure virtual

Determines whether a parameter is defined in the current context.

Parameters
nameof scripting parameter
Returns
true if the parameter is defined, otherwise false.
virtual ErrorCode IScriptArgs::Restore ()
pure virtual

Replaces the current existing context with the top context on the stack of saved contexts.

virtual void IScriptArgs::Save ()
pure virtual

Saves the current set of scripting parameters on the context stack and creates a new current context, that has no parameters set.

virtual void IScriptArgs::Set (const PMStringname,
const PMStringvalue 
)
pure virtual

Set a scripting parameter in the current context.

Parameters
nameof the parameter
valueof the parameter