LibreOffice Module sfx2 (master) 1
|
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>
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 | |
SfxBindings & | GetBindings () |
const SfxBindings & | GetBindings () 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 () |
SfxControllerItem * | GetItemLink () |
SfxControllerItem * | ChangeItemLink (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 | |
ItemUpdateReceiverInterface & | mrItemUpdateReceiver |
Additional Inherited Members | |
Static Public Member Functions inherited from SfxControllerItem | |
static SfxItemState | GetItemState (const SfxPoolItem *pState) |
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.
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.
|
overridevirtual |
Definition at line 38 of file ControllerItem.cxx.
References SfxControllerItem::dispose().
|
overrideprivatevirtual |
Reimplemented from SfxControllerItem.
Definition at line 51 of file ControllerItem.cxx.
References sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface::GetControlState(), and mrItemUpdateReceiver.
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().
|
overrideprivatevirtual |
Reimplemented from SfxControllerItem.
Definition at line 43 of file ControllerItem.cxx.
References mrItemUpdateReceiver, and sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface::NotifyItemUpdate().
|
private |
Definition at line 74 of file ControllerItem.hxx.
Referenced by GetControlState(), RequestUpdate(), and StateChangedAtToolBoxControl().