LibreOffice Module svl (master) 1
Public Member Functions | Private Attributes | List of all members
SfxFlagItem Class Reference

#include <flagitem.hxx>

Inheritance diagram for SfxFlagItem:
[legend]
Collaboration diagram for SfxFlagItem:
[legend]

Public Member Functions

 SfxFlagItem (sal_uInt16 nWhich=0, sal_uInt16 nValue=0)
 
virtual sal_uInt8 GetFlagCount () const
 
virtual bool operator== (const SfxPoolItem &) const override
 
virtual SfxFlagItemClone (SfxItemPool *pPool=nullptr) const override
 
virtual bool GetPresentation (SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
 This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasses. More...
 
sal_uInt16 GetValue () const
 
void SetValue (sal_uInt16 nNewVal)
 
bool GetFlag (sal_uInt8 nFlag) const
 
- Public Member Functions inherited from SfxPoolItem
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...
 

Private Attributes

sal_uInt16 nVal
 

Additional Inherited Members

- Public Types inherited from SfxPoolItem
typedef std::vector< SfxPoolItem * >::const_iterator lookup_iterator
 
- Protected Member Functions inherited from SfxPoolItem
 SfxPoolItem (sal_uInt16 nWhich=0)
 
 SfxPoolItem (const SfxPoolItem &rCopy)
 

Detailed Description

Definition at line 28 of file flagitem.hxx.

Constructor & Destructor Documentation

◆ SfxFlagItem()

SfxFlagItem::SfxFlagItem ( sal_uInt16  nWhich = 0,
sal_uInt16  nValue = 0 
)
explicit

Definition at line 29 of file flagitem.cxx.

Referenced by Clone().

Member Function Documentation

◆ Clone()

SfxFlagItem * SfxFlagItem::Clone ( SfxItemPool pPool = nullptr) const
overridevirtual

Implements SfxPoolItem.

Definition at line 62 of file flagitem.cxx.

References SfxFlagItem().

◆ GetFlag()

bool SfxFlagItem::GetFlag ( sal_uInt8  nFlag) const
inline

Definition at line 51 of file flagitem.hxx.

Referenced by GetPresentation().

◆ GetFlagCount()

sal_uInt8 SfxFlagItem::GetFlagCount ( ) const
virtual

Definition at line 50 of file flagitem.cxx.

References SAL_INFO.

Referenced by GetPresentation().

◆ GetPresentation()

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

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 from SfxPoolItem.

Definition at line 35 of file flagitem.cxx.

References GetFlag(), GetFlagCount(), and u.

◆ GetValue()

sal_uInt16 SfxFlagItem::GetValue ( ) const
inline

Definition at line 46 of file flagitem.hxx.

◆ operator==()

bool SfxFlagItem::operator== ( const SfxPoolItem rItem) const
overridevirtual

Implements SfxPoolItem.

Definition at line 56 of file flagitem.cxx.

References nVal.

◆ SetValue()

void SfxFlagItem::SetValue ( sal_uInt16  nNewVal)
inline

Definition at line 47 of file flagitem.hxx.

References DBG_ASSERT, and SfxPoolItem::GetRefCount().

Member Data Documentation

◆ nVal

sal_uInt16 SfxFlagItem::nVal
private

Definition at line 30 of file flagitem.hxx.

Referenced by operator==().


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