LibreOffice Module svl (master) 1
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SfxPoolItem Class Referenceabstract

#include <poolitem.hxx>

Inheritance diagram for SfxPoolItem:
[legend]

Public Types

typedef std::vector< SfxPoolItem * >::const_iterator lookup_iterator
 

Public Member Functions

void AddRef (sal_uInt32 n=1) const
 
virtual ~SfxPoolItem ()
 
void SetWhich (sal_uInt16 nId)
 
sal_uInt16 Which () const
 
template<class T >
T & StaticWhichCast (TypedWhichId< T > nId)
 
template<class T >
const T & StaticWhichCast (TypedWhichId< T > nId) const
 
template<class T >
T * DynamicWhichCast (TypedWhichId< T > nId)
 
template<class T >
const T * DynamicWhichCast (TypedWhichId< T > nId) const
 
virtual bool operator== (const SfxPoolItem &) const =0
 
bool operator!= (const SfxPoolItem &rItem) const
 
virtual bool operator< (const SfxPoolItem &) const
 
virtual bool IsSortable () const
 
virtual bool HasLookup () const
 
virtual lookup_iterator Lookup (lookup_iterator, lookup_iterator end) const
 
virtual bool GetPresentation (SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
 This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasses. More...
 
virtual void ScaleMetrics (tools::Long lMult, tools::Long lDiv)
 
virtual bool HasMetrics () const
 
virtual bool QueryValue (css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
 
virtual bool PutValue (const css::uno::Any &rVal, sal_uInt8 nMemberId)
 
virtual SfxPoolItemClone (SfxItemPool *pPool=nullptr) const =0
 
std::unique_ptr< SfxPoolItemCloneSetWhich (sal_uInt16 nNewWhich) const
 
template<class T >
std::unique_ptr< T > CloneSetWhich (TypedWhichId< T > nId) const
 
sal_uInt32 GetRefCount () const
 
SfxItemKind GetKind () const
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter) const
 
virtual boost::property_tree::ptree dumpAsJSON () const
 
virtual bool IsVoidItem () const
 Only SfxVoidItem shall and must return true for this. More...
 

Protected Member Functions

 SfxPoolItem (sal_uInt16 nWhich=0)
 
 SfxPoolItem (const SfxPoolItem &rCopy)
 

Private Member Functions

void SetRefCount (sal_uInt32 n)
 
void SetKind (SfxItemKind n)
 
sal_uInt32 ReleaseRef (sal_uInt32 n=1) const
 
SfxPoolItemoperator= (const SfxPoolItem &)=delete
 

Private Attributes

sal_uInt32 m_nRefCount
 
sal_uInt16 m_nWhich
 
SfxItemKind m_nKind
 

Friends

class SfxItemPool
 
class SfxItemDisruptor_Impl
 
class SfxItemPoolCache
 
class SfxItemSet
 
class SfxVoidItem
 

Detailed Description

Definition at line 115 of file poolitem.hxx.

Member Typedef Documentation

◆ lookup_iterator

typedef std::vector<SfxPoolItem*>::const_iterator SfxPoolItem::lookup_iterator

Definition at line 201 of file poolitem.hxx.

Constructor & Destructor Documentation

◆ SfxPoolItem() [1/2]

SfxPoolItem::SfxPoolItem ( sal_uInt16  nWhich = 0)
explicitprotected

Definition at line 465 of file poolitem.cxx.

References NONE.

◆ SfxPoolItem() [2/2]

SfxPoolItem::SfxPoolItem ( const SfxPoolItem rCopy)
inlineprotected

Definition at line 137 of file poolitem.hxx.

◆ ~SfxPoolItem()

SfxPoolItem::~SfxPoolItem ( )
virtual

Definition at line 473 of file poolitem.cxx.

References m_nRefCount, and SFX_ITEMS_MAXREF.

Member Function Documentation

◆ AddRef()

void SfxPoolItem::AddRef ( sal_uInt32  n = 1) const
inline

◆ Clone()

virtual SfxPoolItem * SfxPoolItem::Clone ( SfxItemPool pPool = nullptr) const
pure virtual

◆ CloneSetWhich() [1/2]

std::unique_ptr< SfxPoolItem > SfxPoolItem::CloneSetWhich ( sal_uInt16  nNewWhich) const

Definition at line 557 of file poolitem.cxx.

References Clone().

Referenced by CloneSetWhich().

◆ CloneSetWhich() [2/2]

template<class T >
std::unique_ptr< T > SfxPoolItem::CloneSetWhich ( TypedWhichId< T >  nId) const
inline

Definition at line 221 of file poolitem.hxx.

References CloneSetWhich(), and nId.

◆ dumpAsJSON()

boost::property_tree::ptree SfxPoolItem::dumpAsJSON ( ) const
virtual

◆ dumpAsXml()

void SfxPoolItem::dumpAsXml ( xmlTextWriterPtr  pWriter) const
virtual

Reimplemented in SfxBoolItem, SfxUInt16Item, SfxInt32Item, SfxUInt32Item, SfxVoidItem, and SfxStringItem.

Definition at line 534 of file poolitem.cxx.

References Complete, GetPresentation(), and Which().

Referenced by SfxBoolItem::dumpAsXml().

◆ DynamicWhichCast() [1/2]

template<class T >
T * SfxPoolItem::DynamicWhichCast ( TypedWhichId< T >  nId)
inline

Definition at line 169 of file poolitem.hxx.

References m_nWhich, and nId.

◆ DynamicWhichCast() [2/2]

template<class T >
const T * SfxPoolItem::DynamicWhichCast ( TypedWhichId< T >  nId) const
inline

Definition at line 176 of file poolitem.hxx.

References m_nWhich, and nId.

◆ GetKind()

SfxItemKind SfxPoolItem::GetKind ( ) const
inline

Definition at line 227 of file poolitem.hxx.

References m_nKind.

Referenced by IsDefaultItem(), IsPoolDefaultItem(), IsStaticDefaultItem(), and SfxItemPool::PutImpl().

◆ GetPresentation()

bool SfxPoolItem::GetPresentation ( SfxItemPresentation  ePresentation,
MapUnit  eCoreMetric,
MapUnit  ePresentationMetric,
OUString &  rText,
const IntlWrapper rIntlWrapper 
) const
virtual

This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasses.

Returns
true if it has a valid string representation

It should be overridden by all UI-relevant SfxPoolItem subclasses.

Because the unit of measure of the value in the SfxItemPool is only queryable via

See also
SfxItemPool::GetMetric(sal_uInt16) const (and not via the SfxPoolItem instance or subclass, the own unit of measure is passed to 'eCoreMetric'.

The corresponding unit of measure is passed as 'ePresentationMetric'.

Returns
SfxItemPresentation SfxItemPresentation::Nameless A textual representation (if applicable with a unit of measure) could be created, but it doesn't contain any semantic meaning

SfxItemPresentation::Complete A complete textual representation could be created with semantic meaning (if applicable with unit of measure)

Example:

pSvxFontItem->GetPresentation( SFX_PRESENTATION_NAMELESS, ... ) "12pt" with return SfxItemPresentation::Nameless

pSvxColorItem->GetPresentation( SFX_PRESENTATION_COMPLETE, ... ) "red" with return SfxItemPresentation::Nameless Because the SvxColorItem does not know which color it represents it cannot provide a name, which is communicated by the return value

pSvxBorderItem->GetPresentation( SFX_PRESENTATION_COMPLETE, ... ) "1cm top border, 2cm left border, 0.2cm bottom border, ..."

Reimplemented in SfxFlagItem, SvxMacroItem, SfxVoidItem, SfxPointItem, SfxRectangleItem, SfxRangeItem, SfxSetItem, SfxStringListItem, SvxSearchItem, SfxEnumItemInterface, CntByteItem, CntUInt16Item, CntInt32Item, CntUInt32Item, CntUnencodedStringItem, SfxBoolItem, SfxInt16Item, SfxVisibilityItem, and SfxInt64Item.

Definition at line 524 of file poolitem.cxx.

Referenced by dumpAsXml(), and SfxItemPool::GetPresentation().

◆ GetRefCount()

sal_uInt32 SfxPoolItem::GetRefCount ( ) const
inline

◆ HasLookup()

virtual bool SfxPoolItem::HasLookup ( ) const
inlinevirtual

Definition at line 200 of file poolitem.hxx.

Referenced by SfxItemPool::PutImpl().

◆ HasMetrics()

bool SfxPoolItem::HasMetrics ( ) const
virtual

Reimplemented in SfxMetricItem.

Definition at line 602 of file poolitem.cxx.

◆ IsSortable()

virtual bool SfxPoolItem::IsSortable ( ) const
inlinevirtual

Reimplemented in CntUnencodedStringItem.

Definition at line 190 of file poolitem.hxx.

Referenced by SfxPoolItemArray_Impl::insert(), and SfxItemPool::PutImpl().

◆ IsVoidItem()

bool SfxPoolItem::IsVoidItem ( ) const
virtual

Only SfxVoidItem shall and must return true for this.

This avoids costly calls to dynamic_cast<const SfxVoidItem*>() specifically in SfxItemSet::GetItemState()

Reimplemented in SfxVoidItem.

Definition at line 564 of file poolitem.cxx.

Referenced by SfxItemSet::Get().

◆ Lookup()

virtual lookup_iterator SfxPoolItem::Lookup ( lookup_iterator  ,
lookup_iterator  end 
) const
inlinevirtual

Definition at line 202 of file poolitem.hxx.

References end.

Referenced by SfxItemPool::PutImpl().

◆ operator!=()

bool SfxPoolItem::operator!= ( const SfxPoolItem rItem) const
inline

Definition at line 184 of file poolitem.hxx.

◆ operator<()

virtual bool SfxPoolItem::operator< ( const SfxPoolItem ) const
inlinevirtual

Reimplemented in CntUnencodedStringItem.

Definition at line 189 of file poolitem.hxx.

◆ operator=()

SfxPoolItem & SfxPoolItem::operator= ( const SfxPoolItem )
privatedelete

◆ operator==()

bool SfxPoolItem::operator== ( const SfxPoolItem rCmp) const
pure virtual

◆ PutValue()

bool SfxPoolItem::PutValue ( const css::uno::Any &  rVal,
sal_uInt8  nMemberId 
)
virtual

◆ QueryValue()

bool SfxPoolItem::QueryValue ( css::uno::Any &  rVal,
sal_uInt8  nMemberId = 0 
) const
virtual

◆ ReleaseRef()

sal_uInt32 SfxPoolItem::ReleaseRef ( sal_uInt32  n = 1) const
inlineprivate

Definition at line 261 of file poolitem.hxx.

References m_nRefCount, n, and SFX_ITEMS_MAXREF.

Referenced by SfxItemPool::ReleaseRef(), and SfxItemSet::~SfxItemSet().

◆ ScaleMetrics()

void SfxPoolItem::ScaleMetrics ( tools::Long  lMult,
tools::Long  lDiv 
)
virtual

Reimplemented in SfxMetricItem.

Definition at line 600 of file poolitem.cxx.

◆ SetKind()

void SfxPoolItem::SetKind ( SfxItemKind  n)
inlineprivate

Definition at line 248 of file poolitem.hxx.

References m_nKind, m_nRefCount, n, and SFX_ITEMS_SPECIAL.

Referenced by SfxItemPool::SetPoolDefaultItem().

◆ SetRefCount()

void SfxPoolItem::SetRefCount ( sal_uInt32  n)
inlineprivate

Definition at line 242 of file poolitem.hxx.

References m_nKind, m_nRefCount, n, and NONE.

Referenced by SfxItemPool::ClearRefCount().

◆ SetWhich()

void SfxPoolItem::SetWhich ( sal_uInt16  nId)
inline

Definition at line 143 of file poolitem.hxx.

References m_nRefCount, m_nWhich, and nId.

Referenced by SfxItemPool::PutImpl().

◆ StaticWhichCast() [1/2]

template<class T >
T & SfxPoolItem::StaticWhichCast ( TypedWhichId< T >  nId)
inline

Definition at line 152 of file poolitem.hxx.

References m_nWhich, and nId.

◆ StaticWhichCast() [2/2]

template<class T >
const T & SfxPoolItem::StaticWhichCast ( TypedWhichId< T >  nId) const
inline

Definition at line 159 of file poolitem.hxx.

References m_nWhich, and nId.

◆ Which()

sal_uInt16 SfxPoolItem::Which ( ) const
inline

Friends And Related Function Documentation

◆ SfxItemDisruptor_Impl

friend class SfxItemDisruptor_Impl
friend

Definition at line 118 of file poolitem.hxx.

◆ SfxItemPool

friend class SfxItemPool
friend

Definition at line 117 of file poolitem.hxx.

◆ SfxItemPoolCache

friend class SfxItemPoolCache
friend

Definition at line 119 of file poolitem.hxx.

◆ SfxItemSet

friend class SfxItemSet
friend

Definition at line 120 of file poolitem.hxx.

◆ SfxVoidItem

friend class SfxVoidItem
friend

Definition at line 121 of file poolitem.hxx.

Referenced by SfxVoidItem::Clone(), and SfxVoidItem::CreateDefault().

Member Data Documentation

◆ m_nKind

SfxItemKind SfxPoolItem::m_nKind
private

Definition at line 125 of file poolitem.hxx.

Referenced by GetKind(), SetKind(), and SetRefCount().

◆ m_nRefCount

sal_uInt32 SfxPoolItem::m_nRefCount
mutableprivate

Definition at line 123 of file poolitem.hxx.

Referenced by AddRef(), GetRefCount(), ReleaseRef(), SetKind(), SetRefCount(), SetWhich(), and ~SfxPoolItem().

◆ m_nWhich

sal_uInt16 SfxPoolItem::m_nWhich
private

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