OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocf::TOcView Class Reference

The TOcView partner is a container (viewer) of a given (server/client) document. More...

#include <ocf/ocview.h>

Inheritance diagram for ocf::TOcView:
ocf::TUnknown ocf::IBContainer ocf::IBContains ocf::IBDropDest ocf::IBWindow ocf::IBDataConsumer ocf::IBDataNegotiator ocf::TOcRemView ocf::TOcxView

Public Member Functions

 TOcView (TOcDocument &doc, TOcContainerHost *ch, TOcServerHost *sh, owl::TRegList *regList=0, IUnknown *outer=0)
 New, interface constructor.
 
 TOcView (TOcDocument &doc, owl::TRegList *regList=0, IUnknown *outer=0)
 Compatibility constructor.
 
void SetupWindow (HWND hWin, bool embedded=false)
 
virtual void ReleaseObject ()
 Should only be called by the owner/creator of this object.
 
TOcDocumentGetOcDocument ()
 
IBRootLinkableGetLinkable ()
 
Clipboard support
bool RegisterClipFormats (owl::TRegList &regList)
 Register the clipboard formats supported.
 
bool BrowseClipboard (TOcInitInfo &initInfo)
 
bool PasteNative (TOcInitInfo &init, owl::TPoint *where=0)
 Paste native data into the container.
 
bool Paste (bool linking=false)
 
void SetOcData (TOcDataProvider *ocData=0)
 
TOcDataProviderGetOcData ()
 
View related
owl::TPoint GetOrigin () const
 
owl::TRect GetWindowRect () const
 Return the client rect for the view window.
 
void ScrollWindow (int dx, int dy)
 Scroll this container window a give dx,dy.
 
void InvalidatePart (TOcPartChangeInfo &changeInfo)
 
virtual void Rename ()
 
TOcLinkViewGetDocLink (LPCTSTR name=0)
 Obtain a TOcLinkView representing a moniker, the whole document by default.
 
bool IsOptionSet (owl::uint32 option) const
 
void SetOption (owl::uint32 bit, bool state)
 
Get/Set active part
TOcPartGetActivePart ()
 
void SetActivePart (TOcPart *part)
 
bool ActivatePart (TOcPart *part)
 Activate a given part.
 
IBDocument pass-thrus
void EvResize ()
 
void EvActivate (bool activate)
 View is activated/deactivated.
 
virtual void EvClose ()
 View is shuting down.
 
virtual bool EvSetFocus (bool set)
 Returns true if view keeps focus, false if the inplace server got it.
 
bool EnumLinks (IBLinkInfo **)
 
bool BrowseLinks ()
 
bool UpdateLinks ()
 
Object reference & lifetime managment

For internal OCF use only

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 Member Functions

owl::TResult ForwardEvent (int eventId, const void *param)
 
owl::TResult ForwardEvent (int eventId, owl::TParam2 param=0)
 
 ~TOcView ()
 
void Shutdown ()
 Called from destructor of this class or of derived class to release helpers and host interfaces.
 
HRESULT QueryObject (const IID &iid, void **iface)
 Callback from TUnknown's implementation of QueryInterface.
 
IBContains implementation for BOle to use
HRESULT _IFUNC Init (LPCOLESTR)
 Ask the container to load document named 'path'.
 
HRESULT _IFUNC GetPart (IBPart **, LPCOLESTR)
 
IBDataNegotiator implementation
owl::uint _IFUNC CountFormats ()
 Format count.
 
HRESULT _IFUNC GetFormat (owl::uint, TOcFormatInfo *)
 Format retrieval.
 
IBWindow implementation
HWND _IFUNC GetWindow ()
 
HRESULT _IFUNC GetWindowRect (owl::TRect *r)
 
LPCOLESTR _IFUNC GetWindowTitle ()
 
void _IFUNC AppendWindowTitle (LPCOLESTR title)
 Append server's doc title info to our view's window title.
 
