Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swt.ole.win32
Class OleClientSite

    java.lang.Object
      org.eclipse.swt.widgets.Widget
          org.eclipse.swt.widgets.Control
              org.eclipse.swt.widgets.Scrollable
                  org.eclipse.swt.widgets.Composite
                      org.eclipse.swt.ole.win32.OleClientSite

All Implemented Interfaces:
  Drawable

Direct Known Subclasses:
  OleControlSite

public class OleClientSite
extends Composite

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

The OleClientSite provides the following capabilities:

- creates the in-place editor for a blank document or opening an existing OLE Document
- lays the editor out
- provides a mechanism for activating and deactivating the Document
- provides a mechanism for saving changes made to the document

This object implements the OLE Interfaces IUnknown, IOleClientSite, IAdviseSink, IOleInPlaceSite

Note that although this class is a subclass of `Composite`, it does not make sense to add `Control` children to it, or set a layout on it.

Styles
  BORDER
Events
  Dispose, Move, Resize

Field Summary
`protected org.eclipse.swt.internal.ole.win32.GUID` | `appClsid`
`protected OleFrame` | `frame`
`protected org.eclipse.swt.internal.ole.win32.IOleDocumentView` | `objDocumentView`
`protected org.eclipse.swt.internal.ole.win32.IOleCommandTarget` | `objIOleCommandTarget`
`protected org.eclipse.swt.internal.ole.win32.IOleInPlaceObject` | `objIOleInPlaceObject`
`protected org.eclipse.swt.internal.ole.win32.IOleObject` | `objIOleObject`
`protected org.eclipse.swt.internal.ole.win32.IUnknown` | `objIUnknown`
`protected org.eclipse.swt.internal.ole.win32.IViewObject2` | `objIViewObject2`
`protected org.eclipse.swt.internal.ole.win32.IStorage` | `tempStorage`

Fields inherited from class org.eclipse.swt.widgets.Control
`handle`

Constructor Summary
`protected` | `OleClientSite(Composite parent, int style)`
`` | `OleClientSite(Composite parent, int style, File file)` Create an OleClientSite child widget using the OLE Document type associated with the specified file.
`` | `OleClientSite(Composite parent, int style, String progId)` Create an OleClientSite child widget to edit a blank document using the specified OLE Document application.
`` | `OleClientSite(Composite parent, int style, String progId, File file)` Create an OleClientSite child widget to edit the specified file using the specified OLE Document application.

Method Summary
`protected void` | `addObjectReferences()`
`protected int` | `AddRef()`
`protected void` | `createCOMInterfaces()`
`protected org.eclipse.swt.internal.ole.win32.IStorage` | `createTempStorage()`
`void` | `deactivateInPlaceClient()` Deactivates an active in-place object and discards the object's undo state.
`protected void` | `disposeCOMInterfaces()`
`int` | `doVerb(int verb)` Requests that the OLE Document or ActiveX Control perform an action; actions are almost always changes to the activation state.
`int` | `exec(int cmdID, int options, Variant in, Variant out)` Asks the OLE Document or ActiveX Control to execute a command from a standard list of commands.
`protected org.eclipse.swt.internal.ole.win32.GUID` | `getClassID(String clientName)`
`Rectangle` | `getIndent()`
`String` | `getProgramID()` Returns the program ID of the OLE Document or ActiveX Control.
`protected int` | `GetWindow(int phwnd)`
`boolean` | `isDirty()`
`boolean` | `isFocusControl()` Returns `true` if the receiver has the user-interface focus, and `false` otherwise.
`protected int` | `QueryInterface(int riid, int ppvObject)`
`int` | `queryStatus(int cmd)` Returns the status of the specified command.
`protected int` | `Release()`
`protected void` | `releaseObjectInterfaces()`
`boolean` | `save(File file, boolean includeOleInfo)`
`void` | `setIndent(Rectangle newIndent)`
`void` | `showProperties(String title)` Displays a dialog with the property information for this OLE Object.

Methods inherited from class org.eclipse.swt.widgets.Composite
`checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control
`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update`

Methods inherited from class org.eclipse.swt.widgets.Widget
`addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### appClsid

    protected org.eclipse.swt.internal.ole.win32.GUID appClsid

### frame

    protected OleFrame frame

### objIUnknown

    protected org.eclipse.swt.internal.ole.win32.IUnknown objIUnknown

### objIOleObject

    protected org.eclipse.swt.internal.ole.win32.IOleObject objIOleObject

### objIViewObject2

    protected org.eclipse.swt.internal.ole.win32.IViewObject2 objIViewObject2

