OWLNext 7.0
Borland's Object Windows Library for the modern age
|
OC part class represents an embeded or linked part in a document. More...
#include <ocf/ocpart.h>
Public Member Functions | |
TOcPart (TOcDocument &document, int id=0) | |
Construct a new part with a given temp id Must call Init method to complete initialization. | |
TOcPart (TOcDocument &document, LPCTSTR name) | |
Construct a part from a named stream in an oc doc's storage. | |
TOcPart (TOcDocument &document, TOcInitInfo &initInfo, owl::TRect pos, int id=0) | |
Old style constructor - does init in constructor - OCF messages will get passed before constructor is complete. | |
virtual bool | Init (TOcInitInfo *initInfo, owl::TRect pos) |
Perform common ctor initialization. | |
void | Delete () |
Delete this object. | |
bool | operator== (const TOcPart &other) |
IBPart * | GetBPartI () |
TOcStorage * | GetStorage () |
void | SetStorage (IStorage *storage, bool remember=true) |
Set the storage for this part. | |
bool | Save (bool SameAsLoad=true, bool remember=true) |
Save this part to storage. | |
bool | Load () |
Load this part from its ocpart stream in its current storage. | |
int | Detach () |
void | FinishLoading () |
owl::TPoint | GetPos () const |
void | SetPos (const owl::TPoint &pos) |
Set part to the new position given in logical units. | |
owl::TSize | GetSize () const |
Update this part's idea of its size via the server, & then return that. | |
void | SetSize (const owl::TSize &size) |
Set part to the new size given in logical units. | |
owl::TRect | GetRect () const |
void | UpdateRect () |
Set part to the new rect given in logical units. | |
bool | IsVisible (const owl::TRect &logicalRect) const |
void | Select (bool select) |
bool | IsSelected () const |
void | SetVisible (bool visible) |
bool | IsVisible () const |
bool | IsActive () const |
void | SetActive () |
bool | IsLink () const |
owl::TString | GetName () |
void | Rename () |
Rename the embed site for linking. | |
bool | Save (IStorage *storage, bool sameAsLoad, bool remember) |
bool | Draw (HDC dc, const owl::TRect &pos, const owl::TRect &clip, TOcAspect aspect=asDefault) |
bool | Activate (bool activate) |
bool | Show (bool show) |
bool | Open (bool open) |
HWND | OpenInPlace (HWND hwnd) |
bool | CanOpenInPlace () |
bool | Close () |
Disconnect servers by closing & releasing our BOle helper. | |
bool | SetHost (IBContainer *container) |
bool | EnumVerbs (const TOcVerb &) |
bool | DoVerb (owl::uint) |
LPCOLESTR | GetServerName (TOcPartName partName) |
HRESULT | QueryServer (const IID &iid, void **iface) |
Query server for its interfaces. | |
bool | SetFormatData (TOcFormatInfo *fmt, HANDLE data, bool release) |
Set data into the server object. | |
owl::ulong _IFUNC | AddRef () |
owl::ulong _IFUNC | Release () |
HRESULT _IFUNC | QueryInterface (const GUID &iid, void **iface) |
Public Member Functions inherited from ocf::TUnknown | |
operator IUnknown & () | |
operator IUnknown * () | |
IUnknown * | SetOuter (IUnknown *outer=0) |
IUnknown * | GetOuter () |
unsigned long | GetRefCount () |
unsigned long | AdjustRefCount (int i) |
IUnknown & | Aggregate (TUnknown &inner) |
Protected Types | |
enum | TFlag { Visible =0x01 , Selected =0x02 , Active =0x04 , Link =0x08 , Closing =0x10 , OcxDefault =0x20 , OcxCancel =0x40 } |
Protected Member Functions | |
~TOcPart () | |
virtual bool | InitObj (TOcInitInfo *initInfo) |
HRESULT | QueryObject (const IID &iid, void **iface) |
Callback from TUnknown's implementation of QueryInterface. | |
HRESULT _IFUNC | SiteShow (BOOL) |
Show/hide a site. | |
HRESULT _IFUNC | DiscardUndo () |
Discard undo stack for our associated [the active] view. | |
HRESULT _IFUNC | GetSiteRect (owl::TRect *, owl::TRect *) |
Retrieve the site rect [relative to the active view?], and optionally the view's rect too? | |
HRESULT _IFUNC | SetSiteRect (const owl::TRect *) |
Set the site's rect from an in-place active part. | |
HRESULT _IFUNC | SetSiteExtent (const owl::TSize *) |
Set the part's site extent. | |
HRESULT _IFUNC | GetZoom (TOcScaleInfo *scale) |
Get zoom factor for part. | |
void _IFUNC | Invalidate (TOcInvalidate) |
Invalidate the site within the active view. | |
void _IFUNC | OnSetFocus (BOOL set) |
HRESULT _IFUNC | Init (IBDataProvider *, IBPart *, LPCOLESTR, BOOL) |
void _IFUNC | Disconnect () |
HRESULT _IFUNC | GetParentWindow (HWND *) |
Get parent window for part. | |
Protected Member Functions inherited from ocf::TUnknown | |
TUnknown () | |
virtual | ~TUnknown () |
IUnknown & | ThisUnknown () |
virtual HRESULT | QueryObject (const GUID &iid, void **pif) |
QueryObject used when TUnknown is in constructor/destructor. | |
Protected Attributes | |
IUnknown * | BPart |
Our corresponding helper object & interfaces. | |
IBPart * | BPartI |
IBLinkable * | BLPartI |
TOcDocument & | OcDocument |
The OC document we are imbeded in. | |
TOcStorage * | Storage |
The storage we are in. | |
owl::tstring | Name |
owl::TPoint | Pos |
owl::TSize | Size |
owl::uint16 | Flags |
Is this part Selected/Visible/Active/ALink? | |
Protected Attributes inherited from ocf::TUnknown | |
IUnknown * | Outer |
Friends | |
class | TOcPartCollection |
OC part class represents an embeded or linked part in a document.
|
protected |
ocf::TOcPart::TOcPart | ( | TOcDocument & | document, |
int | id = 0 ) |
Construct a new part with a given temp id Must call Init method to complete initialization.
Definition at line 26 of file ocpart.cpp.
References AddRef(), ocf::TOcDocument::AllocPartID(), ocf::TOcDocument::GetStorage(), Name, OcDocument, ocf::PartFormat, Storage, ocf::TXObjComp::Throw(), ocf::TOcStorage, and ocf::TXObjComp::xMissingRootIStorage.
ocf::TOcPart::TOcPart | ( | TOcDocument & | document, |
LPCTSTR | name ) |
Construct a part from a named stream in an oc doc's storage.
Definition at line 81 of file ocpart.cpp.
References ocf::TOcPartCollection::Add(), AddRef(), ocf::TOcDocument::GetParts(), ocf::TOcDocument::GetStorage(), Load(), OcDocument, Storage, ocf::TXObjComp::Throw(), ocf::TOcStorage, and ocf::TXObjComp::xMissingRootIStorage.
ocf::TOcPart::TOcPart | ( | TOcDocument & | document, |
TOcInitInfo & | initInfo, | ||
owl::TRect | pos, | ||
int | id = 0 ) |
Old style constructor - does init in constructor - OCF messages will get passed before constructor is complete.
Definition at line 52 of file ocpart.cpp.
References AddRef(), ocf::TOcDocument::AllocPartID(), ocf::TOcDocument::GetStorage(), Init(), Name, OcDocument, ocf::PartFormat, Storage, ocf::TXObjComp::Throw(), ocf::TOcStorage, and ocf::TXObjComp::xMissingRootIStorage.
|
protected |
Definition at line 109 of file ocpart.cpp.
References Detach(), ocf::TOcView::GetActivePart(), ocf::TOcDocument::GetActiveView(), OcDocument, ocf::TOcView::SetActivePart(), and Storage.
Definition at line 642 of file ocpart.cpp.
References ocf::IBPart::Activate(), Active, BPartI, CHECK, Flags, ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), OcDocument, and SetHost().
|
inline |
|
inline |
Definition at line 102 of file ocpart.h.
References ocf::HRSucceeded().
bool ocf::TOcPart::Close | ( | ) |
Disconnect servers by closing & releasing our BOle helper.
Definition at line 249 of file ocpart.cpp.
References BLPartI, BPart, BPartI, ocf::IBPart::Close(), Closing, Flags, ocf::HRSucceeded(), and ocf::IBLinkable::OnRename().
void ocf::TOcPart::Delete | ( | ) |
Delete this object.
Actually, causes object to shutdown as much as possible & then releases a reference.
Definition at line 208 of file ocpart.cpp.
References Activate(), Close(), and Release().
int ocf::TOcPart::Detach | ( | ) |
Definition at line 761 of file ocpart.cpp.
References ocf::TOcPartCollection::Detach(), ocf::TOcDocument::GetParts(), and OcDocument.
Discard undo stack for our associated [the active] view.
Implements ocf::IBSite.
Definition at line 323 of file ocpart.cpp.
References HR_NOERROR.
Implements ocf::IBSite.
Definition at line 494 of file ocpart.cpp.
Definition at line 747 of file ocpart.cpp.
References BPartI, CHECK, ocf::IBPart::DoVerb(), ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), and OcDocument.
bool ocf::TOcPart::Draw | ( | HDC | dc, |
const owl::TRect & | pos, | ||
const owl::TRect & | clip, | ||
TOcAspect | aspect = asDefault ) |
Definition at line 707 of file ocpart.cpp.
References BPartI, Closing, ocf::IBDataProvider::Draw(), ocf::drNone, Flags, ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), ocf::ihEmbed, InitObj(), IsLink(), ocf::iwStorage, OcDocument, and PRECONDITION.
Definition at line 738 of file ocpart.cpp.
References BPartI, ocf::IBPart::EnumVerbs(), and ocf::HRIsOK().
void ocf::TOcPart::FinishLoading | ( | ) |
Definition at line 670 of file ocpart.cpp.
References BPartI, ocf::TOcDocument::GetActiveView(), ocf::ihEmbed, InitObj(), ocf::iwStorage, and OcDocument.
|
inline |
Get parent window for part.
Implements ocf::IBSite2.
Definition at line 436 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), and OcDocument.
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Retrieve the site rect [relative to the active view?], and optionally the view's rect too?
Implements ocf::IBSite.
Definition at line 333 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, OcDocument, Pos, PRECONDITION, and Size.
TSize ocf::TOcPart::GetSize | ( | ) | const |
Update this part's idea of its size via the server, & then return that.
Use GetRect() to just get the current site rect.
Definition at line 593 of file ocpart.cpp.
References BPartI, ocf::IBDataProvider::GetPartSize(), and Size.
|
inline |
|
protectedvirtual |
Get zoom factor for part.
Implements ocf::IBSite.
Definition at line 447 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, OcDocument, and PRECONDITION.
|
virtual |
Perform common ctor initialization.
Reimplemented in ocf::TOcControl.
Definition at line 128 of file ocpart.cpp.
References ocf::TOcPartCollection::Add(), BPart, ocf::TOcDocument::GetActiveView(), ocf::TOcDocument::GetParts(), InitObj(), OcDocument, Pos, and Size.
|
protectedvirtual |
Reimplemented in ocf::TOcControl.
Definition at line 154 of file ocpart.cpp.
References Active, BLPartI, ocf::TOcApp::BOleComponentCreate(), BPart, BPartI, CHECK, ocf::TXObjComp::Check(), ocf::cidBOlePart, Flags, ocf::TOcDocument::GetActiveView(), ocf::TOcStorage::GetIStorage(), ocf::TOcDocument::GetOcApp(), ocf::TUnknown::GetOuter(), ocf::HRSucceeded(), ocf::ihLink, ocf::IBPart::Init(), ocf::iwNew, Link, OcDocument, Rename(), Storage, ocf::TXObjComp::Throw(), ocf::TXObjComp::xInternalPartError, and ocf::TXObjComp::xPartInitError.
|
protectedvirtual |
Invalidate the site within the active view.
Implements ocf::IBSite.
Definition at line 471 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), and OcDocument.
|
inline |
Definition at line 79 of file ocpart.h.
References owl::ToBool().
|
inline |
Definition at line 81 of file ocpart.h.
References owl::ToBool().
|
inline |
Definition at line 76 of file ocpart.h.
References owl::ToBool().
|
inline |
Definition at line 78 of file ocpart.h.
References owl::ToBool().
|
inline |
Definition at line 69 of file ocpart.h.
References owl::ToBool(), and owl::TRect::Touches().
bool ocf::TOcPart::Load | ( | ) |
Load this part from its ocpart stream in its current storage.
Definition at line 563 of file ocpart.cpp.
References Active, Closing, Flags, ocf::HRSucceeded(), ocf::PartStreamName, Pos, Size, ocf::TOcStorage::Stat(), and Storage.
Implements ocf::IBSite.
Definition at line 480 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), and OcDocument.
Definition at line 100 of file ocpart.h.
References ocf::HRSucceeded().
Definition at line 49 of file ocpart.h.
References owl::ToBool().
Callback from TUnknown's implementation of QueryInterface.
Definition at line 219 of file ocpart.cpp.
References BPart, ocf::HRSucceeded(), and PRECONDITION.
Query server for its interfaces.
Definition at line 239 of file ocpart.cpp.
References BPartI, ocf::IBPart::DoQueryInterface(), and PRECONDITION.
|
inline |
void ocf::TOcPart::Rename | ( | ) |
Rename the embed site for linking.
Definition at line 277 of file ocpart.cpp.
References BLPartI, CHECK, ocf::TOcDocument::GetActiveView(), GetName(), OcDocument, and ocf::IBLinkable::OnRename().
Save this part to storage.
May be any of:
Definition at line 508 of file ocpart.cpp.
References Flags, ocf::TOcStorage::GetIStorage(), GetName(), ocf::TOcDocument::GetStorage(), ocf::HRSucceeded(), OcDocument, ocf::PartStreamName, Pos, Save(), Size, ocf::TOcStorage::Stat(), Storage, and ocf::TOcStorage.
Definition at line 698 of file ocpart.cpp.
References BPartI, ocf::HRSucceeded(), PRECONDITION, and ocf::IBDataProvider::Save().
bool ocf::TOcPart::SetFormatData | ( | TOcFormatInfo * | fmt, |
HANDLE | data, | ||
bool | release ) |
Set data into the server object.
Definition at line 685 of file ocpart.cpp.
References BPart, and ocf::HRSucceeded().
|
inline |
Definition at line 104 of file ocpart.h.
References ocf::HRSucceeded().
void ocf::TOcPart::SetPos | ( | const owl::TPoint & | pos | ) |
Set part to the new position given in logical units.
Definition at line 605 of file ocpart.cpp.
References Pos.
|
protectedvirtual |
Set the part's site extent.
This comes either after a SetPartRect, or for open editing, comes alone.
Implements ocf::IBSite.
Definition at line 397 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, Invalidate(), ocf::invView, OcDocument, Pos, PRECONDITION, and Size.
|
protectedvirtual |
Set the site's rect from an in-place active part.
Since user is in control we generally respect both Pos & Size changes.
Implements ocf::IBSite.
Definition at line 367 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, Invalidate(), ocf::invView, OcDocument, Pos, PRECONDITION, and Size.
void ocf::TOcPart::SetSize | ( | const owl::TSize & | size | ) |
Set part to the new size given in logical units.
Definition at line 616 of file ocpart.cpp.
References Size.
Set the storage for this part.
Definition at line 785 of file ocpart.cpp.
References ocf::TOcStorage::GetIStorage(), Storage, and ocf::TOcStorage.
Definition at line 767 of file ocpart.cpp.
References BPartI, Flags, Invalidate(), ocf::invView, IsActive(), ocf::IBPart::Show(), and Visible.
Definition at line 99 of file ocpart.h.
References ocf::HRSucceeded().
Show/hide a site.
Implements ocf::IBSite.
Definition at line 299 of file ocpart.cpp.
References Active, Flags, ocf::TOcDocument::GetActiveView(), HR_NOERROR, Invalidate(), ocf::invView, and OcDocument.
void ocf::TOcPart::UpdateRect | ( | ) |
Set part to the new rect given in logical units.
Definition at line 625 of file ocpart.cpp.
References BPartI, ocf::TOcDocument::GetActiveView(), OcDocument, Pos, ocf::IBPart::SetPartPos(), and Size.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |