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

Class representing an embedded control within a document. More...

#include <ocf/occtrl.h>

Inheritance diagram for ocf::TOcControl:
ocf::TOcPart ocf::IBControlSite ocf::TUnknown ocf::IBSite2 ocf::IBSite

Public Member Functions

 TOcControl (TOcDocument &document, int id=0, TOcControlEvent *pEv=nullptr)
 Construct a new part with a given temp id.
 
 TOcControl (TOcDocument &document, LPCTSTR name)
 Construct a part from a named stream in an oc doc's storage.
 
bool Init (TOcInitInfo *initInfo, owl::TRect pos)
 
IBControlGetBControlI ()
 
TOcViewGetActiveControlView ()
 
ITypeInfoGetEventTypeInfo ()
 Retrieves the ITypeInfo the 'default source' event object of this control.
 
IDispatchGetCtlDispatch ()
 Retrieves the primary IDispatch of the control.
 
void SetDefault (bool def)
 
void SetCancel (bool cancel)
 
void SetUserName (owl::TString &name)
 Extended property support.
 
owl::uint GetId () const
 
void SetId (owl::uint id)
 
bool FillEventList ()
 Retrieves a list of events generated by this control.
 
TEventListGetEventList () const
 
bool IsCancel () const
 
bool IsDefault () const
 
long GetLeft ()
 
long GetTop ()
 
long GetWidth ()
 
long GetHeight ()
 
void SetLeft (long Value)
 
void SetWidth (long Value)
 
void SetTop (long Value)
 
void SetHeight (long Value)
 
owl::TStringGetUserName ()
 
IDispatchGetParent ()
 Retrieves the extended IDispatch (exposing extended properties)
 
HRESULT Refresh ()
 
HRESULT DoClick ()
 
HRESULT AboutBox ()
 
- Public Member Functions inherited from ocf::TOcPart
 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.
 
void Delete ()
 Delete this object.
 
bool operator== (const TOcPart &other)
 
IBPartGetBPartI ()
 
TOcStorageGetStorage ()
 
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)
 

Public Attributes

 TUNKNOWN_STANDARD_IUNKNOWN_METHODS
 

Protected Member Functions

 ~TOcControl ()
 
bool InitObj (TOcInitInfo *initInfo)
 Perform common ctor initialization.
 
TUnknownCreateAutoObject (const void *obj, TAutoClass &clsInfo)
 
HRESULT QueryObject (const IID &iid, void **iface)
 Callback from TUnknown's implementation of QueryInterface.
 
HRESULT _IFUNC Init (UINT, IBControl *, UINT)
 
HRESULT _IFUNC OnPropertyChanged (DISPID dispid)
 
HRESULT _IFUNC OnPropertyRequestEdit (DISPID dispid)
 
HRESULT _IFUNC OnControlFocus (BOOL fGotFocus)
 Event support.
 
HRESULT _IFUNC TransformCoords (owl::TPointL *lpptlHimetric, owl::TPointF *lpptfContainer, DWORD flags)
 
HRESULT _IFUNC Init (IBDataProvider *dp, IBPart *p, LPCOLESTR s, BOOL b)
 
void SetEventDispatch ()
 
- Protected Member Functions inherited from ocf::TOcPart
 ~TOcPart ()
 
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

IBControlBCtrlI
 
owl::TStringpUserName
 
TServedObjectpIExtended
 
TOcControlEventpEvents
 
bool pEventsOwnership
 
owl::uint CtlId
 
TEventListEventList
 
friend TOcControlEvent
 
- Protected Attributes inherited from ocf::TOcPart
IUnknown * BPart
 Our corresponding helper object & interfaces.
 
IBPartBPartI
 
IBLinkableBLPartI
 
TOcDocumentOcDocument
 The OC document we are imbeded in.
 
TOcStorageStorage
 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
 

Additional Inherited Members

- Protected Types inherited from ocf::TOcPart
enum  TFlag { Visible =0x01 , Selected =0x02 , Active =0x04 , Link =0x08 , Closing =0x10 , OcxDefault =0x20 , OcxCancel =0x40 }
 

Detailed Description

Class representing an embedded control within a document.

Todo
Research this, as it is not true: change from protected IBControlSite to public IBControlSite -> c++ syntax in DECLARE_AUTOCLASS(TOcControl) exist conversion to IDispatch

Definition at line 78 of file occtrl.h.

Constructor & Destructor Documentation

◆ TOcControl() [1/2]

