Programming Reference: ODBinding

# Programming Reference

## ODBinding

Class Definition File | ODBindng.idl
Class C++ Binding | ODBindng.xh

Class Hierarchy

    SOMObject
       ODObject
          ODBinding

Description

An object of the ODBinding class represents the OpenDoc binding object that performs the runtime binding of part editors to the parts in a document.

When a document is opened, the session object creates a single binding object. All parts of that document share the binding object; the document shell or a container application can obtain a reference to it by calling the session object's GetBinding method.

OpenDoc binds part editors to part data when a part is read in or when its part editor is changed. The binding object gathers information provided by the installed part editors, preferences specified by the user, and part-kind information stored with parts. It uses that information to choose an editor for each part in the document.

For more information about binding, see the chapter on OpenDoc runtime features in the OpenDoc Programming Guide.

Methods

The methods defined by the ODBinding class include:

- ChooseEditorForPart
- GetContainerSuite

Overridden Methods | There are no methods overridden by the ODBinding class.

### ChooseEditorForPart

This method chooses the editor to be used to edit the specified part.

Signature

    ODEditor ChooseEditorForPart (ODStorageUnit *thePartSU,
                                  ODType newKind)

Parameters

thePartSU (ODStorageUnit *) - input

  A reference to the part's storage unit.

newKind (ODType) - input

  The part kind of the new part being created or kODNULL if the specified part already exists.

Returns

rv (ODEditor) - returns

  An opaque, platform-specific value specifying the chosen part editor.

Remarks

This method is called by the container suite. The document shell, container applications, and parts cannot call this method.

This method chooses the appropriate editor for the specified part based on the editors that are installed on the machine and the part kind of the specified part. For a new part that is being created, the specified storage unit is empty and the newKind parameter specifies the part kind. For a part that exists, the storage unit contains the part kinds.

### GetContainerSuite

This method returns a container suite ID to be used for to instantiate a container suite by name.

Signature

    ODContainerSuite GetContainerSuite (ODContainerType containerType)

Parameters

containerType (ODContainerType) - input

  The type of the container object. This parameter can be set to an ODContainerType type.

Returns

rv (ODContainerSuite) - returns

  The container suite ID identifying the specified container suite.

[ Top | Previous | Next | Contents | Index | Documentation Homepage ]