23 BSiteI(0), OcView(ocView),
33 if (SUCCEEDED(OcView->OcApp.BOleComponentCreate(&BSite, (IUnknown*)(
IBPart*)
this,
36 if (SUCCEEDED(BSite->QueryInterface(IID_IBSite, (LPVOID *)&BSiteI)))
42 const _TCHAR* progid = regList->
Lookup(OcView->OcApp.IsOptionSet(
amDebug) ?
43 "debugprogid" :
"progid");
44 BSiteI->Init(
this,
this,
OleStr(progid),
true);
47 if (SUCCEEDED(BSite->QueryInterface(IID_IBApplication, (LPVOID *)&BAppI)))
55TOcLinkView::~TOcLinkView()
71 return OcView->OcDocument.GetViews().Detach(
this);
87 SUCCEEDED(hr = IBPart_QueryInterface(
this,
iid, iface))
88 || SUCCEEDED(hr = IBDataProvider_QueryInterface(
this,
iid, iface))
92 || (BSite && SUCCEEDED(hr = BSite->QueryInterface(
iid, iface)))
108 BSiteI->Invalidate(invalid);
118 BSiteI->Disconnect();
127 Moniker =
const_cast<LPTSTR
>(name);
140 return OcView->CountFormats();
151 return OcView->GetFormat(index, fmt);
166 TOcFormat* format = OcView->FormatList.Find(fmt->
Id);
169 if (OcView->ServerHost->EvOcViewClipData(formatData))
186 if (!OcView->ServerHost->EvOcViewPartSize(ps)) {
212 TRect p((
int)pos->left, (
int)pos->top, (
int)pos->right, (
int)pos->bottom);
213 TRect c((
int)clip->left, (
int)clip->top, (
int)clip->right, (
int)clip->bottom);
216 ::SetMapMode(dc, MM_ANISOTROPIC);
219 ::SetWindowOrgEx(dc, 0, 0, 0);
231 return HRFailIfZero(OcView->ServerHost->EvOcViewPaint(vp));
254 return HRFailIfZero(OcView->ServerHost->EvOcViewSavePart(ocSave));
287 OcView->ServerHost->EvOcViewBreakLink(*
this);
306 Origin = *(POINT*)&r->left;
350 OcView->ServerHost->EvOcViewAttachWindow(
true);
351 OcView->BringToFront();
420 return HRFailIfZero(OcView->ServerHost->EvOcViewDrag(dd));
431 return HRFailIfZero(OcView->ServerHost->EvOcViewGetPalette(palette));
451 return OcView->QueryInterface(
iid, iface);
489 for (
int i =
Count() - 1; i >= 0; i--) {
516 if (view && strcmp(view->
GetMoniker(), moniker) == 0) {
#define PRECONDITION(condition)
IBContainer – Supported by container app's document window.
IBPart – Supported by server objects.
IBSite – Supported by container apps for each linked/embedded object.
int Detach(TOcLinkView *const &view, int del=0)
int Find(TOcLinkView *const &view)
void Clear()
Release Views in the collection.
virtual unsigned Count() const
Link Viewer object for a server document.
owl::ulong _IFUNC Release()
HRESULT _IFUNC GetFormat(owl::uint index, TOcFormatInfo *fmt)
HRESULT QueryObject(const IID &iid, void **iface)
HRESULT _IFUNC Save(IStorage *, BOOL sameAsLoad, BOOL remember)
Save the document that we are a view on.
HWND _IFUNC OpenInPlace(HWND)
Open or close this view as an in-place edit session.
HRESULT _IFUNC GetPalette(LOGPALETTE **)
Optional palette query for.
HRESULT _IFUNC SetPartPos(owl::TRect *)
Set a new position for our document within its container.
HRESULT _IFUNC InsertMenus(HMENU, TOcMenuWidths *)
Insert the server's menus into the shared menubar.
HRESULT _IFUNC EnumVerbs(TOcVerb *)
Enumerate the verbs for our document.
HRESULT _IFUNC GetPartSize(owl::TSize *)
Return the 'size' of the document that this view in on.
HRESULT _IFUNC CanOpenInPlace()
Query to determine if this view can open in place.
LPOLESTR _IFUNC GetName(TOcPartName)
HRESULT _IFUNC Show(BOOL)
Show/Hide the server view window.
HANDLE _IFUNC GetFormatData(TOcFormatInfo *)
Request native data for pasting into client application.
int Detach()
Remove this link view from the document.
owl::ulong _IFUNC AddRef()
HRESULT _IFUNC DragFeedback(owl::TPoint *, BOOL)
Let the server provide drag feedback.
HRESULT _IFUNC Activate(BOOL)
Activate this view.
HRESULT _IFUNC Draw(HDC, const RECTL *, const RECTL *, TOcAspect, TOcDraw bd)
Render the view in the DC provided.
HRESULT _IFUNC Close()
Close the remote view window, & if canShutDown is true, try to close the server app too.
owl::uint _IFUNC CountFormats()
void SetMoniker(LPCTSTR name)
Remember the name of the moniker.
HRESULT _IFUNC Init(IBSite *, TOcInitInfo *)
Load the associated document and activate the remote view.
HRESULT _IFUNC DoVerb(owl::uint)
Perform a verb on our document.
void _IFUNC FrameResized(const owl::TRect *, BOOL)
A container window has resized.
HRESULT _IFUNC SetPartSize(owl::TSize *)
HRESULT _IFUNC SetHost(IBContainer *objContainer)
void GetLinkRect()
Get the initial size and position from the host app into our members.
void Invalidate(TOcInvalidate)
Invalidate the site corresponding to this view.
void Disconnect()
Disconnect from the client site.
owl::TString & GetMoniker()
HRESULT _IFUNC Open(BOOL)
Start or end open editing Work with the window Z-order and parenting.
HRESULT _IFUNC DoQueryInterface(const IID &iid, void **pif)
TOcLinkView(TOcView *ocView, owl::TRegList *regList=0, IUnknown *outer=0)
HRESULT _IFUNC ShowTools(BOOL)
Show or hide the tool windows used by our view.
Used to obtain the size of the rectangle that encloses the selection.
owl::TRect PartRect
rect enclosing the whole/part of the embedded object
Remote Viewer object for a server document.
Use when doing parts save and load.
The TOcView partner is a container (viewer) of a given (server/client) document.
IUnknown * SetOuter(IUnknown *outer=0)
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
void SetEmpty()
Empties this rectangle by setting left, top, right, and bottom to 0.
const TPoint & TopLeft() const
Returns the upperleft point.
void SetNull()
Sets the left, top, right, and bottom of the rectangle to 0.
TSize Size() const
Returns the size of rectangle.
TRect & Normalize()
Normalizes this rectangle by switching the left and right data member values if left > right,...
A registration parameter table, composed of a list of TRegItems.
LPCTSTR Lookup(LPCSTR key, TLangId lang=TLocaleString::UserDefaultLangId)
Performs the lookup of the TRegItems using a key (an item name such as progid) and returns the value ...
The tagSIZE struct is defined as.
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation).
const BCID cidBOleInProcSite
HRESULT HRFailIfZero(int bexpr)
TOcLinkCollection TOcViewCollection
TOcLinkCollectionIter TOcViewCollectionIter
Iterator for view collection.
@ amExeModule
set for EXE components, 0 if DLL inproc server
@ amDebug
user requested launching for debugging
Definition of TOcApp application connection class.
interface _ICLASS IStorage
Definition of TOcLinkView Class.
Definition of TOcRemView Class.
#define TYPESAFE_DOWNCAST(object, toClass)
For part adornment painting over part, & painting views.