|
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 &iidiid, 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 &iidiid, 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 &iidiid, 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? | |
| 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 &iidiid, 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 ocf::TOcStorage::TOcStorage(), AddRef(), ocf::TOcDocument::AllocPartID(), BLPartI, BPart, BPartI, Flags, ocf::TOcDocument::GetStorage(), Name, OcDocument, ocf::PartFormat, Storage, ocf::TXObjComp::Throw(), Visible, 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::TOcStorage::TOcStorage(), ocf::TOcPartCollection::Add(), AddRef(), BLPartI, BPart, BPartI, Flags, ocf::TOcDocument::GetParts(), ocf::TOcDocument::GetStorage(), Load(), Name, OcDocument, Storage, ocf::TXObjComp::Throw(), Visible, 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 ocf::TOcStorage::TOcStorage(), AddRef(), ocf::TOcDocument::AllocPartID(), BLPartI, BPart, BPartI, Flags, ocf::TOcDocument::GetStorage(), Init(), Name, OcDocument, ocf::PartFormat, Storage, ocf::TXObjComp::Throw(), Visible, 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.
| bool ocf::TOcPart::Activate | ( | bool | activate | ) |
Definition at line 642 of file ocpart.cpp.
References ocf::IBPart::Activate(), ocf::TOcView::ActivatePart(), Active, BPartI, CHECK, Flags, ocf::TOcView::GetActivePart(), ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), OcDocument, ocf::TOcView::SetActivePart(), and SetHost().
|
inline |
Definition at line 118 of file ocpart.h.
References _IFUNC, and ocf::TUnknown::GetOuter().
|
inline |
Definition at line 102 of file ocpart.h.
References BPartI, and 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.
|
protectedvirtual |
Discard undo stack for our associated [the active] view.
Implements ocf::IBSite.
Definition at line 323 of file ocpart.cpp.
References HR_NOERROR.
|
protectedvirtual |
Implements ocf::IBSite.
Definition at line 494 of file ocpart.cpp.
| bool ocf::TOcPart::DoVerb | ( | owl::uint | whichVerb | ) |
Definition at line 747 of file ocpart.cpp.
References BPartI, CHECK, ocf::IBPart::DoVerb(), ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), OcDocument, and ocf::TOcView::SetActivePart().
| 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, PRECONDITION, and ocf::TOcView::UpdateLinks().
| bool ocf::TOcPart::EnumVerbs | ( | const TOcVerb & | verb | ) |
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 |
|
inline |
|
protectedvirtual |
Get parent window for part.
Implements ocf::IBSite2.
Definition at line 436 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), ocf::TOcView::GetWindow(), 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 owl::TRect::TRect(), ocf::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewGetSiteRect(), ocf::TOcDocument::GetActiveView(), ocf::TOcView::GetWindowRect(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, OcDocument, Pos, PRECONDITION, ocf::TOcSiteRect::Rect, 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::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewGetScale(), ocf::TOcDocument::GetActiveView(), ocf::TOcScaleFactor::GetScaleFactor(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, OcDocument, PRECONDITION, ocf::TOcScaleInfo::xD, ocf::TOcScaleInfo::xN, ocf::TOcScaleInfo::yD, and ocf::TOcScaleInfo::yN.
|
protectedvirtual |
|
virtual |
Perform common ctor initialization.
Reimplemented in ocf::TOcControl.
Definition at line 128 of file ocpart.cpp.
References ocf::TOcPartCollection::Add(), BPart, ocf::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewSetSiteRect(), ocf::TOcDocument::GetActiveView(), ocf::TOcDocument::GetParts(), InitObj(), OcDocument, Pos, ocf::TOcSiteRect::Rect, Size, owl::TRect::Size(), and owl::TRect::TopLeft().
|
protectedvirtual |
Reimplemented in ocf::TOcControl.
Definition at line 154 of file ocpart.cpp.
References ocf::TOcView::ActivatePart(), 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::TOcInitInfo::How, ocf::HRSucceeded(), ocf::ihLink, ocf::iwNew, Link, OcDocument, Rename(), ocf::TOcInitInfo::Storage, Storage, ocf::TXObjComp::Throw(), ocf::TOcInitInfo::Where, 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(), ocf::TOcView::InvalidatePart(), and OcDocument.
|
inline |
Definition at line 79 of file ocpart.h.
References Active, Flags, and owl::ToBool().
|
inline |
Definition at line 81 of file ocpart.h.
References Flags, Link, and owl::ToBool().
|
inline |
Definition at line 76 of file ocpart.h.
References Flags, Selected, and owl::ToBool().
|
inline |
Definition at line 78 of file ocpart.h.
References Flags, owl::ToBool(), and Visible.
|
inline |
Definition at line 69 of file ocpart.h.
References GetRect(), IsVisible(), 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, ocf::TOcStream::Read(), Size, ocf::TOcStorage::Stat(), and Storage.
|
protectedvirtual |
Implements ocf::IBSite.
Definition at line 480 of file ocpart.cpp.
References ocf::TOcDocument::GetActiveView(), ocf::TOcView::GetWindow(), and OcDocument.
|
inline |
Definition at line 100 of file ocpart.h.
References BPartI, and ocf::HRSucceeded().
|
inline |
|
inline |
Definition at line 49 of file ocpart.h.
References TOcPart(), and owl::ToBool().
|
inline |
Definition at line 120 of file ocpart.h.
References _IFUNC, and ocf::TUnknown::GetOuter().
|
protected |
Callback from TUnknown's implementation of QueryInterface.
Definition at line 219 of file ocpart.cpp.
References BPart, ocf::HRSucceeded(), and PRECONDITION.
| HRESULT ocf::TOcPart::QueryServer | ( | const IID & | iid, |
| void ** | iface ) |
Query server for its interfaces.
Definition at line 239 of file ocpart.cpp.
References BPartI, ocf::IBPart::DoQueryInterface(), and PRECONDITION.
|
inline |
Definition at line 119 of file ocpart.h.
References _IFUNC, and ocf::TUnknown::GetOuter().
| 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, ocf::IBLinkable::OnRename(), ocf::TOcView::QueryInterface(), and ocf::TOcView::Release().
| bool ocf::TOcPart::Save | ( | bool | sameAsLoad = true, |
| bool | remember = true ) |
Save this part to storage.
May be any of:
Definition at line 508 of file ocpart.cpp.
References ocf::TOcStorage::TOcStorage(), Flags, ocf::TOcStorage::GetIStorage(), GetName(), ocf::TOcDocument::GetStorage(), ocf::HRSucceeded(), OcDocument, ocf::PartStreamName, Pos, Save(), Size, ocf::TOcStorage::Stat(), Storage, and ocf::TOcStream::Write().
| bool ocf::TOcPart::Save | ( | IStorage * | storage, |
| bool | sameAsLoad, | ||
| bool | remember ) |
Definition at line 698 of file ocpart.cpp.
References BPartI, ocf::HRSucceeded(), IStorage, PRECONDITION, and ocf::IBDataProvider::Save().
|
inline |
|
inline |
| 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, ocf::HRSucceeded(), and ocf::IBDataProvider2::SetFormatData().
|
inline |
Definition at line 104 of file ocpart.h.
References BPartI, and 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 owl::TRect::TRect(), ocf::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewSetSiteRect(), ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, Invalidate(), ocf::invView, OcDocument, Pos, PRECONDITION, ocf::TOcSiteRect::Rect, Size, and owl::TRect::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::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewSetSiteRect(), ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_INVALIDARG, HR_NOERROR, Invalidate(), ocf::invView, OcDocument, Pos, PRECONDITION, ocf::TOcSiteRect::Rect, Size, owl::TRect::Size(), and owl::TRect::TopLeft().
| 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.
| void ocf::TOcPart::SetStorage | ( | IStorage * | storage, |
| bool | remember = true ) |
Set the storage for this part.
Definition at line 785 of file ocpart.cpp.
References ocf::TOcStorage::TOcStorage(), ocf::TOcStorage::GetIStorage(), IStorage, and Storage.
| void ocf::TOcPart::SetVisible | ( | bool | visible | ) |
Definition at line 767 of file ocpart.cpp.
References BPartI, Flags, Invalidate(), ocf::invView, IsActive(), ocf::IBPart::Show(), and Visible.
|
inline |
Definition at line 99 of file ocpart.h.
References BPartI, and ocf::HRSucceeded().
|
protectedvirtual |
Show/hide a site.
Implements ocf::IBSite.
Definition at line 299 of file ocpart.cpp.
References ocf::TOcView::ActivatePart(), Active, ocf::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewPartActivate(), 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 owl::TRect::TRect(), BPartI, ocf::TOcView::ContainerHost, ocf::TOcContainerHost::EvOcViewGetSiteRect(), ocf::TOcDocument::GetActiveView(), OcDocument, Pos, ocf::TOcSiteRect::Rect, ocf::IBPart::SetPartPos(), and Size.
|
friend |
Definition at line 164 of file ocpart.h.
References TOcPartCollection.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |