OleClientSite

OleClientSite provides a site to manage an embedded OLE Document within a container.

<p>The OleClientSite provides the following capabilities: <ul> <li>creates the in-place editor for a blank document or opening an existing OLE Document <li>lays the editor out <li>provides a mechanism for activating and deactivating the Document <li>provides a mechanism for saving changes made to the document </ul>

<p>This object implements the OLE Interfaces IUnknown, IOleClientSite, IAdviseSink, IOleInPlaceSite

<p>Note that although this class is a subclass of <code>Composite</code>, it does not make sense to add <code>Control</code> children to it, or set a layout on it. </p><p> <dl> <dt><b>Styles</b> <dd>BORDER <dt><b>Events</b> <dd>Dispose, Move, Resize </dl>

@see <a href="http://www.eclipse.org/swt/snippets/#ole">OLE and ActiveX snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: OLEExample, OleWebBrowser</a>

Constructors

this
this(Composite parent, int style, File file)

Create an OleClientSite child widget using the OLE Document type associated with the specified file. The OLE Document type is determined either through header information in the file or through a Registry entry for the file extension. Use style bits to select a particular look or set of properties.

this
this(Composite parent, int style, String progId)

Create an OleClientSite child widget to edit a blank document using the specified OLE Document application. Use style bits to select a particular look or set of properties.

this
this(Composite parent, int style, String progId, File file)

Create an OleClientSite child widget to edit the specified file using the specified OLE Document application. Use style bits to select a particular look or set of properties. <p> <b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>OleClientSite</code>. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. </p> @param parent a composite widget; must be an OleFrame @param style the bitwise OR'ing of widget styles @param progId the unique program identifier of am OLE Document application; the value of the ProgID key or the value of the VersionIndependentProgID key specified in the registry for the desired OLE Document (for example, the VersionIndependentProgID for Word is Word.Document) @param file the file that is to be opened in this OLE Document

Members

Functions

deactivateInPlaceClient
void deactivateInPlaceClient()

Deactivates an active in-place object and discards the object's undo state.

doVerb
int doVerb(int verb)

Requests that the OLE Document or ActiveX Control perform an action; actions are almost always changes to the activation state.

exec
int exec(int cmdID, int options, Variant pvaIn, Variant pvaOut)

Asks the OLE Document or ActiveX Control to execute a command from a standard list of commands. The OLE Document or ActiveX Control must support the IOleCommandTarget interface. The OLE Document or ActiveX Control does not have to support all the commands in the standard list. To check if a command is supported, you can call queryStatus with the cmdID.

getIndent
Rectangle getIndent()

Returns the indent value that would be used to compute the clipping area of the active X object.

getProgramID
String getProgramID()

Returns the program ID of the OLE Document or ActiveX Control.

isDirty
bool isDirty()

Returns whether ole document is dirty by checking whether the content of the file representing the document is dirty.

queryStatus
int queryStatus(int cmd)

Returns the status of the specified command. The status is any bitwise OR'd combination of SWTOLE.OLECMDF_SUPPORTED, SWTOLE.OLECMDF_ENABLED, SWTOLE.OLECMDF_LATCHED, SWTOLE.OLECMDF_NINCHED. You can query the status of a command before invoking it with OleClientSite.exec. The OLE Document or ActiveX Control must support the IOleCommandTarget to make use of this method.

save
bool save(File file, bool includeOleInfo)

Saves the document to the specified file and includes OLE specific information if specified. This method must <b>only</b> be used for files that have an OLE Storage format. For example, a word file edited with Word.Document should be saved using this method because there is formating information that should be stored in the OLE specific Storage format.

setIndent
void setIndent(Rectangle newIndent)

The indent value is no longer being used by the client site.

showProperties
void showProperties(String title)

Displays a dialog with the property information for this OLE Object. The OLE Document or ActiveX Control must support the ISpecifyPropertyPages interface.

Inherited Members

From Composite

changed
void changed(Control[] changed)

