Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SSW_8_11.doc
Скачиваний:
0
Добавлен:
17.02.2020
Размер:
5.22 Mб
Скачать

ActiveX Document Containers

An ActiveX document container must support standard OLE interfaces IOleClientSite and IOleInPlaceSite. It must also implement the ActiveX document interface IOleDocumentSite to provide the mechanism for the container to talk to the document. Optionally, the container can implement the document object interfaces IOleDocumentCommandTarget and IContinueCallback to pick up simple commands, such as printing or saving. At present, MFC does not provide built-in support for ActiveX document containers, but it does fully support ActiveX document servers. You can still program ActiveX document containers yourself.

ActiveX Document Views

ActiveX documents extend the compound document technology of OLE. These extensions are in the form of additional interfaces that manage views, so that objects can function within containers and yet retain control over their display and printing functions. This process makes it possible to display documents both in foreign frames (such as the Microsoft Office Binder or Microsoft Internet Explorer) and in native frames (such as the product's own view ports).

The ActiveX document owns a set of data and has access to storage where the data can be saved and retrieved. It can create and manage one or more views on its data. In addition to supporting the usual embedding and in-place activation interfaces of OLE documents, the ActiveX document communicates its ability to create views through IOleDocument. Through this interface, the container can ask to create the views that the ActiveX document can display. Through this interface, the ActiveX document can also provide miscellaneous information about itself, such as whether it supports multiple views or complex rectangles.

Every ActiveX document must have a view frame provider with this interface. If the document is not embedded within a container, the ActiveX document server itself must provide the view frame. However, when the ActiveX document is embedded in an ActiveX document container, the container provides the view frame.

An ActiveX document can create one or more types of views of its data (for example, normal, outline, page layout, and so forth). Views act like filters through which the data can be seen. If an ActiveX document only supports a single view, the ActiveX document and that single view can be implemented using a single class. IOleDocument::CreateView simply returns the same object's IOleDocumentView interface pointer.

Every view has an associated view site, which encapsulates the view frame and the view port (HWND and a rectangular area in that window).

Typically each type of view has a different printed representation. Views and the corresponding view sites should implement the printing interfaces IPrint and IContinueCallback, respectively. The view frame must negotiate with the view provider through IPrint when printing begins, so that headers, footers, margins, and related elements are printed correctly. The view provider notifies the frame of printing-related events through IContinueCallback.

A view object can also be a command target. By implementing IOleCommandTarget a view can receive commands that originate in the container's user interface, such as New, Open, Save, Print, Copy, Paste, and Undo.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]