HRESULT _IFUNC SetStatusText (LPCOLESTR text)
 
HRESULT _IFUNC RequestBorderSpace (const owl::TRect *)
 
HRESULT _IFUNC SetBorderSpace (const owl::TRect *)
 
HRESULT _IFUNC InsertContainerMenus (HMENU, TOcMenuWidths *)
 
HRESULT _IFUNC SetFrameMenu (HMENU)
 
void _IFUNC RestoreUI ()
 
HRESULT _IFUNC Accelerator (MSG *)
 
HRESULT _IFUNC GetAccelerators (HACCEL *, int *)
 
IBDropDest implementation
HRESULT _IFUNC Drop (TOcInitInfo *, owl::TPoint *, const owl::TRect *)
 Drop a part onto this view.
 
void _IFUNC DragFeedback (owl::TPoint *, const owl::TRect *, TOcMouseAction, owl::uint, HRESULT &hr)
 Provide feedback to the users drag action in our container window.
 
HRESULT _IFUNC Scroll (TOcScrollDir scrollDir)
 Ask the container view window to scroll itself in a given direction.
 
HRESULT _IFUNC GetScrollRect (owl::TRect *)
 
IBContainer implementation
HRESULT _IFUNC FindDropDest (owl::TPoint *, IBDropDest **)
 Locate the drop destination object.
 
HRESULT _IFUNC AllowInPlace ()
 
HRESULT _IFUNC BringToFront ()
 
- 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 * BDocument
 Document helper object.
 
IBDocumentBDocumentI
 Document interface on the document.
 
IUnknown * BContainer
 Container helper object.
 
IBRootLinkableBLDocumentI
 RootLinkable interface on the container.
 
TOcAppOcApp
 Our OC application object.
 
TOcDocumentOcDocument
 Our OC document object.
 
TOcContainerHostContainerHost
 The hosting app's container object.
 
TOcServerHostServerHost
 The hosting app's server object.
 
TOcPartActivePart
 Currently active part, if any.
 
owl::uint32 Options
 
owl::TPoint Origin
 
owl::TSize Extent
 
owl::tstring WinTitle
 
TOcFormatList FormatList
 
owl::TString OrgTitle
 Original window title string.
 
int LinkFormat
 adjustment for format count
 
owl::TRegListRegList
 
TOcDataProviderOcData
 Dataprovider representing this view.
 
- Protected Attributes inherited from ocf::TUnknown
IUnknown * Outer
 

Friends

class _ICLASS TOcControl
 
class _ICLASS TOcControlEvent
 
class _ICLASS TOcPart
 
class _ICLASS TOcDataProvider
 
class _ICLASS TOcLinkView
 

Detailed Description

The TOcView partner is a container (viewer) of a given (server/client) document.

Definition at line 133 of file ocview.h.

Constructor & Destructor Documentation

◆ TOcView() [1/2]

◆ TOcView() [2/2]

◆ ~TOcView()

ocf::TOcView::~TOcView ( )
protected

Definition at line 138 of file ocview.cpp.

References Shutdown().

Member Function Documentation

◆ Accelerator()

HRESULT _IFUNC ocf::TOcView::Accelerator ( MSG * )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 684 of file ocview.cpp.

References HR_FAIL.

◆ ActivatePart()

bool ocf::TOcView::ActivatePart ( TOcPart * part)

Activate a given part.

Definition at line 444 of file ocview.cpp.

References ocf::TOcPart::Activate(), ActivePart, and ocf::TOcPart::IsActive().

◆ AddRef()

owl::ulong _IFUNC ocf::TOcView::AddRef ( )
inline

Definition at line 197 of file ocview.h.

◆ AllowInPlace()

HRESULT _IFUNC ocf::TOcView::AllowInPlace ( )
protectedvirtual

Implements ocf::IBContainer.

Definition at line 830 of file ocview.cpp.

References HR_FALSE, HR_NOERROR, IsOptionSet(), and ocf::voNoInPlace.

