MM Developer's Guide
MM Interfaces | MM Methods | MM Types and Misc API


IMoaMmPropertyReference



Interface ID: IID_IMoaMmPropertyReference
Pointer type: PIMoaMmPropertyReference
Inheritance: IMoaUnknown
Header file: mmipref.h

Description

The ImoaMmPropertyReference methods provide a way for a Director Object inspector to get information on the actual properties (not just their values) that your Xtra implements. For your Xtra to be compatible with the Object inspector, your Xtra needs to provide these interfaces.

Methods

Inspection Methods

The following methods provide information on the actual properties, as opposed to the values of the properties, implemented by the interface. The idea is to support an Object inspector that can query the object for the property supported.

Note: Director does not call these methods. They are reserved for future use.

GetPropCount()
GetPropNameByIndex()
GetPropTypeByIndex()

Basic Property Access Methods

The following methods provide basic property access: getting and setting properties and index properties.
GetCount()
GetProp()
SetProp()

Extended Property Access Methods

The following methods allow for cascaded property references and put-into/before/after functionality. Return kMoaMmErr_AccessNotSupported if you do not want to support these capabilities.
AccessPropRef()
GetContents()
SetContents()
SetContentsBefore()
SetContentsAfter()
CallHandler()

AccessPropRef()

Syntax

AccessPropRef(PIMoaMmPropertyReference This,
ConstPMoaMmValue selfRef,
MoaMmSymbol propName,
MoaLong indexCount,
ConstPMoaMmValue pIndexValues,
PMoaMmValue pResult)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

selfRef
ConstPMoaMmValue  The property reference object, as a Lingo value. Assign to pResult and AddRef to return self.

propName
MoaMmSymbol  The property name to look up

indexCount
MoaLong  The number of indices. Specify 0, 1, or 2.

pIndexValues
ConstPMoaMmValue  An array of indices

pResult
PMoaMmValue  Optional return value. To return a new property reference Lingo object, use IMoaMmPropReferenceValue::PropReferenceToValue.

Returns

MoaError:

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported If your Xtra does not support cascaded property access, return this.

Description

This method sets up a reference to a set of hierarchical properties. A property name and (optionally) index values may be specified. A cascaded index property reference series will begin and continue with AccessPropRef calls, up to the last access which will be any of GetProp, SetProp, SetContents, SetBefore, or SetAfter.

Examples

