The ContentObject Class is a SOM class that the BaseContainer part uses to manipulate its content. The BaseContainer part wraps its embedded frames in a FrameObject class, which is subclassed from the ContentObject class. A subclassing part can also use the ContentObject class to define its intrinsic content, which will allow the part to delegate the manipulation of the intrinsic content to the BaseContainer if desired. The ContentObject class can also be used independently of the BaseContainer part because it does not invoke any BaseContainer-specific methods.
The following attributes are public in the ContentObject class. They can be accessed by the SOM methods that begin with the prefixes "set" and "get".
objType (ODULong) | The type of the ContentObject. This attribute can be set to
one of the following values:
| ||||||
selectionState (ODULong) | The selection state of the ContentObject. If 0, the object is not selected. The subclasses of ContentObject can use this attribute support multiple selection states. | ||||||
boundingRect (ODRect) | The bounding rectangle of the content object in its containing frame's coordinates. | ||||||
containingFrame (ODFrame) | A reference to the content object's containing frame. |
The following are methods defined in the Content Object Class.
This method closes or deletes the content object according to the input type.
Signature
void DeleteContents (ODULong type) |
Parameters
FRAME_CLOSED | The content object's containing frame was closed. |
FRAME_REMOVED | The content object's containing frame was removed. |
OBJECT_DELETED | The content object itself was deleted. |
Returns
None.
Remarks
The ContentObject class simply clears the object's attributes. Your content object would override this method if it has other attributes that should be deallocated when the object is deleted.
This method moves the content object with the input point as the offset.
Signature
void MoveBy (ODPoint endPt) |
Parameters
Returns
None.
Remarks
The ContentObject class applies the input offset to the corners of the content object's bounding box. Your content object would override this method if it uses other attributes to move itself or if it cannot be defined by a bounding box.
This method moves the content object to the back of the Z-order with respect to the other content objects in the same containing frame.
Signature
void MoveToBack () |
Parameters
None.
Returns
None.
Remarks
The ContentObject class does not have any default behavior for this method. Your content object would override this method to re-render itself, so that the new Z-order is updated onscreen.
This method moves the content object to the front of the Z-order with respect to the other content objects in the same containing frame.
Signature
void MoveToFront () |
Parameters
None.
Returns
None.
Remarks
The ContentObject class does not have any default behavior for this method. Your content object would override this method to re-render itself, so that the new Z-order is updated onscreen.
This method reads the content object in from the specified storage unit.
Signature
void ReadContents (ODStorageUnit fromSU, BCTransferKind ReadKind, BCCloneInfo *cloneInfo) |
Parameters
EXTERNALIZE | Write the content object's data out to the storage unit. |
INTERNALIZE | Read the content object's data in from the storage unit. |
CLONEALL | Clone the content object to the storage unit. This operation is applicable only if the content object is a wrapper for an ODPersistentObject or a subclass of ODPersistentObject, such as ODFrame. |
CLONESELECTED | Clone the content object to the storage unit if the content object is in the selected state. This operation is applicable only if the content object is a wrapper for an ODPersistentObject or a subclass of ODPersistentObject, such as ODFrame. |
Returns
None.
Remarks
The ContentObject class reads the content object's bounding box in from the storage unit, and reads in any cloning information that is present. Your content object would override this method if it has other attributes would be internalized from a storage unit, or if it cannot be defined by a bounding box.
This method resizes the content object based on the input point.
Signature
void Resize (ODPoint endPt) |
Parameters
Returns
None.
Remarks
The ContentObject class redefines the content object's bounding box based on the input point. Your content object would override this method if it uses other attributes to resize itself or if it cannot be defined by a bounding box.
This method writes the content object to the specified storage unit.
Signature
void WriteContents (ODStorageUnit toSU, BCTransferKind writeKind, BCCloneInfo *cloneInfo) |
Parameters
EXTERNALIZE | Write the content object's data out to the storage unit. |
INTERNALIZE | Read the content object's data in from the storage unit. |
CLONEALL | Clone the content object to the storage unit. This operation is applicable only if the content object is a wrapper for an ODPersistentObject or a subclass of ODPersistentObject, such as ODFrame. |
CLONESELECTED | Clone the content object to the storage unit if the content object is in the selected state. This operation is applicable only if the content object is a wrapper for an ODPersistentObject or a subclass of ODPersistentObject, such as ODFrame. |
Returns
None.
Remarks
The ContentObject class writes the content object type and the bounding box out to the storage unit. Your content object would override this method if it has other attributes that should be saved, or if it cannot be defined by a bounding box.