public class OleClientSite extends Composite
The OleClientSite provides the following capabilities:
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.
Modifier and Type | Field and Description |
---|---|
protected GUID |
appClsid |
private int |
aspect |
private RECT |
borderWidths |
protected OleFrame |
frame |
private COMObject |
iAdviseSink |
private RECT |
indent |
private boolean |
inDispose |
private boolean |
inInit |
private boolean |
inUpdate |
(package private) COMObject |
iOleClientSite |
private COMObject |
iOleDocumentSite |
private COMObject |
iOleInPlaceSite |
(package private) boolean |
isActivated |
private boolean |
isStatic |
private COMObject |
iUnknown |
private Listener |
listener |
private GUID |
objClsid |
protected IOleDocumentView |
objDocumentView |
protected IOleCommandTarget |
objIOleCommandTarget |
protected IOleInPlaceObject |
objIOleInPlaceObject |
protected IOleObject |
objIOleObject |
protected IUnknown |
objIUnknown |
protected IViewObject2 |
objIViewObject2 |
private int |
refCount |
(package private) int |
state |
(package private) static int |
STATE_ACTIVE |
(package private) static int |
STATE_INPLACEACTIVE |
(package private) static int |
STATE_NONE |
(package private) static int |
STATE_RUNNING |
(package private) static int |
STATE_UIACTIVE |
protected IStorage |
tempStorage |
private int |
type |
private static java.lang.String |
WORDPROGID |
Modifier | Constructor and Description |
---|---|
protected |
OleClientSite(Composite parent,
int style) |
|
OleClientSite(Composite parent,
int style,
java.io.File file)
Create an OleClientSite child widget using the OLE Document type associated with the
specified file.
|
|
OleClientSite(Composite parent,
int style,
java.lang.String progId)
Create an OleClientSite child widget to edit a blank document using the specified OLE Document
application.
|
|
OleClientSite(Composite parent,
int style,
java.lang.String progId,
java.io.File file)
Create an OleClientSite child widget to edit the specified file using the specified OLE Document
application.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
ActivateMe(int pViewToActivate) |
protected void |
addObjectReferences() |
protected int |
AddRef() |
private int |
CanInPlaceActivate() |
private int |
ContextSensitiveHelp(int fEnterMode) |
protected void |
createCOMInterfaces() |
protected IStorage |
createTempStorage() |
void |
deactivateInPlaceClient()
Deactivates an active in-place object and discards the object's undo state.
|
private void |
deleteTempStorage() |
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.
|
(package private) IDispatch |
getAutomationObject() |
protected GUID |
getClassID(java.lang.String clientName) |
private int |
GetContainer(int ppContainer) |
private SIZE |
getExtent() |
Rectangle |
getIndent()
Returns the indent value that would be used to compute the clipping area
of the active X object.
|
(package private) java.lang.String |
getProgID(GUID clsid) |
java.lang.String |
getProgramID()
Returns the program ID of the OLE Document or ActiveX Control.
|
(package private) RECT |
getRect() |
protected int |
GetWindow(int phwnd) |
private int |
GetWindowContext(int ppFrame,
int ppDoc,
int lprcPosRect,
int lprcClipRect,
int lpFrameInfo) |
boolean |
isDirty()
Returns whether ole document is dirty by checking whether the content
of the file representing the document is dirty.
|
boolean |
isFocusControl()
Returns
true if the receiver has the user-interface
focus, and false otherwise. |
(package private) boolean |
isICAClient() |
private boolean |
isOffice2007(boolean program) |
(package private) void |
OleCreate(GUID appClsid,
GUID fileClsid,
char[] fileName,
java.io.File file) |
private int |
OnClose() |
private int |
OnDataChange(int pFormatetc,
int pStgmed) |
private void |
onDispose(Event e) |
(package private) void |
onFocusIn(Event e) |
(package private) void |
onFocusOut(Event e) |
private int |
OnInPlaceActivate() |
private int |
OnInPlaceDeactivate() |
private void |
onPaint(Event e) |
private int |
OnPosRectChange(int lprcPosRect) |
private void |
onResize(Event e) |
private void |
OnSave() |
private int |
OnShowWindow(int fShow) |
private void |
onTraverse(Event event) |
private int |
OnUIActivate() |
(package private) int |
OnUIDeactivate(int fUndoable) |
private int |
OnViewChange(int dwAspect,
int lindex) |
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(java.io.File file,
boolean includeOleInfo)
Saves the document to the specified file and includes OLE specific information if specified.
|
private boolean |
saveFromContents(int address,
java.io.File file) |
private boolean |
saveFromOle10Native(int address,
java.io.File file) |
private int |
SaveObject() |
private boolean |
saveOffice2007(java.io.File file) |
private boolean |
saveToStorageFile(java.io.File file)
Saves the document to the specified file and includes OLE specific information.
|
private boolean |
saveToTraditionalFile(java.io.File file)
Saves the document to the specified file.
|
private int |
Scroll_64(int scrollExtent) |
private int |
Scroll(int scrollExtent_cx,
int scrollExtent_cy) |
(package private) void |
setBorderSpace(RECT newBorderwidth) |
(package private) void |
setBounds() |
private void |
setExtent(int width,
int height) |
void |
setIndent(Rectangle newIndent)
The indent value is no longer being used by the client site.
|
private void |
setObjectRects() |
private int |
ShowObject() |
void |
showProperties(java.lang.String title)
Displays a dialog with the property information for this OLE Object.
|
private boolean |
updateStorage() |
private SIZE |
xFormHimetricToPixels(SIZE aSize) |
private SIZE |
xFormPixelsToHimetric(SIZE aSize) |
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
private COMObject iUnknown
COMObject iOleClientSite
private COMObject iAdviseSink
private COMObject iOleInPlaceSite
private COMObject iOleDocumentSite
protected GUID appClsid
private GUID objClsid
private int refCount
protected OleFrame frame
protected IUnknown objIUnknown
protected IOleObject objIOleObject
protected IViewObject2 objIViewObject2
protected IOleInPlaceObject objIOleInPlaceObject
protected IOleCommandTarget objIOleCommandTarget
protected IOleDocumentView objDocumentView
protected IStorage tempStorage
private int aspect
private int type
private boolean isStatic
boolean isActivated
private RECT borderWidths
private RECT indent
private boolean inUpdate
private boolean inInit
private boolean inDispose
private static final java.lang.String WORDPROGID
private Listener listener
static final int STATE_NONE
static final int STATE_RUNNING
static final int STATE_INPLACEACTIVE
static final int STATE_UIACTIVE
static final int STATE_ACTIVE
int state
protected OleClientSite(Composite parent, int style)
public OleClientSite(Composite parent, int style, java.io.File file)
parent
- a composite widget; must be an OleFramestyle
- the bitwise OR'ing of widget stylesfile
- the file that is to be opened in this OLE Documentjava.lang.IllegalArgumentException
- SWTException
- public OleClientSite(Composite parent, int style, java.lang.String progId)
parent
- a composite widget; must be an OleFramestyle
- the bitwise OR'ing of widget stylesprogId
- the unique program identifier of an 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)java.lang.IllegalArgumentException
- SWTException
- public OleClientSite(Composite parent, int style, java.lang.String progId, java.io.File file)
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.
parent
- a composite widget; must be an OleFramestyle
- the bitwise OR'ing of widget stylesprogId
- 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)file
- the file that is to be opened in this OLE Documentjava.lang.IllegalArgumentException
- SWTException
- protected void addObjectReferences()
protected int AddRef()
private int CanInPlaceActivate()
private int ContextSensitiveHelp(int fEnterMode)
protected void createCOMInterfaces()
protected IStorage createTempStorage()
public void deactivateInPlaceClient()
private void deleteTempStorage()
protected void disposeCOMInterfaces()
public int doVerb(int verb)
verb
- the operation that is requested. This is one of the OLE.OLEIVERB_ valuespublic int exec(int cmdID, int options, Variant in, Variant out)
cmdID
- the ID of a command; these are the OLE.OLECMDID_ values - a small set of common
commandsoptions
- the optional flags; these are the OLE.OLECMDEXECOPT_ valuesin
- the argument for the commandout
- the return value of the commandIDispatch getAutomationObject()
protected GUID getClassID(java.lang.String clientName)
private int GetContainer(int ppContainer)
private SIZE getExtent()
public Rectangle getIndent()
public java.lang.String getProgramID()
java.lang.String getProgID(GUID clsid)
int ActivateMe(int pViewToActivate)
protected int GetWindow(int phwnd)
RECT getRect()
private int GetWindowContext(int ppFrame, int ppDoc, int lprcPosRect, int lprcClipRect, int lpFrameInfo)
boolean isICAClient()
public boolean isDirty()
true
if the document has been modified,
false
otherwise.public boolean isFocusControl()
Control
true
if the receiver has the user-interface
focus, and false
otherwise.isFocusControl
in class Control
private boolean isOffice2007(boolean program)
private int OnClose()
private int OnDataChange(int pFormatetc, int pStgmed)
private void onDispose(Event e)
void onFocusIn(Event e)
void onFocusOut(Event e)
private int OnInPlaceActivate()
private int OnInPlaceDeactivate()
private int OnPosRectChange(int lprcPosRect)
private void onPaint(Event e)
private void onResize(Event e)
private void OnSave()
private int OnShowWindow(int fShow)
private int OnUIActivate()
int OnUIDeactivate(int fUndoable)
private void onTraverse(Event event)
private int OnViewChange(int dwAspect, int lindex)
protected int QueryInterface(int riid, int ppvObject)
public int queryStatus(int cmd)
cmd
- the ID of a command; these are the OLE.OLECMDID_ values - a small set of common
commandsprotected int Release()
protected void releaseObjectInterfaces()
public boolean save(java.io.File file, boolean includeOleInfo)
file
- the file to which the changes are to be savedincludeOleInfo
- the flag to indicate whether OLE specific information should be saved.private boolean saveFromContents(int address, java.io.File file)
private boolean saveFromOle10Native(int address, java.io.File file)
private int SaveObject()
private boolean saveOffice2007(java.io.File file)
private boolean saveToStorageFile(java.io.File file)
file
- the file to which the changes are to be savedprivate boolean saveToTraditionalFile(java.io.File file)
file
- the file to which the changes are to be savedprivate int Scroll_64(int scrollExtent)
private int Scroll(int scrollExtent_cx, int scrollExtent_cy)
void setBorderSpace(RECT newBorderwidth)
void setBounds()
private void setExtent(int width, int height)
public void setIndent(Rectangle newIndent)
newIndent
- the rectangle representing the indent amountprivate void setObjectRects()
private int ShowObject()
public void showProperties(java.lang.String title)
title
- the name that will appear in the titlebar of the dialogprivate boolean updateStorage()