Freigeben über


COleServerDoc Class

The base class for OLE server documents.

class AFX_NOVTABLE COleServerDoc : public COleLinkingDoc

Members

Public Constructors

Name

Description

COleServerDoc::COleServerDoc

Constructs a COleServerDoc object.

Public Methods

Name

Description

COleServerDoc::ActivateDocObject

Activates the associated DocObject document.

COleServerDoc::ActivateInPlace

Activates the document for in-place editing.

COleServerDoc::DeactivateAndUndo

Deactivates the server's user interface.

COleServerDoc::DiscardUndoState

Discards undo-state information.

COleServerDoc::GetClientSite

Retrieves a pointer to the underlying IOleClientSite interface.

COleServerDoc::GetEmbeddedItem

Returns a pointer to an item representing the entire document.

COleServerDoc::GetItemClipRect

Returns the current clipping rectangle for in-place editing.

COleServerDoc::GetItemPosition

Returns the current position rectangle, relative to the container application's client area, for in-place editing.

COleServerDoc::GetZoomFactor

Returns the zoom factor in pixels.

COleServerDoc::IsDocObject

Determines if the document is a DocObject.

COleServerDoc::IsEmbedded

Indicates whether the document is embedded in a container document or running stand-alone.

COleServerDoc::IsInPlaceActive

Returns TRUE if the item is currently activated in place.

COleServerDoc::NotifyChanged

Notifies containers that the user has changed the document.

COleServerDoc::NotifyClosed

Notifies containers that the user has closed the document.

COleServerDoc::NotifyRename

Notifies containers that the user has renamed the document.

COleServerDoc::NotifySaved

Notifies containers that the user has saved the document.

COleServerDoc::OnDeactivate

Called by the framework when the user deactivates an item that was activated in place.

COleServerDoc::OnDeactivateUI

Called by the framework to destroy controls and other user-interface elements created for in-place activation.

COleServerDoc::OnDocWindowActivate

Called by the framework when the container's document frame window is activated or deactivated.

COleServerDoc::OnResizeBorder

Called by the framework when the container application's frame window or document window is resized.

COleServerDoc::OnShowControlBars

Called by the framework to show or hide control bars for in-place editing.

COleServerDoc::OnUpdateDocument

Called by the framework when a server document that is an embedded item is saved, updating the container's copy of the item.

COleServerDoc::RequestPositionChange

Changes the position of the in-place editing frame.

COleServerDoc::SaveEmbedding

Tells the container application to save the document.

COleServerDoc::ScrollContainerBy

Scrolls the container document.

COleServerDoc::UpdateAllItems

Notifies containers that the user has changed the document.

Protected Methods

Name

Description

COleServerDoc::CreateInPlaceFrame

Called by the framework to create a frame window for in-place editing.

COleServerDoc::DestroyInPlaceFrame

Called by the framework to destroy a frame window for in-place editing.

COleServerDoc::GetDocObjectServer

Override this function to create a new CDocObjectServer object and indicate that this document is a DocObject container.

COleServerDoc::OnClose

Called by the framework when a container requests to close the document.

COleServerDoc::OnExecOleCmd

Executes a specified command or displays help for the command.

COleServerDoc::OnFrameWindowActivate

Called by the framework when the container's frame window is activated or deactivated.

COleServerDoc::OnGetEmbeddedItem

Called to get a COleServerItem that represents the entire document; used to get an embedded item. Implementation required.

COleServerDoc::OnReactivateAndUndo

Called by the framework to undo changes made during in-place editing.

COleServerDoc::OnSetHostNames

Called by the framework when a container sets the window title for an embedded object.

COleServerDoc::OnSetItemRects

Called by the framework to position the in-place editing frame window within the container application's window.

COleServerDoc::OnShowDocument

Called by the framework to show or hide the document.

Remarks

A server document can contain COleServerItem objects, which represent the server interface to embedded or linked items. When a server application is launched by a container to edit an embedded item, the item is loaded as its own server document; the COleServerDoc object contains just one COleServerItem object, consisting of the entire document. When a server application is launched by a container to edit a linked item, an existing document is loaded from disk; a portion of the document's contents is highlighted to indicate the linked item.

COleServerDoc objects can also contain items of the COleClientItem class. This allows you to create container-server applications. The framework provides functions to properly store the COleClientItem items while servicing the COleServerItem objects.

If your server application does not support links, a server document will always contain only one server item, which represents the entire embedded object as a document. If your server application does support links, it must create a server item each time a selection is copied to the Clipboard.

To use COleServerDoc, derive a class from it and implement the OnGetEmbeddedItem member function, which allows your server to support embedded items. Derive a class from COleServerItem to implement the items in your documents, and return objects of that class from OnGetEmbeddedItem.

To support linked items, COleServerDoc provides the OnGetLinkedItem member function. You can use the default implementation or override it if you have your own way of managing document items.

You need one COleServerDoc-derived class for each type of server document your application supports. For example, if your server application supports worksheets and charts, you need two COleServerDoc-derived classes.

For more information on servers, see the article Servers: Implementing a Server.

Inheritance Hierarchy

CObject

CCmdTarget

CDocument

COleDocument

COleLinkingDoc

COleServerDoc

Requirements

Header: afxole.h

See Also

Reference

COleLinkingDoc Class

Hierarchy Chart

COleDocument Class

COleLinkingDoc Class

COleTemplateServer Class

Concepts

MFC Sample HIERSVR