◆ AppendWindowTitle()

void _IFUNC ocf::TOcView::AppendWindowTitle ( LPCOLESTR title)
protectedvirtual

Append server's doc title info to our view's window title.

Implements ocf::IBWindow.

Definition at line 605 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewSetTitle(), owl::GetGlobalModule(), GetWindowTitle(), owl::TModule::LoadString(), OleStr, and WinTitle.

◆ BringToFront()

HRESULT _IFUNC ocf::TOcView::BringToFront ( )
protectedvirtual

Implements ocf::IBContainer.

Definition at line 795 of file ocview.cpp.

References GetWindow(), HR_NOERROR, and OcApp.

◆ BrowseClipboard()

bool ocf::TOcView::BrowseClipboard ( TOcInitInfo & initInfo)

Definition at line 928 of file ocview.cpp.

References ocf::TOcApp::BrowseClipboard(), and OcApp.

◆ BrowseLinks()

bool ocf::TOcView::BrowseLinks ( )

Definition at line 375 of file ocview.cpp.

References BDocumentI, ocf::IBDocument::BrowseLinks(), and ocf::HRSucceeded().

◆ CountFormats()

uint _IFUNC ocf::TOcView::CountFormats ( )
protectedvirtual

Format count.

Implements ocf::IBDataNegotiator.

Definition at line 543 of file ocview.cpp.

References ocf::TOcFormatList::Count(), and FormatList.

◆ DragFeedback()

void _IFUNC ocf::TOcView::DragFeedback ( owl::TPoint * where,
const owl::TRect * objPos,
TOcMouseAction ,
owl::uint ,
HRESULT & hr )
protectedvirtual

Provide feedback to the users drag action in our container window.

Implements ocf::IBDropDest.

Definition at line 743 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewDrag(), ocf::HRFailIfZero(), and PRECONDITION.

◆ Drop()

HRESULT _IFUNC ocf::TOcView::Drop ( TOcInitInfo * initInfo,
owl::TPoint * where,
const owl::TRect * objPos )
protectedvirtual

Drop a part onto this view.

Creates the part based on initInfo, activating it as appropriate

Implements ocf::IBDropDest.

Definition at line 706 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewDrop(), HR_FAIL, HR_NOERROR, OcDocument, PasteNative(), PRECONDITION, Rename(), and TOcPart.

◆ EnumLinks()

bool ocf::TOcView::EnumLinks ( IBLinkInfo ** linkInfo)

Definition at line 364 of file ocview.cpp.

References BDocumentI, ocf::IBDocument::EnumLinks(), ocf::HRSucceeded(), and PRECONDITION.

◆ EvActivate()

void ocf::TOcView::EvActivate ( bool activate)

View is activated/deactivated.

Definition at line 338 of file ocview.cpp.

References BDocumentI, OcDocument, ocf::IBDocument::OnActivate(), and ocf::TOcDocument::SetActiveView().

◆ EvClose()

void ocf::TOcView::EvClose ( )
virtual

◆ EvResize()

void ocf::TOcView::EvResize ( )

Definition at line 303 of file ocview.cpp.

References BDocumentI, and ocf::IBDocument::OnResize().

◆ EvSetFocus()

bool ocf::TOcView::EvSetFocus ( bool set)
virtual

Returns true if view keeps focus, false if the inplace server got it.

Reimplemented in ocf::TOcRemView.

Definition at line 352 of file ocview.cpp.

References BDocumentI, ocf::TOcApp::EvSetFocus(), OcApp, and ocf::IBDocument::OnSetFocus().

◆ FindDropDest()

HRESULT _IFUNC ocf::TOcView::FindDropDest ( owl::TPoint * ,
IBDropDest ** dropDest )
protectedvirtual

Locate the drop destination object.

For default OC, it is just this view. Other extensions might have subtargets within the view.

Implements ocf::IBContainer.

Definition at line 785 of file ocview.cpp.

