23 OcView(ocView), BSite(0), BSiteI(0), BLSiteI(0),
24 UserData(userData), CBDelete(callBack),
33 if (SUCCEEDED(OcView.OcApp.BOleComponentCreate(&BSite, (IUnknown*)(
IBDataProvider*)
this,
36 if (SUCCEEDED(BSite->QueryInterface(IID_IBSite, (LPVOID *)&BSiteI)))
42 LPCTSTR progid = regList->
Lookup(OcView.OcApp.IsOptionSet(
amDebug) ?
43 "debugprogid" :
"progid");
44 BSiteI->Init(
this, 0,
OleStr(progid),
true);
47 if (SUCCEEDED(BSite->QueryInterface(IID_IBLinkable,(LPVOID *)&BLSiteI)))
52 OcView.SetOcData(
this);
63TOcDataProvider::~TOcDataProvider()
83TOcDataProvider::QueryObject(
const IID &
iid,
void * * iface)
92 SUCCEEDED(hr = IBDataProvider_QueryInterface(
this,
iid, iface))
96 || (BSite && SUCCEEDED(hr = BSite->QueryInterface(
iid, iface)))
109 BSiteI->Disconnect();
125 if (OcView.ServerHost->EvOcViewGetItemName(item))
126 BLSiteI->OnRename(OcView.BLDocumentI,
OleStr(item.
Name));
135 return OcView.CountFormats();
146 return OcView.GetFormat(index, fmt);
158 TOcFormat* format = OcView.FormatList.Find(fmt->
Id);
161 if (OcView.ServerHost->EvOcViewClipData(formatData))
177 bool metafile = ::GetDeviceCaps(dc, TECHNOLOGY) == DT_METAFILE;
184 TRect p((
int)pos->left, (
int)pos->top, (
int)pos->right, (
int)pos->bottom);
185 TRect c((
int)clip->left, (
int)clip->top, (
int)clip->right, (
int)clip->bottom);
189 ::SetMapMode(dc, MM_ANISOTROPIC);
192 ::SetWindowOrgEx(dc, 0, 0, 0);
199 return HRFailIfZero(OcView.ServerHost->EvOcViewPaint(vp));
212 if (!OcView.ServerHost->EvOcViewPartSize(ps)) {
237 return HRFailIfZero(OcView.ServerHost->EvOcViewSavePart(ocSave));
#define PRECONDITION(condition)
IBDataProvider – Supported by parts and/or sites which can be copied to the OLE2 clipboard.
HRESULT _IFUNC Save(IStorage *, BOOL sameAsLoad, BOOL remember)
Save the selection that we are a view on.
owl::ulong _IFUNC Release()
HRESULT _IFUNC GetPartSize(owl::TSize *size)
Return the 'size' of the document that this view is on.
HANDLE _IFUNC GetFormatData(TOcFormatInfo *fmt)
Request native data for pasting into client application.
void Rename()
Update item moniker with new name.
void Disconnect()
Disconnect from the site.
owl::ulong _IFUNC AddRef()
HRESULT _IFUNC Draw(HDC dc, const RECTL *pos, const RECTL *clip, TOcAspect aspect, TOcDraw bd)
Render the data in the DC provided.
HRESULT _IFUNC GetFormat(owl::uint index, TOcFormatInfo *fmt)
TOcDataProvider(TOcView &ocView, owl::TRegList *regList, IUnknown *outer=0, void *userData=0, TDeleteUserData callBack=0)
UINT _IFUNC CountFormats()
Used to obtain the item name for building monikers.
owl::TString Name
Item moniker.
Used to obtain the size of the rectangle that encloses the selection.
owl::TRect PartRect
rect enclosing the whole/part of the embedded object
Use when doing parts save and load.
The TOcView partner is a container (viewer) of a given (server/client) document.
void SetOcData(TOcDataProvider *ocData=0)
TOcDataProvider * GetOcData()
IUnknown * SetOuter(IUnknown *outer=0)
TRect is a mathematical class derived from tagRect.
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.
Include for OC, gets common headers when precompiled headers are enabled.
Object Component Framework (COM encapsulation).
HRESULT HRFailIfZero(int bexpr)
void(*) TDeleteUserData(void *userData)
@ amDebug
user requested launching for debugging
Definition of TOcApp application connection class.
Definition of TOcDataProvider Class.
interface _ICLASS IStorage
For part adornment painting over part, & painting views.