OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
olewindo.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4/// \file
5/// TOleWindow - Class encapsulating a window which can be an OLE container
6/// or server window.
7//----------------------------------------------------------------------------
8
9#if !defined(OCF_OLEWINDO_H)
10#define OCF_OLEWINDO_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/window.h>
18#include <owl/dc.h>
19#include <owl/uihelper.h>
20
21#include <ocf/ocfevent.h>
22#include <ocf/ocremvie.h>
23#include <ocf/ocpart.h>
24#include <ocf/oclink.h>
25
26namespace owl {class _OWLCLASS TPopupMenu;};
27
28namespace ocf {
29
30// Generic definitions/compiler options (eg. alignment) preceding the
31// definition of classes
32#include <owl/preclass.h>
33
34
36
37//
38/// \class TOleWindow
39// ~~~~~ ~~~~~~~~~~
40/// The generic OLE2 window. Use as a client of a frame window.
41//
42/// Derived from TWindow, TOleWindow provides support for embedding objects in a
43/// compound document and serves as the client of a frame window. A compound
44/// document, such as the one TOleWindow supports, can contain many different types
45/// of embedded objects, from spreadsheets to bitmaps. In addition to providing
46/// support for a variety of basic window operations, TOleWindow also implements
47/// several OLE-related operations, among them
48/// - Responding to drag and drop events
49/// - In-place editing (the process whereby an embedded object can be
50/// edited without having to switch to its associated server application)
51/// - Activating an embedded object's server application
52/// - Creating views for the container application
53/// - Transmitting a document's scaling information between a
54/// container's and a server's view windows
55///
56/// TOleWindow has the ability to determine whether it's acting as a server or a
57/// container. If it is a container, TOleWindow has a pointer to a TOcView or if it
58/// is a server, TOleWindow establishes a pointer to a TOcRemView. From the
59/// server's point of view, every remote view has a corresponding TOleWindow.
60///
61/// Through its many event-handling member functions, TOleWindow communicates with
62/// ObjectComponents to implement container and server support for embedded objects,
63/// update views, and respond to a variety of menu commands associated with the
64/// typical command identifiers (for example, CM_FILEMENU). It also supports
65/// OLE-specific verbs such as those activated from the Edit menu (for example, Edit
66/// and Open). These commands and verbs can originate from various sources such as a
67/// menu selection, a radio button, or even an internal program message.
68///
69/// Conversely, ObjectComponents talks to ObjectWindows by means of the various
70/// EV_OC_Xxxx messages. Some of these messages, such as EV_OC_VIEWPARTINVALID,
71/// implement container support while others, such as EV_OC_VIEWCLOSE, implement
72/// server support.
73///
74/// For any user-defined classes derived from TOleWindow, you need to choose which
75/// functions are appropriate. If you want to provide additional server support, you
76/// need to define only those functions that implement server messages; if you want
77/// to provide container support, you need to define only those functions that
78/// provide additional container support.
79///
80/// For example, the data embedded in the container application (a compound document
81/// having one or more embedded objects) and the data embedded in the server
82/// application (a single OLE object with or without other embedded objects) can be
83/// written to storage and loaded from storage. If you're using TOleWindow without
84/// TOleView, you have to manipulate the storage by talking directly to the
85/// ObjectComponents class, TOcDocument.
86///
87/// In addition to communicating with ObjectComponents classes, TOleWindow supports
88/// many transactions as a result of its interaction with other ObjectWindows
89/// classes. By virtue of its derivation from TWindow, naturally it inherits much of
90/// TWindow's functionality.
91class _OCFCLASS TOleWindow : virtual public owl::TWindow {
92 public:
93 TOleWindow(owl::TWindow* parent = 0, owl::TModule* module = 0);
95
96 // Accessors
97 //
101 TOcApp* GetOcApp();
102 bool HasActivePart();
103 bool SelectEmbedded();
104
105 /// \name Query about current state
106 /// @{
107 bool IsOpenEditing() const;
108 bool IsRemote() const;
109 /// @}
110
111 /// \name Virtuals that derived class can override
112 /// @{
113 virtual bool OleShutDown();
114 virtual void SetupDC(owl::TDC& dc, bool scale = true);
115 virtual TOcView* CreateOcView(owl::TRegLink* link, bool isRemote, IUnknown* outer);
116 /// @}
117
118 /// \name Helper routines to create new objects or controls [Container specific]
119 /// @{
120 TOcPart* InsertObject(TOcInitInfo& initInfo, owl::TRect* pos = 0);
121 TOcPart* InsertObject(CLSID& objIID, owl::TRect* pos = 0);
122 TOcPart* InsertObject(owl::TString& objProgId, owl::TRect* pos = 0);
123
124 TOcControl* InsertControl(TOcInitInfo& initInfo, owl::TRect* pos = 0, int id = 0);
125 TOcControl* InsertControl(CLSID& ocxIID, owl::TRect* pos = 0, int id = 0);
126 TOcControl* InsertControl(const owl::TString& ocxProgID, owl::TRect* pos = 0, int id = 0);
127 /// @}
128
129 /// \name Helper routines to retrieve information about parts (embeddings/ocxes)
130 /// @{
131 TOcControl* GetOcControlOfOCX(CLSID ocxIID, owl::uint id = 0);
132 /// @}
133
134 protected:
135 /// \name Overridables
136 /// @{
137 virtual void GetInsertPosition(owl::TRect& rect);
138 virtual void InvalidatePart(TOcInvalidate invalid); // server only
139 virtual bool Deactivate();
140 virtual bool Select(owl::uint modKeys, owl::TPoint& point);
141 virtual bool PaintSelection(owl::TDC& dc, bool erase, owl::TRect& rect,
142 void* userData = 0);
143 virtual bool PaintParts(owl::TDC& dc, bool erase, owl::TRect& rect, bool metafile);
144 virtual bool PaintLink(owl::TDC& dc, bool erase, owl::TRect& rect,
145 owl::TString& moniker);
146 virtual void GetLogPerUnit(owl::TSize& logPerUnit);
147 virtual void SetScale(owl::uint16 percent);
148 virtual void SetSelection(TOcPart* part);
149 virtual bool ShowCursor(HWND wnd, owl::uint hitTest, owl::uint mouseMsg);
150 virtual bool StartDrag(owl::uint modKeys, owl::TPoint& point);
151 virtual LPCTSTR GetFileName();
152 /// @}
153
154 protected:
155 // Override virtual functions defined by owl::TWindow
156 //
157 void SetupWindow() override;
158 void CleanupWindow() override;
159 auto CanClose() -> bool override;
160
161 bool InClient(owl::TDC& dc, owl::TPoint& point);
162
163 auto EvCommand(owl::uint id, HWND hWndCtl, owl::uint notifyCode) -> owl::TResult override;
165 void EvPaint();
166 void EvSize(owl::uint sizeType, const owl::TSize& size);
167 void EvMDIActivate(HWND hWndActivated, HWND hWndDeactivated);
168 owl::uint EvMouseActivate(HWND topParent, owl::uint hitCode, owl::uint msg);
169 void EvSetFocus(HWND hWndLostFocus);
170
171 virtual bool EvOcViewPartInvalid(TOcPartChangeInfo& changeInfo);
172
174 void CmEditDelete();
175 void CmEditCut();
176 void CmEditCopy();
177 void CmEditPaste();
178 void CmEditPasteSpecial();
179 void CmEditPasteLink();
180 void CmEditLinks();
181 void CmEditConvert();
182 void CmEditInsertObject();
183 void CmEditInsertControl();
184 void CmEditShowObjects();
185
199
200 void EvMouseMove(owl::uint modKeys, const owl::TPoint& point);
201 void EvRButtonDown(owl::uint modKeys, const owl::TPoint& point);
202 void EvLButtonUp(owl::uint modKeys, const owl::TPoint& point);
203 void EvLButtonDown(owl::uint modKeys, const owl::TPoint& point);
204 void EvLButtonDblClk(owl::uint modKeys, const owl::TPoint& point);
205 bool EvSetCursor(HWND hWndCursor, owl::uint hitTest, owl::uint mouseMsg);
206 void EvDropFiles(owl::TDropInfo dropInfo);
207 void EvHScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl);
208 void EvVScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl);
209 void EvMenuSelect(owl::uint menuItemId, owl::uint flags, HMENU hMenu);
210
212/// owl::uint32 EvOcViewDiscardUndo(void * undo);
213
214 /// \name Container specific messages
215 /// @{
216 LPCTSTR EvOcViewTitle();
217 void EvOcViewSetTitle(LPCTSTR title);
218
221 bool EvOcViewDrop(TOcDragDrop & ddInfo);
222 bool EvOcViewDrag(TOcDragDrop & ddInfo);
223 bool EvOcViewScroll(TOcScrollDir scrollDir);
224 bool EvOcViewGetScale(TOcScaleFactor& scaleFactor);
225 bool EvOcViewGetSiteRect(owl::TRect * rect);
226 bool EvOcViewSetSiteRect(owl::TRect * rect);
227 bool EvOcViewPartActivate(TOcPart& ocPart);
229 /// @}
230
231 /// \name Server specific messages
232 /// @{
233 bool EvOcPartInvalid(TOcPart & /*part*/);
234 bool EvOcViewSavePart(TOcSaveLoad & ocSave);
235 bool EvOcViewLoadPart(TOcSaveLoad & ocLoad);
236 bool EvOcViewPaint(TOcViewPaint & vp);
237 bool EvOcViewInsMenus(TOcMenuDescr & sharedMenu);
239 bool EvOcViewGetPalette(LOGPALETTE * * palette);
240 bool EvOcViewClipData(TOcFormatData & format);
241 bool EvOcViewSetData(TOcFormatData & format);
242 bool EvOcViewClose();
243 bool EvOcViewPartSize(TOcPartSize & size);
244 bool EvOcViewOpenDoc(LPCTSTR path);
245 bool EvOcViewAttachWindow(bool attach);
246 bool EvOcViewSetScale(TOcScaleFactor& scaleFactor);
248 bool EvOcViewSetLink(TOcLinkView& view);
249 bool EvOcViewBreakLink(TOcLinkView& view);
250 bool EvOcViewDoVerb(owl::uint verb);
251
252 virtual bool EvOcViewTransformCoords(owl::uint verb);
253 /// @}
254
255 /// \name Ambient property specific messages
256 /// @{
257 virtual bool EvOcAmbientGetBackColor(long* rgb);
258 virtual bool EvOcAmbientGetForeColor(long* rgb);
259 virtual bool EvOcAmbientGetLocaleID(long* locale);
260 virtual bool EvOcAmbientGetTextAlign(short* align);
261 virtual bool EvOcAmbientGetMessageReflect(bool* msgReflect);
262 virtual bool EvOcAmbientGetUserMode(bool* mode);
263 virtual bool EvOcAmbientGetUIDead(bool* dead);
264 virtual bool EvOcAmbientGetShowGrabHandles(bool* show);
265 virtual bool EvOcAmbientGetShowHatching(bool* show);
266 virtual bool EvOcAmbientGetDisplayAsDefault(bool* disp);
267 virtual bool EvOcAmbientGetSupportsMnemonics(bool* support);
268 virtual bool EvOcAmbientGetDisplayName(owl::TString** name);
269 virtual bool EvOcAmbientGetScaleUnits(owl::TString** units);
270 virtual bool EvOcAmbientGetFont(IDispatch** font);
271
272 virtual bool EvOcAmbientSetBackColor(long rgb);
273 virtual bool EvOcAmbientSetForeColor(long rgb);
274 virtual bool EvOcAmbientSetLocaleID(long locale);
275 virtual bool EvOcAmbientSetTextAlign(short align);
276 virtual bool EvOcAmbientSetMessageReflect(bool msgReflect);
277 virtual bool EvOcAmbientSetUserMode(bool mode);
278 virtual bool EvOcAmbientSetUIDead(bool dead);
279 virtual bool EvOcAmbientSetShowGrabHandles(bool show);
280 virtual bool EvOcAmbientSetShowHatching(bool show);
281 virtual bool EvOcAmbientSetDisplayAsDefault(bool disp);
282 virtual bool EvOcAmbientSetSupportsMnemonics(bool support);
283 virtual bool EvOcAmbientSetDisplayName(owl::TString* name);
284 virtual bool EvOcAmbientSetScaleUnits(owl::TString* units);
285 virtual bool EvOcAmbientSetFont(IDispatch* font);
286 /// @}
287
288 /// \name Ctrl event specific messages
289 /// @{
290 virtual bool EvOcCtrlClick(TCtrlEvent* pev);
291 virtual bool EvOcCtrlDblClick(TCtrlEvent* pev);
292 virtual bool EvOcCtrlMouseDown(TCtrlMouseEvent* pev);
293 virtual bool EvOcCtrlMouseMove(TCtrlMouseEvent* pev);
294 virtual bool EvOcCtrlMouseUp(TCtrlMouseEvent* pev);
295 virtual bool EvOcCtrlKeyDown(TCtrlKeyEvent* pev);
296 virtual bool EvOcCtrlKeyUp(TCtrlKeyEvent* pev);
297 virtual bool EvOcCtrlErrorEvent(TCtrlErrorEvent* pev);
298 virtual bool EvOcCtrlFocus(TCtrlFocusEvent* pev);
301 virtual bool EvOcCtrlCustomEvent(TCtrlCustomEvent* pev);
302 /// @}
303
305 void EvDoVerb(owl::uint whichVerb);
306 void Init();
307
308 protected:
309/// Points to the embedded object (the part) being dragged.
311
312/// Indicates the position in the embedded object where the user points and clicks
313/// the mouse. This can be any one of the TUIHandle::TWhere enumerated values; for
314/// example, TopLeft, TopCenter, TopRight, MidLeft, MidCenter, MidRight, BottomLeft,
315/// BottomCenter, BottomRight, or Outside when no dragging is taking place.
317
318/// Points to the device context used while an object is being dragged.
320
321/// Indicates the point (in logical units) where the mouse is over the dragged object.
323
324/// Holds the rectangle being dragged.
326
327/// Holds the point where the dragging of the embedded object began.
329
330/// Holds the current scaling factor. The server uses this information to determine how to scale the document.
332
333/// Holds the current area in the window where the object is embedded. Pos reflects
334/// the area where the object is moved if you move the object.
336
337/// Holds the ObjectComponents document associated with this TOleWindow.
339
340/// Holds the ObjectComponents view or remote view (the server's) associated with the TOleWindow view.
342
343/// Holds the ObjectComponents application associated with this TOleWindow.
345
346/// Holds the name of the container. The server displays the container's name when an
347/// embedded object is being edited in the server's window (referred to as out-of-place editing).
349
350/// Returns true if the window represents an embedded server. Returns false otherwise.
351 bool Remote;
352
353/// Is true if the embedded object's frame (the gray or shaded brushes around the object)
354/// is displayed. The frame can be turned on or off depending on how you want the object to appear.
356
357/// The minimum width of the part.
359
360/// The minimum height of the part.
362
365};
366
368
369//
370/// \class TOleClientDC
371// ~~~~~ ~~~~~~~~~~~~
372/// Derived from TClientDC, TOleClientDC is a helper class that translates between
373/// two different coordinate systems. For example, the window's logical points may
374/// be measured in HIMETRIC or twips, whereas the coordinates of the actual output
375/// device (the viewport) may be measured in pixels. Without the help of this class,
376/// you would need to create a client DC and then setup the window's logical
377/// coordinates (its origin) and its width and height (its extent) as well as the
378/// viewport's origin (measured in device coordinates) and extent. Instead,
379/// TOleClientDC performs these calculations for you by mapping logical points to
380/// device points and vice versa.
381/// TOleClientDC works with a TOleWindow object. By default, TOleClientDC takes care
382/// of both scaling (adjusting the extents of the window and the viewport) and
383/// scrolling (adjusting the origins of the window and the viewport).
384//
386 public:
387 TOleClientDC(TOleWindow& win, bool scale = true);
388};
389
390// Generic definitions/compiler options (eg. alignment) following the
391// definition of classes
392#include <owl/posclass.h>
393
394// --------------------------------------------------------------------------
395// Inline implementation
396//
397
398//
399/// Returns the ObjectComponents document associated with this window. This document
400/// can be either a container's or a server's document. If this is a TOcDocument
401/// created by the container, the document is an entire compound document, which may
402/// consist of one or more embedded objects. If this is a TOcDocument created by the
403/// server, the document is a single OLE object's data.
404//
406 return OcDoc;
407}
408
409//
410/// Points to the ObjectComponents container view associated with this window. The
411/// container view holds the compound document (that is a document containing one or
412/// more embedded objects).
413//
415 return OcView;
416}
417
418//
419/// Returns the server's view associated with this window. In order to draw the OLE
420/// object in the container's window, the server creates a remote view.
421///
422/// \note Returns 0 in case of failure. For example, a TOleWindow of a
423/// container application does not have an associated 'TOcRemView'
424/// and will return 0.
425//
429
430//
431/// Returns the ObjectComponents application associated with this window. Every
432/// ObjectComponents application that supports linking and embedding has an
433/// associated TOcApp object.
435 return OcApp;
436}
437
438//
439/// Selects the embedded object and returns true to indicate that the object has
440/// been selected.
442 return DragPart != 0;
443}
444
445//
446/// Returns true if the window represents an embedded server. Returns false
447/// otherwise.
448inline bool TOleWindow::IsRemote() const {
449 return Remote;
450}
451
452//
453/// Repaints the selected portion of a document on the given device context. The
454/// parameter userData, which TocDataProvider passes to the application, contains
455/// information the application uses to repaint the selection. Similar to a moniker,
456/// this information tells the application where to find the selection and how to
457/// repaint it.
458inline bool TOleWindow::PaintSelection(owl::TDC& /*dc*/, bool /*erase*/,
459 owl::TRect& /*rect*/, void* /*userData*/) {
460 return false;
461}
462
463//
464/// Repaints part of an object on the given device context. The erase parameter is
465/// true if the background of the part is to be repainted. rect indicates the area
466/// that needs repainting. metafile indicates whether or not the part is a metafile.
467/// By default, PaintLink returns false. If your application supports working with
468/// parts of an object, you should override the PaintLink function, providing your
469/// own implementation for painting an object part.
470/// For more information, see Step 17 of the OWL tutorial.
471inline bool TOleWindow::PaintLink(owl::TDC& /*dc*/, bool /*erase*/,
472 owl::TRect& /*rect*/, owl::TString& /*moniker*/) {
473 return false;
474}
475
476//
477/// Handles a WM_OCEVENT message concerning the embedded or linked object in the
478/// document and invalidates the part.
479/// If the TOleWindow object is unable to handle the message, EvOcPartInvalid
480/// returns false.
481inline bool TOleWindow::EvOcPartInvalid(TOcPart & /*part*/) {
482 return false;
483}
484
485/// On linking must be implemented and return the file name
486inline LPCTSTR TOleWindow::GetFileName() {
487 return nullptr;
488}
489
490} // OCF namespace
491
492#endif
OCF Application class.
Definition ocapp.h:144
Class representing an embedded control within a document.
Definition occtrl.h:78
OC Document class, holds parts & is a owner of views.
Definition ocdoc.h:43
Used to obtain the native clipboard format data.
Definition ocview.h:416
Used to obtain the item name for building monikers.
Definition ocview.h:403
View/Data change info.
Definition ocpart.h:216
OC part class represents an embeded or linked part in a document.
Definition ocpart.h:38
Used to obtain the size of the rectangle that encloses the selection.
Definition ocview.h:364
Remote Viewer object for a server document.
Definition ocremvie.h:26
Use when doing parts save and load.
Definition ocview.h:326
The TOcView partner is a container (viewer) of a given (server/client) document.
Definition ocview.h:136
TOleClientDC(TOleWindow &win, bool scale=true)
Constructs a TOleClientDC object .
Definition olewindo.cpp:51
The generic OLE2 window. Use as a client of a frame window.
Definition olewindo.h:91
void EvSize(owl::uint sizeType, const owl::TSize &size)
Passes the event to TWindow::EvSize for normal processing and forwards the event to TOcView::EvResize...
bool EvOcViewLoadPart(TOcSaveLoad &ocLoad)
Requests that an embedded object load itself.
virtual bool EvOcAmbientSetBackColor(long rgb)
Handles the EV_OC_AMBIENT_SETBACKCOLOR message, which is sent by an OCX control.
bool EvOcViewSetLink(TOcLinkView &view)
Responds to an OC_VIEWSETLINK message TOcLinkView sends when the server document provides a link to a...
bool EvOcViewBorderSpaceReq(owl::TRect *rect)
Requests that the server create space for a tool bar in the view of an embedded object.
void SetupWindow() override
Establishes a connection between the TOcView object and the view's HWND so the view can send notifica...
Definition olewindo.cpp:286
virtual bool EvOcCtrlKeyDown(TCtrlKeyEvent *pev)
Handles the EV_OC_CTRLKEYDOWN message, which is sent by an OCX control.
bool HasActivePart()
Returns true if the container's view holds an in-place active embedded object.
Definition olewindo.cpp:983
virtual void InvalidatePart(TOcInvalidate invalid)
Invalidates the area where the embedded object exists.
Definition olewindo.cpp:424
TOcDocument * OcDoc
Holds the ObjectComponents document associated with this TOleWindow.
Definition olewindo.h:338
virtual bool EvOcAmbientSetSupportsMnemonics(bool support)
Handles the EV_OC_AMBIENT_SETSUPPORTSMNEMONICS message, which is sent by an OCX control.
void EvMDIActivate(HWND hWndActivated, HWND hWndDeactivated)
Responds to a message forwarded from the MDI child window (if one exists) and lets the TOcView class ...
bool EvOcViewGetItemName(TOcItemName &item)
Handles the EV_OC_VIEWGETITEMNAME. Returns false.
TOcView * GetOcView()
Points to the ObjectComponents container view associated with this window.
Definition olewindo.h:414
virtual bool EvOcAmbientSetTextAlign(short align)
Handles the EV_OC_AMBIENT_SETTEXTALIGN message, which is sent by an OCX control.
void CeFileClose(owl::TCommandEnabler &ce)
Enables the FileClose command, which lets the user exit from the window view.
Definition olewindo.cpp:623
void CeEditObject(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITOBJECT, which lets the user edit the embedded object.
Definition olewindo.cpp:872
void CmEditConvert()
Responds to a command with an ID of CM_EDITCONVERT by converting an object from one type to another.
Definition olewindo.cpp:922
virtual bool EvOcCtrlMouseUp(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEUP message, which is sent by an OCX control.
void CmEditDelete()
Responds to a command with an ID of CM_EDITDELETE by deleting the selected text.
Definition olewindo.cpp:736
void EvOcViewSetTitle(LPCTSTR title)
Sets the window's caption to title.
void CeEditDelete(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITDELETE, which lets the user delete the selected object from th...
Definition olewindo.cpp:727
virtual bool EvOcAmbientGetMessageReflect(bool *msgReflect)
Handles the EV_OC_AMBIENT_GETMESSAGEREFLECT message, which is sent by an OCX control.
virtual bool EvOcAmbientGetUserMode(bool *mode)
Handles the EV_OC_AMBIENT_GETUSERMODE message, which is sent by an OCX control.
virtual bool EvOcCtrlKeyUp(TCtrlKeyEvent *pev)
Handles the EV_OC_CTRLKEYUP message, which is sent by an OCX control.
bool EvOcViewGetPalette(LOGPALETTE **palette)
Requests the color palette to draw the object.
void EvCommandEnable(owl::TCommandEnabler &) override
Overrides the usual EvCommandEnable message in order to enable the OLE verbs from CM_EDITFIRSTVERB to...
Definition olewindo.cpp:344
owl::TPoint DragPt
Indicates the point (in logical units) where the mouse is over the dragged object.
Definition olewindo.h:322
virtual void SetSelection(TOcPart *part)
Selects the embedded object indicated in the part parameter.
bool EvOcViewPartActivate(TOcPart &ocPart)
Notifies ObjectWindows container applications that an embedded object is active.
void CmEditPasteLink()
Responds to a command with an ID of CM_EDITPASTELINK by creating a link between the current document ...
Definition olewindo.cpp:807
TOcPart * InsertObject(TOcInitInfo &initInfo, owl::TRect *pos=0)
Definition olewindo.cpp:444
bool EvOcViewShowTools(TOcToolBarInfo &tbi)
Asks the server to provide its tool bars for display in the container's window.
bool EvOcViewScroll(TOcScrollDir scrollDir)
Asks the container to scroll the view window and updates any internal state as needed.
bool EvOcViewSavePart(TOcSaveLoad &ocSave)
Asks the server to write an embedded object's data (the part as represented by the ocSave parameter) ...
bool EvOcViewSetSiteRect(owl::TRect *rect)
Converts the rect to logical units.
void EvVScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl)
In response to a WM_VSCROLL message, EvVScroll calls TWindow::EvVScroll and invalidates the window.
owl::TPoint DragStart
Holds the point where the dragging of the embedded object began.
Definition olewindo.h:328
void CeEditCut(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCUT, which lets a user copy and delete the selected object fro...
Definition olewindo.cpp:753
virtual bool EvOcAmbientGetForeColor(long *rgb)
Handles the EV_OC_AMBIENT_GETFORECOLOR message, which is sent by an OCX control.
virtual void SetupDC(owl::TDC &dc, bool scale=true)
Determines the viewport's origin and extent (the logical coordinates and the size of the device conte...
owl::TResult EvOcEvent(owl::TParam1 param1, owl::TParam2 param2)
Responds to a WM_OCEVENT message and subdispatches the message based on wParam.
DECLARE_RESPONSE_TABLE(TOleWindow)
TOcControl * GetOcControlOfOCX(CLSID ocxIID, owl::uint id=0)
Definition olewindo.cpp:581
virtual bool ShowCursor(HWND wnd, owl::uint hitTest, owl::uint mouseMsg)
Handles the WM_NCHITTEST message, setting the cursor according to its position on the screen.
virtual bool EvOcCtrlPropertyRequestEdit(TCtrlPropertyEvent *pev)
Handles the EV_OC_PROPERTYREQUESTEDIT message, which is sent by an OCX control.
void CmEditPaste()
Responds to a command with an ID of CM_EDITPASTE by pasting an object from the clipboard into the doc...
Definition olewindo.cpp:828
virtual bool EvOcCtrlErrorEvent(TCtrlErrorEvent *pev)
Handles the EV_OC_CTRLERROREVENT message, which is sent by an OCX control.
int MinWidth
The minimum width of the part.
Definition olewindo.h:358
virtual bool EvOcAmbientGetSupportsMnemonics(bool *support)
Handles the EV_OC_AMBIENT_GETSUPPORTSMNEMONICS message, which is sent by an OCX control.
bool IsOpenEditing() const
Checks whether the window is in Open-Edit mode.
Definition olewindo.cpp:434
virtual bool EvOcAmbientGetDisplayAsDefault(bool *disp)
Handles the EV_OC_AMBIENT_GETDISPLAYASDEFAULT message, which is sent by an OCX control.
bool EvOcViewGetScale(TOcScaleFactor &scaleFactor)
Responds to an OC_VIEWGETSCALE message and gets the scaling for the server object,...
void EvPaint()
Sets up the dc for proper scaling and scrolling and then calls the derived class's Paint method to pa...
virtual bool EvOcAmbientSetScaleUnits(owl::TString *units)
Handles the EV_OC_AMBIENT_SETSCALEUNITS message, which is sent by an OCX control.
void CmEditCopy()
Responds to a command with an ID of CM_EDITCOPY by copying the selected text to the clipboard.
Definition olewindo.cpp:785
virtual bool EvOcAmbientGetDisplayName(owl::TString **name)
Handles the EV_OC_AMBIENT_GETDISPLAYNAME message, which is sent by an OCX control.
LPCTSTR EvOcViewTitle()
Asks the container for the caption in its frame window.
void CmEditLinks()
Responds to a command with an ID of CM_EDITLINKS by updating the user-selected list of linked items i...
Definition olewindo.cpp:942
virtual bool EvOcAmbientGetScaleUnits(owl::TString **units)
Handles the EV_OC_AMBIENT_GETSCALEUNITS message, which is sent by an OCX control.
bool EvSetCursor(HWND hWndCursor, owl::uint hitTest, owl::uint mouseMsg)
Performs hit testing to tell where the cursor is located within the window and what object the cursor...
Definition olewindo.cpp:997
virtual bool EvOcViewTransformCoords(owl::uint verb)
virtual bool EvOcAmbientGetBackColor(long *rgb)
Handles the EV_OC_AMBIENT_GETBACKCOLOR message, which is sent by an OCX control.
virtual bool EvOcAmbientGetLocaleID(long *locale)
Handles the EV_OC_AMBIENT_GETLOCALEID message, which is sent by an OCX control.
owl::TPopupMenu * CreateVerbPopup(const TOcVerb &ocVerb)
Creates and enables a pop-up menu option (ocVerb) on the Edit menu.
virtual bool EvOcCtrlClick(TCtrlEvent *pev)
Handles the EV_OC_CTRLCLICK message, which is sent by an OCX control.
void EvLButtonDblClk(owl::uint modKeys, const owl::TPoint &point)
Responds to a mouse button double click message.
TOleWindow(owl::TWindow *parent=0, owl::TModule *module=0)
Constructs a TOleWindow object associated with the specified parent window and module instance.
Definition olewindo.cpp:204
virtual bool EvOcViewPartInvalid(TOcPartChangeInfo &changeInfo)
Informs an active container that one of its embedded objects needs to be redrawn.
void CmEditPasteSpecial()
Responds to a command with an ID of CM_EDITPASTESPECIAL by letting the user select an object from a l...
Definition olewindo.cpp:853
virtual bool EvOcCtrlDblClick(TCtrlEvent *pev)
Handles the EV_OC_CTRLDBLCLICK message, which is sent by an OCX control.
virtual bool OleShutDown()
Shuts down the associated ObjectComponents partners, if possible.
virtual bool EvOcAmbientSetLocaleID(long locale)
Handles the EV_OC_AMBIENT_SETLOCALEID message, which is sent by an OCX control.
bool Remote
Returns true if the window represents an embedded server. Returns false otherwise.
Definition olewindo.h:351
DECLARE_STREAMABLE_OCF(TOleWindow, 1)
void CeEditPasteLink(owl::TCommandEnabler &ce)
Enables a PasteLink command with an ID of CM_EDITPASTELINK, which lets the user link to the embedded ...
Definition olewindo.cpp:797
virtual LPCTSTR GetFileName()
On linking must be implemented and return the file name.
Definition olewindo.h:486
virtual bool Select(owl::uint modKeys, owl::TPoint &point)
Selects the embedded object at the specified point (measured in logical units).
virtual bool EvOcAmbientSetUserMode(bool mode)
Handles the EV_OC_AMBIENT_SETUSERMODE message, which is sent by an OCX control.
bool EvOcViewBorderSpaceSet(owl::TRect *rect)
Requests that the server's tool bar be placed in the container's view of an embedded object.
void CeEditPasteSpecial(owl::TCommandEnabler &ce)
Enables the PasteSpecial command, which lets the user select a clipboard format to be pasted or paste...
Definition olewindo.cpp:842
void CeEditInsertObject(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITINSERTOBJECT if the OcApp and OcView objects exist.
Definition olewindo.cpp:647
owl::TRect DragRect
Holds the rectangle being dragged.
Definition olewindo.h:325
virtual bool EvOcAmbientSetShowHatching(bool show)
Handles the EV_OC_AMBIENT_SETSETSHOWHATCHING message, which is sent by an OCX control.
owl::TUIHandle::TWhere DragHit
Indicates the position in the embedded object where the user points and clicks the mouse.
Definition olewindo.h:316
virtual bool PaintLink(owl::TDC &dc, bool erase, owl::TRect &rect, owl::TString &moniker)
Repaints part of an object on the given device context.
Definition olewindo.h:471
virtual bool EvOcAmbientGetTextAlign(short *align)
Handles the EV_OC_AMBIENT_GETTEXTALIGN message, which is sent by an OCX control.
owl::TRect Pos
Holds the current area in the window where the object is embedded.
Definition olewindo.h:335
bool SelectEmbedded()
Selects the embedded object and returns true to indicate that the object has been selected.
Definition olewindo.h:441
bool EvOcViewDrag(TOcDragDrop &ddInfo)
Handles an OC_VIEWDRAG message asking the container to provide visual feedback while the user is drag...
void EvDoVerb(owl::uint whichVerb)
Executes an OLE-related menu option from the Edit menu (for example, Edit, Copy, or Play) that is ass...
TOcPart * DragPart
Points to the embedded object (the part) being dragged.
Definition olewindo.h:310
int MinHeight
The minimum height of the part.
Definition olewindo.h:361
bool EvOcPartInvalid(TOcPart &)
Handles a WM_OCEVENT message concerning the embedded or linked object in the document and invalidates...
Definition olewindo.h:481
owl::tstring ContainerName
Holds the name of the container.
Definition olewindo.h:348
void EvLButtonDown(owl::uint modKeys, const owl::TPoint &point)
Responds to a left button down message by beginning a mouse drag transaction at the given point.
virtual bool EvOcCtrlMouseMove(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEMOVE message, which is sent by an OCX control.
virtual bool EvOcAmbientSetShowGrabHandles(bool show)
Handles the EV_OC_AMBIENT_SETSHOWGRABHANDLES message, which is sent by an OCX control.
bool EvOcViewBreakLink(TOcLinkView &view)
EvOcViewBreakLink responds to an OC_VIEWBREAKLINK message that TOcLinkView sends when the server docu...
void EvDropFiles(owl::TDropInfo dropInfo)
This is a response method for an incoming EV_WM_DROPFILES message.
virtual bool EvOcAmbientGetShowGrabHandles(bool *show)
Handles the EV_OC_AMBIENT_GETSHOWGRABHANDLES message, which is sent by an OCX control.
TOcControl * InsertControl(TOcInitInfo &initInfo, owl::TRect *pos=0, int id=0)
Definition olewindo.cpp:508
void Init()
Initializes the TOleWindow object with the appropriate window style and initializes the necessary dat...
Definition olewindo.cpp:231
TOcApp * GetOcApp()
Returns the ObjectComponents application associated with this window.
Definition olewindo.h:434
virtual bool EvOcAmbientSetUIDead(bool dead)
Handles the EV_OC_AMBIENT_SETUIDEAD message, which is sent by an OCX control.
bool EvOcViewDoVerb(owl::uint verb)
Handles the EV_OC_VIEWDOVERB message.
virtual void GetInsertPosition(owl::TRect &rect)
Gets the position (rect) where the embedded object is inserted.
Definition olewindo.cpp:670
virtual void GetLogPerUnit(owl::TSize &logPerUnit)
Gets the logical units (typically pixels) per inch for a document so that the document's embedded obj...
bool InClient(owl::TDC &dc, owl::TPoint &point)
Returns true if point is inside the client area of the window. Returns false otherwise.
void EvLButtonUp(owl::uint modKeys, const owl::TPoint &point)
Responds to a left button up message by ending a mouse drag action.
bool EvOcViewInsMenus(TOcMenuDescr &sharedMenu)
Requests that the menus in a composite menu (a menu composed of both the server's and the container's...
virtual bool EvOcAmbientSetForeColor(long rgb)
Handles the EV_OC_AMBIENT_SETFORECOLOR message, which is sent by an OCX control.
virtual bool EvOcAmbientSetDisplayName(owl::TString *name)
Handles the EV_OC_AMBIENT_SETDISPLAYNAME message, which is sent by an OCX control.
void CeEditConvert(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCONVERT, which lets the user convert the selected object from ...
Definition olewindo.cpp:914
owl::uint EvMouseActivate(HWND topParent, owl::uint hitCode, owl::uint msg)
Forwards the WM_MOUSEACTIVATE message to the top parent of the TOleWindow object.
virtual bool EvOcCtrlPropertyChange(TCtrlPropertyEvent *pev)
Handles the EV_OC_CTRLPROPERTYCHANGE message, which is sent by an OCX control.
bool EvOcViewPasteObject(TOcInitInfo &init)
Pastes an OLE object into the document pointed to by the TOleWindow::OcDoc data member.
owl::TDC * DragDC
Points to the device context used while an object is being dragged.
Definition olewindo.h:319
void EvRButtonDown(owl::uint modKeys, const owl::TPoint &point)
Responds to a right button down message.
TOcScaleFactor Scale
Holds the current scaling factor. The server uses this information to determine how to scale the docu...
Definition olewindo.h:331
void CeEditShowObjects(owl::TCommandEnabler &ce)
Checks or unchecks the Edit|Show Objects menu command according to the value of the ShowObjects data ...
Definition olewindo.cpp:974
bool EvOcViewClose()
Asks the server to close a currently open document and its associated view.
virtual bool EvOcAmbientGetFont(IDispatch **font)
Handles the EV_OC_AMBIENT_GETFONT message, which is sent by an OCX control.
virtual bool EvOcAmbientGetShowHatching(bool *show)
Handles the EV_OC_AMBIENT_GETSHOWHATCHING message, which is sent by an OCX control.
void EvMenuSelect(owl::uint menuItemId, owl::uint flags, HMENU hMenu)
Handles WM_MENUSELECT to provide hint text in the container's status bar, based on the menu item id.
void CeEditPaste(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITPASTE, which lets the user paste the embedded object from the ...
Definition olewindo.cpp:818
virtual bool EvOcAmbientSetDisplayAsDefault(bool disp)
Handles the EV_OC_AMBIENT_SETDISPLAYASDEFAULT message, which is sent by an OCX control.
bool EvOcViewPartSize(TOcPartSize &size)
The server asks itself the size of its current rectangle and lets the container know about the size o...
auto CanClose() -> bool override
Intercept CanClose() to interpose OpenEdit semantics.
Definition olewindo.cpp:396
virtual bool EvOcAmbientSetMessageReflect(bool msgReflect)
Handles the EV_OC_AMBIENT_SETMESSAGEREFLECT message, which is sent by an OCX control.
bool EvOcViewOpenDoc(LPCTSTR path)
Asks the container to open an existing document, which will be used for linking from the embedding si...
void CleanupWindow() override
Performs normal window cleanup and informs the TOcView object that the window is closed.
virtual bool EvOcCtrlCustomEvent(TCtrlCustomEvent *pev)
Handles the EV_OC_CTRLCUSTOMEVENT message, which is sent by an OCX control.
void CeEditLinks(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITLINKS, which lets the user manually update the list of linked ...
Definition olewindo.cpp:932
void CmEditCut()
Responds to a command with an ID of CM_EDITCUT by copying the selected text to the clipboard before c...
Definition olewindo.cpp:763
TOcRemView * GetOcRemView()
Returns the server's view associated with this window.
Definition olewindo.h:426
void CmEditInsertControl()
Responds to a command with an ID of CM_EDITINSERTCONTROL by creating, initializing,...
Definition olewindo.cpp:711
virtual bool PaintSelection(owl::TDC &dc, bool erase, owl::TRect &rect, void *userData=0)
Repaints the selected portion of a document on the given device context.
Definition olewindo.h:458
TOcApp * OcApp
Holds the ObjectComponents application associated with this TOleWindow.
Definition olewindo.h:344
bool ShowObjects
Is true if the embedded object's frame (the gray or shaded brushes around the object) is displayed.
Definition olewindo.h:355
auto EvCommand(owl::uint id, HWND hWndCtl, owl::uint notifyCode) -> owl::TResult override
Overrides the usual EvCommand message to handle the OLE verbs from CM_EDITFIRSTVERB to CM_EDITLASTVER...
Definition olewindo.cpp:372
void CeEditInsertControl(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITINSERTCONTROL if the OcApp and OcView objects exist.
Definition olewindo.cpp:657
void EvMouseMove(owl::uint modKeys, const owl::TPoint &point)
Responds to a mouse move message with the appropriate transaction.
bool EvOcViewDrop(TOcDragDrop &ddInfo)
Requests a given object be dropped at a specified place on the container's window.
bool IsRemote() const
Returns true if the window represents an embedded server.
Definition olewindo.h:448
bool EvOcViewPaint(TOcViewPaint &vp)
Asks the server to paint an object at a given position on a specified device context.
virtual bool EvOcCtrlFocus(TCtrlFocusEvent *pev)
Handles the EV_OC_CTRLFOCUS message, which is sent by an OCX control.
void CeEditVerbs(owl::TCommandEnabler &ce)
Enables the Edit|Verbs command, which lets the user select one of the OLE-specific verbs from the Edi...
Definition olewindo.cpp:953
virtual TOcView * CreateOcView(owl::TRegLink *link, bool isRemote, IUnknown *outer)
Called to perform the actual setting up of the OcView member.
Definition olewindo.cpp:307
TOcView * OcView
Holds the ObjectComponents view or remote view (the server's) associated with the TOleWindow view.
Definition olewindo.h:341
bool EvOcViewClipData(TOcFormatData &format)
Requests clipboard data in the specified format.
virtual bool EvOcAmbientGetUIDead(bool *dead)
Handles the EV_OC_AMBIENT_GETUIDEAD message, which is sent by an OCX control.
bool EvOcViewAttachWindow(bool attach)
Attaches the view to its ObjectWindows parent window so that the user can perform open editing on the...
virtual bool EvOcCtrlMouseDown(TCtrlMouseEvent *pev)
Handles the EV_OC_CTRLMOUSEDOWN message, which is sent by an OCX control.
bool EvOcViewSetScale(TOcScaleFactor &scaleFactor)
Responds to an OC_VIEWSETSCALE message and handles the scaling for server application,...
virtual bool Deactivate()
If an embedded object is no longer the active embedded object, either because the user has ended an i...
void CeEditCopy(owl::TCommandEnabler &ce)
Enables a command with an ID of CM_EDITCOPY, which lets the user copy selected object to the clipboar...
Definition olewindo.cpp:775
bool EvOcViewSetData(TOcFormatData &format)
void CmEditShowObjects()
Responds to a command with an ID of CM_EDITSHOWOBJECTS by toggling the value of the ShowObjects data ...
Definition olewindo.cpp:963
virtual bool EvOcAmbientSetFont(IDispatch *font)
Handles the EV_OC_AMBIENT_SETFONT message, which is sent by an OCX control.
void CmEditInsertObject()
Responds to a command with an ID of CM_EDITINSERTOBJECT by creating, initializing,...
Definition olewindo.cpp:695
TOcDocument * GetOcDoc()
Returns the ObjectComponents document associated with this window.
Definition olewindo.h:405
void EvHScroll(owl::uint scrollCode, owl::uint thumbPos, HWND hWndCtl)
In response to a WM_HSCROLL message, EvHScroll calls TWindow::EvHScroll and invalidates the window.
bool EvOcViewGetSiteRect(owl::TRect *rect)
Gets the size of the rectangle (the site) where the embedded object is to be placed.
void EvSetFocus(HWND hWndLostFocus)
Responds to a change in focus of the window.
virtual void SetScale(owl::uint16 percent)
Sets the ratio of the embedded object's size to the size of the site.
virtual bool StartDrag(owl::uint modKeys, owl::TPoint &point)
virtual bool PaintParts(owl::TDC &dc, bool erase, owl::TRect &rect, bool metafile)
Repaints the embedded objects on the given device context.
A device context class derived from TWindowDC, TClientDC provides access to the client area owned by ...
Definition dc.h:640
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
Definition window.h:209
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
TDropInfo is a simple class that supports file-name drag-and-drop operations using the WM_DROPFILES m...
Definition wsyscls.h:257
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:78
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TPopupMenu creates an empty pop-up menu to add to an existing window or pop-up menu.
Definition menu.h:189
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Definition string.h:67
TWhere
Enumeration describing the location of a grapple selection.
Definition uihelper.h:212
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
#define DECLARE_STREAMABLE_INLINES(cls)
Definition objstrm.h:1538
Object Component Framework (COM encapsulation).
Definition appdesc.h:22
TOcInvalidate
Definition ocobject.h:59
TOcScrollDir
Definition ocobject.h:52
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
LRESULT TResult
Result type.
Definition dispatch.h:52
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OCFCLASS
Definition defs.h:45
Definition of OWL signatures for ObjectComponents messages.
Definition of TOcPart class.
Definition of TOcRemView Class.
#define _ICLASS
Definition oleutil.h:25
#define _OWLCLASS
Definition defs.h:338
#define TYPESAFE_DOWNCAST(object, toClass)
Definition defs.h:269
Base struct for all control event messages.
Definition occtrl.h:366
For viewdrop & viewdrag.
Definition ocview.h:303
For part adornment painting over part, & painting views.
Definition ocview.h:312
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Base window class TWindow definition, including HWND encapsulation.