References HR_NOERROR.

◆ ForwardEvent() [1/2]

owl::TResult ocf::TOcView::ForwardEvent ( int eventId,
const void * param )
inlineprotected

Definition at line 744 of file ocview.h.

References ContainerHost, and ForwardEvent().

◆ ForwardEvent() [2/2]

owl::TResult ocf::TOcView::ForwardEvent ( int eventId,
owl::TParam2 param = 0 )
inlineprotected

Definition at line 751 of file ocview.h.

References ContainerHost, and ForwardEvent().

◆ GetAccelerators()

HRESULT _IFUNC ocf::TOcView::GetAccelerators ( HACCEL * ,
int *  )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 693 of file ocview.cpp.

References HR_FAIL.

◆ GetActivePart()

TOcPart * ocf::TOcView::GetActivePart ( )
inline

Definition at line 178 of file ocview.h.

◆ GetDocLink()

TOcLinkView * ocf::TOcView::GetDocLink ( LPCTSTR name = 0)

◆ GetFormat()

HRESULT _IFUNC ocf::TOcView::GetFormat ( owl::uint index,
TOcFormatInfo * fmt )
protectedvirtual

Format retrieval.

Implements ocf::IBDataNegotiator.

Definition at line 552 of file ocview.cpp.

References CountFormats(), FormatList, HR_NOERROR, LinkFormat, and PRECONDITION.

◆ GetLinkable()

IBRootLinkable * ocf::TOcView::GetLinkable ( )
inline

Definition at line 152 of file ocview.h.

◆ GetOcData()

TOcDataProvider * ocf::TOcView::GetOcData ( )
inline

Definition at line 161 of file ocview.h.

◆ GetOcDocument()

TOcDocument & ocf::TOcView::GetOcDocument ( )
inline

Definition at line 148 of file ocview.h.

◆ GetOrigin()

owl::TPoint ocf::TOcView::GetOrigin ( ) const
inline

Definition at line 166 of file ocview.h.

◆ GetPart()

HRESULT _IFUNC ocf::TOcView::GetPart ( IBPart ** bpart,
LPCOLESTR name )
protectedvirtual

◆ GetScrollRect()

HRESULT _IFUNC ocf::TOcView::GetScrollRect ( owl::TRect * )
protectedvirtual

Implements ocf::IBDropDest.

Definition at line 772 of file ocview.cpp.

References HR_NOERROR.

◆ GetWindow()

HWND _IFUNC ocf::TOcView::GetWindow ( )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 572 of file ocview.cpp.

References ContainerHost, and ocf::TOcContainerHost::EvOcGetWindow().

◆ GetWindowRect() [1/2]

TRect ocf::TOcView::GetWindowRect ( ) const

Return the client rect for the view window.

Definition at line 411 of file ocview.cpp.

References GetWindowRect().

◆ GetWindowRect() [2/2]

HRESULT _IFUNC ocf::TOcView::GetWindowRect ( owl::TRect * r)
protectedvirtual

Implements ocf::IBWindow.

Definition at line 581 of file ocview.cpp.

References GetWindow(), HR_NOERROR, and PRECONDITION.

◆ GetWindowTitle()

LPCOLESTR _IFUNC ocf::TOcView::GetWindowTitle ( )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 593 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewTitle(), and OrgTitle.

◆ Init()

HRESULT _IFUNC ocf::TOcView::Init ( LPCOLESTR path)
protectedvirtual

Ask the container to load document named 'path'.

Implements ocf::IBContains.

Definition at line 488 of file ocview.cpp.

References CHECK, ContainerHost, ocf::TOcContainerHost::EvOcViewOpenDoc(), ocf::HRFailIfZero(), OcDocument, OleStr, Rename(), and ocf::TOcDocument::SetName().

◆ InsertContainerMenus()

HRESULT _IFUNC ocf::TOcView::InsertContainerMenus ( HMENU ,
TOcMenuWidths *  )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 657 of file ocview.cpp.