put x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.GetProp( propName=foo, indexCount=0 )
put x.sel[33].foo[10]
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10} )
set x.sel[33].foo[9..11] = "Done!"
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.SetProp( propName=#foo, indexCount=2, pIndexValues={9,11}, pNewValue="Done!" )

CallHandler()

Syntax

CallHandler(PIMoaMmPropertyReference This,
PMoaMmCallInfo callPtr)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

callPtr
PMoaMmCallInfo  

Returns

MoaError:

kMoaMmErr_FunctionNotFound If you do not support the handler call.

Description

This method lets you implement what your Xtra does when it is used as a Lingo handler.

Examples

x.sel[1].goDown(99)
--> AccesProp( propName=#sel, indexCount=1, pIndexValues={1})
--> CallHandlers( callPtr->nargs=2, args={instance, 99} )

GetContents()

Syntax

GetContents(PIMoaMmPropertyReference This,
ConstPMoaMmValue selfRef,
PMoaMmValue pResult)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

selfRef
ConstPMoaMmValue  The property reference object, as a Lingo value. Assign to pResult and AddRef to return self.

pResult
PMoaMmValue  The return value

Returns

MoaError

Description

This method returns the contents of a property reference. It is issued when index property reference is used with the put command.

Note: This method is not used by Director 7 or eariler. It is reserved for future versions.

Examples

put "Banana" into x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )

GetCount()

Syntax

GetCount(PIMoaMmPropertyReference This,
MoaMmSymbol propName,
MoaLong * pCount)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

propName
MoaMmSymbol  The name of the property to look up

pCount
MoaLong *  The return count

Returns

MoaError:

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported The property is not countable.

Description

This method returns the number of "chunks" for the given propName.

Examples

put x.word.count
--> i.GetCount(propName=#word).

GetProp()

Syntax

GetProp(PIMoaMmPropertyReference This,
ConstPMoaMmValue selfRef,
MoaMmSymbol propName,
MoaLong indexCount,
ConstPMoaMmValue pIndexValues,
PMoaMmValue pResult)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

selfRef
ConstPMoaMmValue  The property reference object, as a Lingo value. Assign this to pResult and AddRef to return the same property reference. Use this parameter to support properties that are further references as opposed to final values.

propName
MoaMmSymbol  The property name to look up

indexCount
MoaLong  The number of indices. Specify 0, 1, or 2.

pIndexValues
ConstPMoaMmValue  An array of indices

pResult
PMoaMmValue  The return value

Returns

MoaError:

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported If your Xtra does not support property access, then return this. (If you do not support indexCount values greater than 0, for example.)

Description

This method retrieves the value of a property. A property name and (optionally) index values may be specified.

Examples

put x.foo
--> i.GetProp( propName=foo, indexCount=0 )
put x.foo[10]
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10} )
put x.foo[9..11]
--> i.GetProp( propName=#foo, indexCount=2, pIndexValues={9,11} )

GetPropCount()

Syntax

GetPropCount(PIMoaMmPropertyReference This,
MoaLong * pCount)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

pCount
MoaLong *  

Returns

MoaError

GetPropNameByIndex()

Syntax

GetPropNameByIndex(PIMoaMmPropertyReference This,
MoaLong index,
PMoaMmSymbol pSymbol)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

index
MoaLong  

pSymbol
PMoaMmSymbol  

Returns

MoaError

GetPropTypeByIndex()

Syntax

GetPropTypeByIndex(PIMoaMmPropertyReference This,
MoaLong index,
PMoaMmValue pType)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

index
MoaLong  

pType
PMoaMmValue  

Returns

MoaError

SetContents()

Syntax

SetContents(PIMoaMmPropertyReference This,
ConstPMoaMmValue selfRef,
PMoaMmValue pResult)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

selfRef
ConstPMoaMmValue  The new value to stuff into the target

pResult
PMoaMmValue  

Returns

MoaError

Description

This method is issued when index property reference is used with the put-into command.

Examples

put "Banana" into x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.SetContents( pNewValue="Banana" )

SetContentsAfter()

Syntax

SetContentsAfter(PIMoaMmPropertyReference This,
PMoaMmValue pNewValue)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

pNewValue
PMoaMmValue  The new value to stuff into the target

Returns

MoaError

Description

This method is issued when index property reference is used with the put-after command.

Examples

put "Banana" before x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.SetContents( pNewValue="Banana" )

SetContentsBefore()

Syntax

SetContentsBefore(PIMoaMmPropertyReference This,
PMoaMmValue pNewValue)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

pNewValue
PMoaMmValue  The new value to stuff into the target

Returns

MoaError

Description

This method is issued when index property reference is used with the put-before command.

Examples

put "Banana" before x.sel[33].foo
--> i.AccessProp(propName=#sel, indexCount=1, pIndexValues={33} )
--> i.SetContents( pNewValue="Banana" )

SetProp()

Syntax

SetProp(PIMoaMmPropertyReference This,
MoaMmSymbol propName,
MoaLong indexCount,
ConstPMoaMmValue pIndexValues,
ConstPMoaMmValue pNewValue)

Parameters

This
Pointer to the IMoaMmPropertyReference interface

propName
MoaMmSymbol  The property name to look up

indexCount
MoaLong  The number of indices. Specify 0, 1, or 2.

pIndexValues
ConstPMoaMmValue  An array of indices

pNewValue
ConstPMoaMmValue  The new value to assign

Returns

MoaError:

kMoaMmErr_PropertyNotFound The property is not found.
kMoaMmErr_AccessNotSupported If your Xtra does not support property access, then return this. (If you do not support indexCount values greater than 0, for example.)
kMoaMmErr_CannotSetProperty Set not allowed on specified property.

Description

This method assigns a value to a property or range within a property. A property name and (optionally) index values may be specified.

Examples

set x.foo = 99
--> i.SetProp( propName=foo, indexCount=0, pNewValue=99 )
set x.foo[10] = 99
--> i.GetProp( propName=#foo, indexCount=1, pIndexValues={10}, pNewValue=99 )
set x.foo[9..11] = 123
--> i.GetProp( propName=#foo, indexCount=2, pIndexValues={9,11}, pNewValue=123 )

Copyright © 1995-2007 Adobe Macromedia Software LLC, Inc.