Programming Guide: Frame Negotiation

# Programming Guide

## Frame Negotiation

Each part in an OpenDoc document controls the positions, sizes, and shapes of its embedded frames. At the same time, embedded parts may need to change the sizes, shapes, or numbers of the frames in which they are displayed. Read this section if your part expects to negotiate its display frame sizes with its containing part, or if it is a container part and expects to negotiate the sizes of its embedded frames with their parts.

Either party can initiate the negotiation, although the containing part has unilateral control over the outcome. Figure 25 shows an example of frame negotiation, in which an embedded part with a single display frame requests a larger frame size from its containing part, which has two display frames.

Figure 25. Example of Frame Negotiation with Multiple Frames

View figure.

In this case, the embedded part initiates the frame negotiation. Its frame is wholly contained within frame 1 (the upper frame) of the containing part:

1. The embedded part asks the containing part for a significantly larger frame, perhaps to fit material pasted in from the clipboard. The embedded frame is not concerned with, and does not even know, where or how the larger frame will fit into the containing part's content.

2. The containing part decides, on the basis of its own content model, that the requested frame is too large to fit within frame 1. The containing part instead increases the size of the embedded frame as much as it can, assigns it a place in its content area, and returns the resulting frame to the embedded part.

3. The embedded part accepts the frame given to it. If it were to repeat the first step and ask for the original larger frame again, the containing part would simply repeat the second step and return the same frame.

   But the embedded part still wants more area for its display, so it tries a different approach; it requests another display frame, this time to be embedded in frame 2 of the embedded part.

4. The containing part decides that the requested frame will fit in frame 2. It assigns the frame a place within frame 2 and returns the frame to the embedded part.

Frame negotiation, from the point of view of the embedded part, is discussed in "Resizing a Display Frame" and "Requesting an Additional Display Frame". Frame negotiation, from the point of view of the containing part, is discussed in "Resizing an Embedded Frame" and "Adding an Embedded Frame on Request".

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