References HR_FAIL.

◆ InvalidatePart()

void ocf::TOcView::InvalidatePart ( TOcPartChangeInfo & changeInfo)

◆ IsOptionSet()

bool ocf::TOcView::IsOptionSet ( owl::uint32 option) const
inline

Definition at line 857 of file ocview.h.

References Options, and owl::ToBool().

◆ Paste()

bool ocf::TOcView::Paste ( bool linking = false)

◆ PasteNative()

◆ QueryInterface()

HRESULT _IFUNC ocf::TOcView::QueryInterface ( const GUID & iid,
void ** iface )
inline

Definition at line 199 of file ocview.h.

◆ QueryObject()

HRESULT ocf::TOcView::QueryObject ( const IID & iid,
void ** iface )
protected

Callback from TUnknown's implementation of QueryInterface.

Definition at line 190 of file ocview.cpp.

References BContainer, BDocument, GetDocLink(), HR_NOINTERFACE, and PRECONDITION.

◆ RegisterClipFormats()

bool ocf::TOcView::RegisterClipFormats ( owl::TRegList & regList)

Register the clipboard formats supported.

Definition at line 845 of file ocview.cpp.

References _istdigit, _T, _tcschr, _tcscpy, _ttoi, _USES_CONVERSION, _W2A, ocf::TOcFormatList::Add(), FormatList, and OcApp.

◆ Release()

owl::ulong _IFUNC ocf::TOcView::Release ( )
inline

Definition at line 198 of file ocview.h.

◆ ReleaseObject()

void ocf::TOcView::ReleaseObject ( )
virtual

Should only be called by the owner/creator of this object.

Releases host interfaces and this.

Reimplemented in ocf::TOcRemView.

Definition at line 173 of file ocview.cpp.

References ContainerHost, Release(), ocf::TOcContainerHost::ReleaseOcObject(), ocf::TOcServerHost::ReleaseOcObject(), and ServerHost.

◆ Rename()

void ocf::TOcView::Rename ( )
virtual

◆ RequestBorderSpace()

HRESULT _IFUNC ocf::TOcView::RequestBorderSpace ( const owl::TRect * space)
protectedvirtual

◆ RestoreUI()

void _IFUNC ocf::TOcView::RestoreUI ( )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 675 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewSetTitle(), and WinTitle.

◆ Scroll()

HRESULT _IFUNC ocf::TOcView::Scroll ( TOcScrollDir scrollDir)
protectedvirtual

Ask the container view window to scroll itself in a given direction.

Asked by the server when dragging or working in a clipped site.

Implements ocf::IBDropDest.

Definition at line 759 of file ocview.cpp.

References ContainerHost, ocf::TOcContainerHost::EvOcViewScroll(), HR_FALSE, and HR_NOERROR.

◆ ScrollWindow()

void ocf::TOcView::ScrollWindow ( int dx,
int dy )

Scroll this container window a give dx,dy.

Definition at line 422 of file ocview.cpp.

References Origin.

◆ SetActivePart()

void ocf::TOcView::SetActivePart ( TOcPart * part)
inline

Definition at line 179 of file ocview.h.

◆ SetBorderSpace()

HRESULT _IFUNC ocf::TOcView::SetBorderSpace ( const owl::TRect * space)
protectedvirtual

◆ SetFrameMenu()

HRESULT _IFUNC ocf::TOcView::SetFrameMenu ( HMENU )
protectedvirtual

Implements ocf::IBWindow.

Definition at line 666 of file ocview.cpp.

References HR_FAIL.

◆ SetOcData()

void ocf::TOcView::SetOcData ( TOcDataProvider * ocData = 0)
inline

Definition at line 160 of file ocview.h.

◆ SetOption()

void ocf::TOcView::SetOption ( owl::uint32 bit,
bool state )
inline

Definition at line 863 of file ocview.h.

References Options.

◆ SetStatusText()