### objIOleInPlaceObject

    protected org.eclipse.swt.internal.ole.win32.IOleInPlaceObject objIOleInPlaceObject

### objIOleCommandTarget

    protected org.eclipse.swt.internal.ole.win32.IOleCommandTarget objIOleCommandTarget

### objDocumentView

    protected org.eclipse.swt.internal.ole.win32.IOleDocumentView objDocumentView

### tempStorage

    protected org.eclipse.swt.internal.ole.win32.IStorage tempStorage

Constructor Detail

### OleClientSite

    protected OleClientSite(Composite parent,
                            int style)

### OleClientSite

    public OleClientSite(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.

Parameters:
  `parent` - a composite widget; must be an OleFrame
  `style` - the bitwise OR'ing of widget styles
  `file` - the file that is to be opened in this OLE Document
Throws:
  `SWTError` -
  - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
  - ERROR_ERROR_NULL_ARGUMENT when the parent is null
  `SWTError` -
  - ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
  - ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
  - ERROR_CANNOT_OPEN_FILE when failed to open file
  - ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces

### OleClientSite

    public OleClientSite(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.

Parameters:
  `parent` - a composite widget; must be an OleFrame
  `style` - the bitwise OR'ing of widget styles
Throws:
  `SWTError` -
  - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
  - ERROR_ERROR_NULL_ARGUMENT when the parent is null
  - ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID
  - ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
  - ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
  - ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces

### OleClientSite

    public OleClientSite(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.

  IMPORTANT: This method is not part of the public API for `OleClientSite`. 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.

Parameters:
  `parent` - a composite widget; must be an OleFrame
  `style` - the bitwise OR'ing of widget styles
  `file` - the file that is to be opened in this OLE Document
Throws:
  `SWTError` -
  - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
  - ERROR_ERROR_NULL_ARGUMENT when the parent is null
  - ERROR_INVALID_CLASSID when the progId does not map to a registered CLSID
  - ERROR_CANNOT_CREATE_OBJECT when failed to create OLE Object
  - ERROR_CANNOT_OPEN_FILE when failed to open file
  - ERROR_INVALID_ARGUMENT when the parent is not an OleFrame
  - ERROR_INTERFACES_NOT_INITIALIZED when unable to create callbacks for OLE Interfaces

Method Detail

### addObjectReferences

    protected void addObjectReferences()

### AddRef

    protected int AddRef()

### createCOMInterfaces

    protected void createCOMInterfaces()

### createTempStorage

    protected org.eclipse.swt.internal.ole.win32.IStorage createTempStorage()

### deactivateInPlaceClient

    public void deactivateInPlaceClient()

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

### disposeCOMInterfaces

    protected void disposeCOMInterfaces()

### doVerb

    public int doVerb(int verb)

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

  Parameters:
    `verb` - the operation that is requested. This is one of the OLE.OLEIVERB_ values
  Returns:
    an HRESULT value indicating the success of the operation request; OLE.S_OK indicates success

### exec

    public int exec(int cmdID,
                    int options,
                    Variant in,
                    Variant out)

  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.

  Parameters:
    `cmdID` - the ID of a command; these are the OLE.OLECMDID_ values - a small set of common commands
    `options` - the optional flags; these are the OLE.OLECMDEXECOPT_ values
    `in` - the argument for the command
    `out` - the return value of the command
  Returns:
    an HRESULT value; OLE.S_OK is returned if successful

### getClassID

    protected org.eclipse.swt.internal.ole.win32.GUID getClassID(String clientName)

### getIndent

    public Rectangle getIndent()

### getProgramID

    public String getProgramID()

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

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

### GetWindow

    protected int GetWindow(int phwnd)

### isDirty

    public boolean isDirty()

### isFocusControl

    public boolean isFocusControl()

  Description copied from class: `Control`
  Returns `true` if the receiver has the user-interface focus, and `false` otherwise.

  Overrides:
    `isFocusControl` in class `Control`
  Returns:
    the receiver's focus state

### QueryInterface

    protected int QueryInterface(int riid,
                                 int ppvObject)

### queryStatus

    public 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.

  Parameters:
    `cmd` - the ID of a command; these are the OLE.OLECMDID_ values - a small set of common commands
  Returns:
    the status of the specified command or 0 if unable to query the OLE Object; these are the OLE.OLECMDF_ values

### Release

    protected int Release()

### releaseObjectInterfaces

    protected void releaseObjectInterfaces()

### save

    public boolean save(File file,
                        boolean includeOleInfo)

### setIndent

    public void setIndent(Rectangle newIndent)

### showProperties

    public 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.

  Parameters:
    `title` - the name that will appear in the titlebar of the dialog

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.