15#include <owl/docview.rh>
16#include <ocf/oleview.rh>
66 OcDoc =
oleDoc->GetOcDoc();
125TOleView::VnIsWindow(THandle
hWnd)
160 if (Doc->CanClose()) {
307 if (
ocSave.SaveSelection) {
308 status =
doc->CommitSelection(*
this,
ocSave.UserData);
317 status =
doc->Commit(
true);
323 doc->RestoreStorage();
366 oleDoc->SetEmbedded(
false);
404 for (
int i = 0;
i < 6;
i++)
486 item.
Name =
_T(
"Content");
534#if OWL_PERSISTENT_STREAMS
545 GetObject()->Destroying =
false;
548 GetObject()->OcDoc =
oleDoc->GetOcDoc();
#define PRECONDITION(condition)
bool IsOptionSet(owl::uint32 option) const
void SetName(const owl::tstring &newName)
Notify container that doc pathname has changed.
Used to obtain the item name for building monikers.
owl::TString Name
Item moniker.
bool Selection
Whether we want name for the whole or part(selection)
Link Viewer object for a server document.
owl::ulong _IFUNC Release()
void Invalidate(TOcInvalidate)
Invalidate the site corresponding to this view.
owl::TString & GetMoniker()
Remote Viewer object for a server document.
@ LoadFromFile
Transient load-from-file.
bool Load(IStorage *storageI)
Load remote view specific information.
Use when doing parts save and load.
The TOcView partner is a container (viewer) of a given (server/client) document.
Derived from TClientDC, TOleClientDC is a helper class that translates between two different coordina...
Derived from TStorageDocument, TOleDocument implements the document half of the Doc/View pair.
Decorated frame that supports OLE 2 using OCF.
Derived from TView, TOleLinkView provides embedding and linking support for a portion of a document i...
virtual bool UpdateLinks()
When any changes occur to the server document, UpdateLinks updates all containers linked to the view ...
owl::TString & GetMoniker()
Returns the moniker for the selection in a server document associated with this TOleLinkView containe...
virtual bool VnLinkMoniker(owl::TString &moniker)
Returns true if a TOleLinkView object is associated with the given server's TOcRemView.
~TOleLinkView()
Destroys the TOleLinkView object and detaches the view from the associated document.
virtual bool VnLinkView(TOcLinkView &view)
Returns true if a TOleLinkView object is associated with the server's TOcRemView, the server's remote...
The OLE2 window view class. Used as a view in doc/view model.
bool EvOcViewClose()
Asks the server to close the view associated with this document.
~TOleView()
Destroys the TOleView object and detaches the view from the associated document.
bool VnDocOpened(int omode)
Ensures that TOleView's data members, such as DragPart, Pos, and Scale, are initialized properly afte...
auto GetViewMenu() -> owl::TMenuDescr *override
Overrides TView's GetViewMenu to make an on-the-fly decision about which menu to use: normal,...
bool EvOcViewGetItemName(TOcItemName &item)
Finds the item name for whole document or for the selection.
auto CanClose() -> bool override
A view uses this function to verify whether or not it can shut down.
bool EvOcViewAttachWindow(bool attach)
Attaches this view to its ObjectWindows parent window so the embedded object can be either opened and...
auto CreateOcView(owl::TRegLink *, bool isEmbedded, IUnknown *outer) -> TOcView *override
Override TOleWindow's version to pass info to TOleDocument & provide a second chance to find the RegL...
bool EvOcViewLoadPart(TOcSaveLoad &ocLoad)
Asks the server to load itself from storage.
bool EvOcViewSavePart(TOcSaveLoad &ocSave)
Asks the server to save the embedded object's data to storage.
bool VnDocClosed(int omode)
Sets the OcDoc data member to 0.
bool VnInvalidate(owl::TRect &rect)
Invalidates the view region specified by p.
bool EvOcViewSetLink(TOcLinkView &view)
Responds to an OC_VIEWSETLINK message TOcLinkView sends when the server document provides a link to a...
bool EvOcViewBreakLink(TOcLinkView &view)
Responds to an OC_VIEWBREAKLINK message that TOcLinkView sends when the server document that provides...
void CleanupWindow() override
Performs a normal CleanupWindow. Also lets the OcView object know we have closed.
bool EvOcViewOpenDoc(LPCTSTR path)
Asks the container application to open an existing document so the document can receive embedded and ...
bool EvOcViewInsMenus(TOcMenuDescr &sharedMenu)
Inserts the server's menu into the composite menu.
auto EvOcViewPartInvalid(TOcPartChangeInfo &changeInfo) -> bool override
Notifies the active view of any changes made to the embedded object's data (changeInfo).
auto OleShutDown() -> bool override
Shuts down the associated OCF partners if possible.
bool OtherViewExists()
Checks whether another TOleView already exists.
The generic OLE2 window. Use as a client of a frame window.
virtual void InvalidatePart(TOcInvalidate invalid)
Invalidates the area where the embedded object exists.
TOcDocument * OcDoc
Holds the ObjectComponents document associated with this TOleWindow.
bool IsOpenEditing() const
Checks whether the window is in Open-Edit mode.
virtual bool OleShutDown()
Shuts down the associated ObjectComponents partners, if possible.
owl::TRect Pos
Holds the current area in the window where the object is embedded.
TOcPart * DragPart
Points to the embedded object (the part) being dragged.
TOcScaleFactor Scale
Holds the current scaling factor. The server uses this information to determine how to scale the docu...
bool EvOcViewClose()
Asks the server to close a currently open document and its associated view.
void CleanupWindow() override
Performs normal window cleanup and informs the TOcView object that the window is closed.
TOcRemView * GetOcRemView()
Returns the server's view associated with this window.
TOcApp * OcApp
Holds the ObjectComponents application associated with this TOleWindow.
bool IsRemote() const
Returns true if the window represents an embedded server.
virtual TOcView * CreateOcView(owl::TRegLink *link, bool isRemote, IUnknown *outer)
Called to perform the actual setting up of the OcView member.
TOcView * OcView
Holds the ObjectComponents view or remote view (the server's) associated with the TOleWindow view.
TOcDocument * GetOcDoc()
Returns the ObjectComponents document associated with this window.
void Condemn(TWindow *win)
Condemns the given window to be deleted the at the next available safe time.
bool LPtoDP(TPoint *points, int count=1) const
Converts each of the count points in the points array from logical points to device points.
virtual void PostEvent(int id, TDocument &doc)
changed doc status
An abstract base class, TDocument is the base class for all document objects and serves as an interfa...
TDocTemplate * GetTemplate()
Gets the template used for document creation.
bool NotifyViews(int eventId, TParam2=0, TView *exclude=nullptr)
Notifies the views of this document, and the views of any child documents, of a change.
TDocManager & GetDocManager()
Returns a pointer to the current document manager.
TView * QueryViews(int eventId, TParam2=0, TView *exclude=nullptr)
Queries the views of the current document, and the views of any child documents, about a specified ev...
void SetDirty(bool dirty=true)
Updates the document's dirty flag using the specified parameter.
TView * GetViewList() const
Return pointer to the head of the link list of views associated with this document.
virtual bool Open(int mode, LPCTSTR path=nullptr)
Opens the document using the path specified by DocPath.
void SetEmbedded(bool embed)
Marks the document as being embedded in an OLE 2 container.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
void SetNull()
Sets the left, top, right, and bottom of the rectangle to 0.
A linked structure in which each node points to a list of TRegList objects (or TRegList-derived objec...
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Abstract base class for view access from document.
virtual TMenuDescr * GetViewMenu()
Returns the menu descriptor for this view.
void SetViewMenu(TMenuDescr *menu)
TDocument & GetDocument()
Returns a reference to the view's document.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual void SetParent(TWindow *newParent)
Sets the parent for the specified window by setting Parent to the specified new Parent window object.
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
virtual void Destroy(int retVal=0)
Destroys an MS-Windows element associated with the TWindow.
virtual void InvalidateRect(const TRect &rect, bool erase=true)
Invalidates a specified client area.
TModule * GetModule() const
Returns a pointer to the module object.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Base class for writing streamable objects.
Definition of class TDocManager.
#define DEFINE_RESPONSE_TABLE(cls)
Macro to define a response table for a class with no base response tables.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of abstract GDI object class and derived classes.
void ReadBaseObject(Base *base, ipstream &in)
#define IMPLEMENT_STREAMABLE2(cls, base1, base2)
void WriteBaseObject(Base *base, opstream &out)
@ dnCreate
New document or view has been created.
@ ofRead
ios::in, open for reading
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation)
EV_OC_VIEWPARTINVALID
EV_OC_VIEWDISCARDUNDO, // !CQ not processing this yet...
const owl::uint vnInvalidate
class _OCFCLASS TOleWindow
@ amExeMode
may be overridden per instance if running DLL
const owl::uint vnLinkView
Object Windows Library (OWLNext Core)
#define TYPESAFE_DOWNCAST(object, toClass)
Base window class TWindow definition, including HWND encapsulation.