HRESULT _IFUNC ocf::TOcView::SetStatusText ( LPCOLESTR text)
protectedvirtual

Implements ocf::IBWindow.

Definition at line 620 of file ocview.cpp.

References HR_FAIL.

◆ SetupWindow()

void ocf::TOcView::SetupWindow ( HWND hWin,
bool embedded = false )

◆ Shutdown()

void ocf::TOcView::Shutdown ( )
protected

Called from destructor of this class or of derived class to release helpers and host interfaces.

Definition at line 148 of file ocview.cpp.

References BContainer, BDocument, ContainerHost, ocf::TOcContainerHost::ReleaseOcObject(), ocf::TOcServerHost::ReleaseOcObject(), and ServerHost.

◆ UpdateLinks()

bool ocf::TOcView::UpdateLinks ( )

Definition at line 384 of file ocview.cpp.

References BDocumentI, ocf::HRSucceeded(), and ocf::IBDocument::UpdateLinks().

Friends And Related Symbol Documentation

◆ TOcControl

Definition at line 291 of file ocview.h.

◆ TOcControlEvent

Definition at line 292 of file ocview.h.

◆ TOcDataProvider

Definition at line 294 of file ocview.h.

◆ TOcLinkView

Definition at line 295 of file ocview.h.

◆ TOcPart

Definition at line 293 of file ocview.h.

Member Data Documentation

◆ ActivePart

TOcPart* ocf::TOcView::ActivePart
protected

Currently active part, if any.

Definition at line 278 of file ocview.h.

◆ BContainer

IUnknown* ocf::TOcView::BContainer
protected

Container helper object.

Definition at line 264 of file ocview.h.

◆ BDocument

IUnknown* ocf::TOcView::BDocument
protected

Document helper object.

Definition at line 262 of file ocview.h.

◆ BDocumentI

IBDocument* ocf::TOcView::BDocumentI
protected

Document interface on the document.

Definition at line 263 of file ocview.h.

◆ BLDocumentI

IBRootLinkable* ocf::TOcView::BLDocumentI
protected

RootLinkable interface on the container.

Definition at line 265 of file ocview.h.

◆ ContainerHost

TOcContainerHost* ocf::TOcView::ContainerHost
protected

The hosting app's container object.

Definition at line 272 of file ocview.h.

◆ Extent

owl::TSize ocf::TOcView::Extent
protected

Definition at line 283 of file ocview.h.

◆ FormatList

TOcFormatList ocf::TOcView::FormatList
protected

Definition at line 285 of file ocview.h.

◆ LinkFormat

int ocf::TOcView::LinkFormat
protected

adjustment for format count

Definition at line 287 of file ocview.h.

◆ OcApp

TOcApp& ocf::TOcView::OcApp
protected

Our OC application object.

Definition at line 269 of file ocview.h.

◆ OcData

TOcDataProvider* ocf::TOcView::OcData
protected

Dataprovider representing this view.

Definition at line 289 of file ocview.h.

◆ OcDocument

TOcDocument& ocf::TOcView::OcDocument
protected

Our OC document object.

Definition at line 270 of file ocview.h.

◆ Options

owl::uint32 ocf::TOcView::Options
protected

Definition at line 280 of file ocview.h.

◆ OrgTitle

owl::TString ocf::TOcView::OrgTitle
protected

Original window title string.

Definition at line 286 of file ocview.h.

◆ Origin

owl::TPoint ocf::TOcView::Origin
protected

Definition at line 282 of file ocview.h.

◆ RegList

owl::TRegList* ocf::TOcView::RegList
protected

Definition at line 288 of file ocview.h.

◆ ServerHost

TOcServerHost* ocf::TOcView::ServerHost
protected

The hosting app's server object.

Definition at line 273 of file ocview.h.

◆ WinTitle

owl::tstring ocf::TOcView::WinTitle
protected

Definition at line 284 of file ocview.h.


The documentation for this class was generated from the following files: