LibreOffice Module sfx2 (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
sfx2::sidebar::ControllerItem Class Referencefinal

The sfx2::sidebar::ControllerItem is a wrapper around the SfxControllerItem that becomes necessary to allow objects (think sidebar panels) to receive state changes without having one SfxControllerItem per supported item as base class (which is not possible in C++ anyway). More...

#include <ControllerItem.hxx>

Inheritance diagram for sfx2::sidebar::ControllerItem:
[legend]
Collaboration diagram for sfx2::sidebar::ControllerItem:
[legend]

Classes

class  ItemUpdateReceiverInterface
 

Public Member Functions

 ControllerItem (const sal_uInt16 nId, SfxBindings &rBindings, ItemUpdateReceiverInterface &rItemUpdateReceiver)
 This is the simpler constructor variant that still exists for compatibility reasons. More...
 
virtual ~ControllerItem () override
 
void RequestUpdate ()
 Force the controller item to call its NotifyItemUpdate callback with up-to-date data. More...
 
- Public Member Functions inherited from SfxControllerItem
SfxBindingsGetBindings ()
 
const SfxBindingsGetBindings () const
 
 SfxControllerItem ()
 
 SfxControllerItem (sal_uInt16 nId, SfxBindings &)
 
virtual ~SfxControllerItem ()
 
virtual void dispose ()
 
void Bind (sal_uInt16 nNewId, SfxBindings *)
 
void UnBind ()
 
void ReBind ()
 
bool IsBound () const
 
void ClearCache ()
 
SfxControllerItemGetItemLink ()
 
SfxControllerItemChangeItemLink (SfxControllerItem *pNewLink)
 
void SetId (sal_uInt16 nItemId)
 
sal_uInt16 GetId () const
 
virtual void StateChangedAtToolBoxControl (sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState)
 
virtual void GetControlState (sal_uInt16 nSID, boost::property_tree::ptree &)
 
MapUnit GetCoreMetric () const
 
void SetFallbackCoreMetric (MapUnit eFallback)
 
SAL_DLLPRIVATE void BindInternal_Impl (sal_uInt16 nNewId, SfxBindings *)
 

Private Member Functions

virtual void StateChangedAtToolBoxControl (sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem *pState) override
 
virtual void GetControlState (sal_uInt16 nSId, boost::property_tree::ptree &rState) override
 

Private Attributes

ItemUpdateReceiverInterfacemrItemUpdateReceiver
 

Additional Inherited Members

- Static Public Member Functions inherited from SfxControllerItem
static SfxItemState GetItemState (const SfxPoolItem *pState)
 

Detailed Description

The sfx2::sidebar::ControllerItem is a wrapper around the SfxControllerItem that becomes necessary to allow objects (think sidebar panels) to receive state changes without having one SfxControllerItem per supported item as base class (which is not possible in C++ anyway).

It also gives access to the label and icon of a slot/command.

Definition at line 36 of file ControllerItem.hxx.

Constructor & Destructor Documentation

◆ ControllerItem()

sfx2::sidebar::ControllerItem::ControllerItem ( const sal_uInt16  nId,
SfxBindings rBindings,
ItemUpdateReceiverInterface rItemUpdateReceiver 
)

This is the simpler constructor variant that still exists for compatibility reasons.

Note that GetLabel() and GetIcon() will return empty strings/images.

Definition at line 29 of file ControllerItem.cxx.

◆ ~ControllerItem()

sfx2::sidebar::ControllerItem::~ControllerItem ( )
overridevirtual

Definition at line 38 of file ControllerItem.cxx.

References SfxControllerItem::dispose().

Member Function Documentation

◆ GetControlState()

void sfx2::sidebar::ControllerItem::GetControlState ( sal_uInt16  nSId,
boost::property_tree::ptree &  rState 
)
overrideprivatevirtual

◆ RequestUpdate()

void sfx2::sidebar::ControllerItem::RequestUpdate ( )

Force the controller item to call its NotifyItemUpdate callback with up-to-date data.

Definition at line 58 of file ControllerItem.cxx.

References SfxControllerItem::GetBindings(), SfxControllerItem::GetId(), mrItemUpdateReceiver, and sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface::NotifyItemUpdate().

◆ StateChangedAtToolBoxControl()

void sfx2::sidebar::ControllerItem::StateChangedAtToolBoxControl ( sal_uInt16  nSId,
SfxItemState  eState,
const SfxPoolItem pState 
)
overrideprivatevirtual

Member Data Documentation

◆ mrItemUpdateReceiver

ItemUpdateReceiverInterface& sfx2::sidebar::ControllerItem::mrItemUpdateReceiver
private

Definition at line 74 of file ControllerItem.hxx.

Referenced by GetControlState(), RequestUpdate(), and StateChangedAtToolBoxControl().


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