Clears any data that has been cached by a Layout for all widgets that are in the parent hierarchy of the changed control up to and including the receiver. If an ancestor does not have a layout, it is skipped.

getBackgroundMode
int getBackgroundMode()

Returns the receiver's background drawing mode. This will be one of the following constants defined in class <code>SWT</code>: <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>, <code>INHERTIT_FORCE</code>.

getChildren
Control[] getChildren()

Returns a (possibly empty) array containing the receiver's children. Children are returned in the order that they are drawn. The topmost control appears at the beginning of the array. Subsequent controls draw beneath this control and appear later in the array. <p> Note: This is not the actual structure used by the receiver to maintain its list of children, so modifying the array will not affect the receiver. </p>

getLayout
Layout getLayout()

Returns layout which is associated with the receiver, or null if one has not been set.

getLayoutDeferred
bool getLayoutDeferred()

Returns <code>true</code> if the receiver has deferred the performing of layout, and <code>false</code> otherwise.

getTabList
Control[] getTabList()

Gets the (possibly empty) tabbing order for the control.

isLayoutDeferred
bool isLayoutDeferred()

Returns <code>true</code> if the receiver or any ancestor up to and including the receiver's nearest ancestor shell has deferred the performing of layouts. Otherwise, <code>false</code> is returned.

layout
void layout()

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the receiver does not have a layout, do nothing. <p> This is equivalent to calling <code>layout(true)</code>. </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(bool changed)

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the argument is <code>true</code> the layout must not rely on any information it has cached about the immediate children. If it is <code>false</code> the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the receiver does not have a layout, do nothing. <p> If a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. The layout will cascade down through all child widgets in the receiver's widget tree until a child is encountered that does not resize. Note that a layout due to a resize will not flush any cached information (same as <code>layout(false)</code>). </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(bool changed, bool all)

If the receiver has a layout, asks the layout to <em>lay out</em> (that is, set the size and location of) the receiver's children. If the changed argument is <code>true</code> the layout must not rely on any information it has cached about its children. If it is <code>false</code> the layout may (potentially) optimize the work it is doing by assuming that none of the receiver's children has changed state since the last layout. If the all argument is <code>true</code> the layout will cascade down through all child widgets in the receiver's widget tree, regardless of whether the child has changed size. The changed argument is applied to all layouts. If the all argument is <code>false</code>, the layout will <em>not</em> cascade down through all child widgets in the receiver's widget tree. However, if a child is resized as a result of a call to layout, the resize event will invoke the layout of the child. Note that a layout due to a resize will not flush any cached information (same as <code>layout(false)</code>). </p> <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

layout
void layout(Control[] changed)

Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarchy of the changed control up to and including the receiver. The layouts in the hierarchy must not rely on any information cached about the changed control or any of its ancestors. The layout may (potentially) optimize the work it is doing by assuming that none of the peers of the changed control have changed state since the last layout. If an ancestor does not have a layout, skip it. <p> Note: Layout is different from painting. If a child is moved or resized such that an area in the parent is exposed, then the parent will paint. If no child is affected, the parent will not paint. </p>

setBackgroundMode
void setBackgroundMode(int mode)

Sets the background drawing mode to the argument which should be one of the following constants defined in class <code>SWT</code>: <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>, <code>INHERIT_FORCE</code>.

setLayout
void setLayout(Layout layout)

Sets the layout which is associated with the receiver to be the argument which may be null.

setLayoutDeferred
void setLayoutDeferred(bool defer)

If the argument is <code>true</code>, causes subsequent layout operations in the receiver or any of its children to be ignored. No layout of any kind can occur in the receiver or any of its children until the flag is set to false. Layout operations that occurred while the flag was <code>true</code> are remembered and when the flag is set to <code>false</code>, the layout operations are performed in an optimized manner. Nested calls to this method are stacked.

setTabList
void setTabList(Control[] tabList)

Sets the tabbing order for the specified controls to match the order that they occur in the argument list.

Meta