ocf::TOcControl::TOcControl ( TOcDocument & document,
int id = 0,
TOcControlEvent * pEv = nullptr )

Construct a new part with a given temp id.

Definition at line 226 of file occtrl.cpp.

References ocf::TOcPart::GetName(), pEvents, pEventsOwnership, and pUserName.

◆ TOcControl() [2/2]

ocf::TOcControl::TOcControl ( TOcDocument & document,
LPCTSTR name )

Construct a part from a named stream in an oc doc's storage.

Definition at line 240 of file occtrl.cpp.

References pEventsOwnership.

◆ ~TOcControl()

ocf::TOcControl::~TOcControl ( )
protected

Member Function Documentation

◆ AboutBox()

HRESULT ocf::TOcControl::AboutBox ( )
inline

Definition at line 133 of file occtrl.h.

◆ CreateAutoObject()

TUnknown * ocf::TOcControl::CreateAutoObject ( const void * obj,
TAutoClass & clsInfo )
protected

◆ DoClick()

HRESULT ocf::TOcControl::DoClick ( )
inline

Definition at line 132 of file occtrl.h.

◆ FillEventList()

bool ocf::TOcControl::FillEventList ( )

Retrieves a list of events generated by this control.

Returns true if the event list was successfully retrieved.

Definition at line 373 of file occtrl.cpp.

References EventList, ocf::TEventList::GetCount(), and GetEventTypeInfo().

◆ GetActiveControlView()

TOcView * ocf::TOcControl::GetActiveControlView ( )

Definition at line 491 of file occtrl.cpp.

References ocf::TOcDocument::GetActiveView(), and ocf::TOcPart::OcDocument.

◆ GetBControlI()

IBControl * ocf::TOcControl::GetBControlI ( )
inline

Definition at line 93 of file occtrl.h.

◆ GetCtlDispatch()

IDispatch * ocf::TOcControl::GetCtlDispatch ( )

Retrieves the primary IDispatch of the control.

Note
Receiver must 'Release' the returned object, if successful.

Definition at line 407 of file occtrl.cpp.

References GetBControlI(), and ocf::IBControl::GetCtrlDispatch().

◆ GetEventList()

TEventList * ocf::TOcControl::GetEventList ( ) const

Definition at line 397 of file occtrl.cpp.

References EventList.

◆ GetEventTypeInfo()

ITypeInfo * ocf::TOcControl::GetEventTypeInfo ( )

Retrieves the ITypeInfo the 'default source' event object of this control.

Note
Receiver must 'Release' the returned object, if successful.

Definition at line 360 of file occtrl.cpp.

References GetBControlI(), and ocf::IBControl::GetEventTypeInfo().

◆ GetHeight()

long ocf::TOcControl::GetHeight ( )
inline

Definition at line 121 of file occtrl.h.

◆ GetId()

owl::uint ocf::TOcControl::GetId ( ) const
inline

Definition at line 106 of file occtrl.h.

◆ GetLeft()

long ocf::TOcControl::GetLeft ( )
inline

Definition at line 118 of file occtrl.h.

◆ GetParent()

IDispatch * ocf::TOcControl::GetParent ( )

Retrieves the extended IDispatch (exposing extended properties)

Definition at line 557 of file occtrl.cpp.

References ocf::TOcDocument::GetActiveView(), ocf::HRSucceeded(), and ocf::TOcPart::OcDocument.

◆ GetTop()

long ocf::TOcControl::GetTop ( )
inline

Definition at line 119 of file occtrl.h.

◆ GetUserName()

TString & ocf::TOcControl::GetUserName ( )

Definition at line 548 of file occtrl.cpp.

References pUserName.

◆ GetWidth()

long ocf::TOcControl::GetWidth ( )
inline

Definition at line 120 of file occtrl.h.

◆ Init() [1/3]

HRESULT _IFUNC ocf::TOcControl::Init ( IBDataProvider * dp,
IBPart * p,
LPCOLESTR s,
BOOL b )
inlineprotectedvirtual

Implements ocf::IBSite.

Definition at line 169 of file occtrl.h.

◆ Init() [2/3]

bool ocf::TOcControl::Init ( TOcInitInfo * initInfo,
owl::TRect pos )
virtual

Reimplemented from ocf::TOcPart.

Definition at line 265 of file occtrl.cpp.

References ocf::TOcPart::Init().

◆ Init() [3/3]

HRESULT _IFUNC ocf::TOcControl::Init ( UINT ,
IBControl * ,
UINT  )
protectedvirtual

