Programming Reference: ODFocusSet

# Programming Reference

## ODFocusSet

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

Class Hierarchy

    SOMObject
       ODObject
          ODFocusSet

Description

An object of the ODFocusSet class provides grouping of focuses for activation.

A focus is a designation of ownership of a given shared resource or feature, such as the keyboard or menu bar. A frame that owns a focus receives events pertaining to that resource. Focuses can be manipulated individually or in groups called focus sets. A focus set is a list of focuses that can be obtained or released as a group. For example, if a frame wants to request ownership of keyboard and menu focuses together, it can create a focus set that includes these two focus types. If a frame requests a focus set and one or more of the focuses included in the focus set is not available, ownership of the entire focus set is denied.

Your part creates a focus set object by calling the arbitrator's CreateFocusSet method, which returns a reference to a focus set object. Frames obtain ownership of focus sets by calling the arbitrator's RequestFocusSet method.

For more information about focuses and focus sets, see the class description for ODFocusSetIterator and the chapter on user events in the OpenDoc Programming Guide.

Methods

The methods defined by the ODFocusSet class include:

- Add
- Contains
- CreateIterator
- Remove

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

### Add

This method adds the specified focus to this focus set.

Signature

    void Add (ODTypeToken focus)

Parameters

focus (ODTypeToken) - input

  A tokenized string representing a focus type to be added to this focus set.

  This parameter must be the tokenized form of a focus constants or the tokenized form of a part-specific focus type. You can call the session object's Tokenize method to obtain a token corresponding to an ODFocusType constant. For a list of ODFocusType constants, see ODFocusType.

Returns

None.

Remarks

The specified focus is not added if it already exists in the focus set.

Exception Handling

kODErrOutOfMemory | There is not enough memory to expand the focus set.

Related Methods

- ODSession::Tokenize

### Contains

This method indicates whether the specified focus is a member of this focus set.

Signature

    ODBoolean Contains (ODTypeToken focus)

Parameters

focus (ODTypeToken) - input

  A tokenized string representing a focus type to be tested for membership.

  This parameter must be the tokenized form of a focus constants or the tokenized form of a part-specific focus type. You can call the session object's Tokenize method to obtain a token corresponding to an ODFocusType constant. For a list of ODFocusType constants, see ODFocusType

Returns

rv (ODBoolean) - returns

  A flag indicating whether the specified focus is a member of this focus set.

  kODTrue | The set contains the focus.
  kODFalse | The set does not contain the focus.

Related Methods

- ODSession::Tokenize

### CreateIterator

This method creates a focus-set iterator object for this focus set.

Signature

    ODFocusSetIterator *CreateIterator ()

Parameters

None.

Returns

rv (ODFocusSetIterator *) - returns

  A reference to a new focus-set iterator object.

Remarks

While you are using a focus-set iterator, you should not modify the focus set. You must postpone adding items to or removing items from the focus set until after you have deleted the iterator.

### Remove

This method removes the specified focus from this focus set.

Signature

    void Remove (ODTypeToken focus)

Parameters

focus (ODTypeToken) - input

  A tokenized string representing the focus type to be remove from the focus set.

  This parameter must be the tokenized form of a focus constants or the tokenized form of a part-specific focus type. You can call the session object's Tokenize method to obtain a token corresponding to an ODFocusType constant. For a list of ODFocusType constants, see ODFocusType.

Returns

None.

Related Methods

- ODSession::Tokenize

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