20 #ifndef INCLUDED_SW_INC_CALBCK_HXX
21 #define INCLUDED_SW_INC_CALBCK_HXX
30 #include <type_traits>
65 class ClientIteratorBase;
104 friend class ::SwModify;
105 friend class ::sw::ClientIteratorBase;
115 : m_pLeft(nullptr), m_pRight(nullptr)
118 virtual void SwClientNotify(
const SwModify&,
const SfxHint& rHint) =0;
120 bool IsLast()
const {
return !m_pLeft && !m_pRight; }
132 template<
typename E,
typename S, sw::IteratorMode>
friend class SwIterator;
154 std::unique_ptr<
sw::ModifyChangedHint> CheckRegistration( const
SfxPoolItem* pOldValue );
157 void CheckRegistrationFormat(
SwFormat& rOld);
159 const
SwModify* GetRegisteredIn()
const {
return m_pRegisteredIn; }
161 void EndListeningAll();
162 void StartListeningToSameModifyAs(
const SwClient&);
177 template<
typename E,
typename S, sw::IteratorMode>
friend class SwIterator;
187 :
SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false)
191 virtual void CallSwClientNotify(
const SfxHint& rHint )
const;
208 template<
typename TElementType,
typename TSource, sw::IteratorMode eMode>
class SwIterator;
221 virtual void CallSwClientNotify(
const SfxHint& rHint)
const override;
227 template<
typename E,
typename S, sw::IteratorMode>
friend class ::SwIterator;
232 :
SwClient(pDepend), m_pToTell(pTellHim)
238 , m_pToTell(other.m_pToTell)
242 m_pToTell = other.m_pToTell;
244 other.EndListeningAll();
264 void EndListening(
SwModify* pDepend);
265 bool IsListeningTo(
const SwModify*
const pDepend)
const;
266 void EndListeningAll();
286 s_pClientIters =
this;
296 m_pPosition = m_pPosition->
m_pLeft;
303 if(s_pClientIters ==
this)
316 template<
typename TElementType,
typename TSource,
321 static_assert(std::is_base_of<SwClient,TElementType>::value,
"TElementType needs to be derived from SwClient.");
322 static_assert(std::is_base_of<SwModify,TSource>::value,
"TSource needs to be derived from SwModify.");
342 if (
auto const pLE = dynamic_cast<sw::ListenerEntry const*>(
m_pPosition))
344 pCurrent = pLE->m_pToTell;
347 if (dynamic_cast<const TElementType *>(pCurrent) ==
nullptr)
356 return static_cast<TElementType*
>(pCurrent);
363 static_assert(std::is_base_of<SwModify,TSource>::value,
"TSource needs to be derived from SwModify");
378 : m_pRegisteredIn( nullptr )
381 pToRegisterIn->
Add(
this);
BroadcasterMixin & operator=(const BroadcasterMixin &)
void Add(SwClient *pDepend)
sal_uInt16 GetWhich() const
refactoring out the same of the more sane SwClient functionality
ListenerEntry & operator=(ListenerEntry const &)=delete
WriterListener * GoStart()
virtual ~LegacyModifyHint() override
SvtBroadcaster m_aNotifier
const SfxPoolItem * m_pNew
Dialog to specify the properties of date form field.
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
SwClient * Remove(SwClient *pDepend)
bool HasWriterListeners() const
void MoveTo(::sw::ClientIteratorBase *pDestRing)
Removes this item from its current ring container and adds it to another ring container.
WriterListener * GetLeftOfPos()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SwIterator(const TSource &rSrc)
bool HasOnlyOneListener() const
void ClientNotifyAttrChg(SwModify &rModify, const SwAttrSet &aSet, SwAttrSet &aOld, SwAttrSet &aNew)
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint)=0
ListenerEntry(ListenerEntry &&other) noexcept
LegacyModifyHint(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
std::vector< ListenerEntry > m_vDepends
sw::WriterListener * m_pWriterListeners
ListenerEntry(SwClient *const pTellHim, SwModify *const pDepend)
static SW_DLLPUBLIC ClientIteratorBase * s_pClientIters
~ClientIteratorBase() override
::sw::ClientIteratorBase * GetNextInRing()
virtual bool GetInfo(SfxPoolItem &rInfo) const override
get Client information
WriterListener * m_pRight
double-linked list of other clients
ClientIteratorBase(const SwModify &rModify)
SwIterator(const TSource &rSrc)
WriterListener * GetRightOfPos()
WriterListener * m_pCurrent
ModifyChangedHint(const SwModify *pNew)
SvtBroadcaster & GetNotifier()
bool IsModifyLocked() const
const SfxPoolItem * m_pOld
const SwModify * GetRegisteredIn() const
WriterListener & operator=(WriterListener const &)=delete
virtual void SwClientNotify(const SwModify &rModify, const SfxHint &rHint) override
SwModify * GetRegisteredIn()
virtual bool GetInfo(SfxPoolItem &) const
SwModify * m_pRegisteredIn
event source
virtual ~WriterListener() COVERITY_NOEXCEPT_FALSE
SwModify * GetRegisteredInNonConst() const
virtual ~ModifyChangedHint() override
ListenerEntry & operator=(ListenerEntry &&other) noexcept
WriterListener * m_pPosition