Implements ocf::IBControlSite.

Definition at line 698 of file occtrl.cpp.

◆ InitObj()

◆ IsCancel()

bool ocf::TOcControl::IsCancel ( ) const
inline

Definition at line 116 of file occtrl.h.

◆ IsDefault()

bool ocf::TOcControl::IsDefault ( ) const
inline

Definition at line 117 of file occtrl.h.

◆ OnControlFocus()

HRESULT _IFUNC ocf::TOcControl::OnControlFocus ( BOOL fGotFocus)
protectedvirtual

Event support.

Implements ocf::IBControlSite.

Definition at line 616 of file occtrl.cpp.

References ocf::TOcDocument::GetActiveView(), HR_FAIL, HR_NOERROR, OC_CTRLEVENT_FOCUS, and ocf::TOcPart::OcDocument.

◆ OnPropertyChanged()

HRESULT _IFUNC ocf::TOcControl::OnPropertyChanged ( DISPID dispid)
protectedvirtual

◆ OnPropertyRequestEdit()

HRESULT _IFUNC ocf::TOcControl::OnPropertyRequestEdit ( DISPID dispid)
protectedvirtual

◆ QueryObject()

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

Callback from TUnknown's implementation of QueryInterface.

Definition at line 518 of file occtrl.cpp.

References ocf::HRSucceeded(), pIExtended, PRECONDITION, ocf::TServedObject::QueryObject(), and ocf::TOcPart::QueryObject().

◆ Refresh()

HRESULT ocf::TOcControl::Refresh ( )
inline

Definition at line 131 of file occtrl.h.

◆ SetCancel()

void ocf::TOcControl::SetCancel ( bool cancel)
inline

Definition at line 103 of file occtrl.h.

◆ SetDefault()

void ocf::TOcControl::SetDefault ( bool def)
inline

Definition at line 101 of file occtrl.h.

◆ SetEventDispatch()

◆ SetHeight()

void ocf::TOcControl::SetHeight ( long Value)

◆ SetId()

void ocf::TOcControl::SetId ( owl::uint id)
inline

Definition at line 107 of file occtrl.h.

◆ SetLeft()

void ocf::TOcControl::SetLeft ( long Value)

Definition at line 572 of file occtrl.cpp.

References ocf::TOcPart::Pos, ocf::TOcPart::SetPos(), and ocf::TOcPart::UpdateRect().

◆ SetTop()

void ocf::TOcControl::SetTop ( long Value)

Definition at line 594 of file occtrl.cpp.

References ocf::TOcPart::Pos, ocf::TOcPart::SetPos(), and ocf::TOcPart::UpdateRect().

◆ SetUserName()

void ocf::TOcControl::SetUserName ( owl::TString & name)

Extended property support.

Definition at line 539 of file occtrl.cpp.

References pUserName.

◆ SetWidth()

void ocf::TOcControl::SetWidth ( long Value)

◆ TransformCoords()

HRESULT _IFUNC ocf::TOcControl::TransformCoords ( owl::TPointL * lpptlHimetric,
owl::TPointF * lpptfContainer,
DWORD flags )
protectedvirtual

Member Data Documentation

◆ BCtrlI

IBControl* ocf::TOcControl::BCtrlI
protected

Definition at line 150 of file occtrl.h.

◆ CtlId

owl::uint ocf::TOcControl::CtlId
protected

Definition at line 155 of file occtrl.h.

◆ EventList

TEventList* ocf::TOcControl::EventList
protected

Definition at line 156 of file occtrl.h.

◆ pEvents

TOcControlEvent* ocf::TOcControl::pEvents
protected

Definition at line 153 of file occtrl.h.

◆ pEventsOwnership

bool ocf::TOcControl::pEventsOwnership
protected

Definition at line 154 of file occtrl.h.

◆ pIExtended

TServedObject* ocf::TOcControl::pIExtended
protected

Definition at line 152 of file occtrl.h.

◆ pUserName

owl::TString* ocf::TOcControl::pUserName
protected

Definition at line 151 of file occtrl.h.

◆ TOcControlEvent

friend ocf::TOcControl::TOcControlEvent
protected

Definition at line 194 of file occtrl.h.

◆ TUNKNOWN_STANDARD_IUNKNOWN_METHODS

ocf::TOcControl::TUNKNOWN_STANDARD_IUNKNOWN_METHODS

Definition at line 89 of file occtrl.h.


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