LibreOffice Module sw (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwXAutoTextEntry Class Referencefinal

#include <unoatxt.hxx>

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

Public Member Functions

 SwXAutoTextEntry (SwGlossaries *, OUString aGroupName, OUString aEntryName)
 
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor () override
 
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange (const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
 
virtual void SAL_CALL insertString (const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
 
virtual void SAL_CALL insertControlCharacter (const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
 
virtual void SAL_CALL insertTextContent (const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
 
virtual void SAL_CALL removeTextContent (const css::uno::Reference< css::text::XTextContent > &xContent) override
 
virtual css::uno::Reference< css::text::XText > SAL_CALL getText () override
 
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart () override
 
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd () override
 
virtual OUString SAL_CALL getString () override
 
virtual void SAL_CALL setString (const OUString &aString) override
 
virtual void SAL_CALL applyTo (const css::uno::Reference< css::text::XTextRange > &xRange) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents () override
 
void Invalidate ()
 
const SwGlossariesGetGlossaries () const
 
const OUString & GetGroupName () const
 
const OUString & GetEntryName () const
 
- Public Member Functions inherited from SfxListener
 SfxListener ()
 
 SfxListener (const SfxListener &rCopy)
 
virtual ~SfxListener () COVERITY_NOEXCEPT_FALSE
 
void StartListening (SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
 
void EndListening (SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
 
void EndListeningAll ()
 
bool IsListening (SfxBroadcaster &rBroadcaster) const
 
sal_uInt16 GetBroadcasterCount () const
 
SfxBroadcasterGetBroadcasterJOE (sal_uInt16 nNo) const
 
virtual void Notify (SfxBroadcaster &rBC, const SfxHint &rHint)
 
void RemoveBroadcaster_Impl (SfxBroadcaster &rBC)
 
virtual bool IsSdrView () const
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< css::text::XAutoTextEntry, css::lang::XServiceInfo, css::text::XText, css::document::XEventsSupplier >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Private Member Functions

void EnsureBodyText ()
 
void GetBodyText ()
 
void disposing (std::unique_lock< std::mutex > &) override
 
void implFlushDocument (bool _bCloseDoc=false)
 ensure that the current content (which may only be in-memory so far) is flushed to the auto text group file More...
 
virtual void Notify (SfxBroadcaster &rBC, const SfxHint &rHint) override
 
virtual ~SwXAutoTextEntry () override
 

Private Attributes

SwGlossariesm_pGlossaries
 
OUString m_sGroupName
 
OUString m_sEntryName
 
SwDocShellRef m_xDocSh
 
rtl::Reference< SwXBodyTextmxBodyText
 

Additional Inherited Members

- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

Definition at line 145 of file unoatxt.hxx.

Constructor & Destructor Documentation

◆ ~SwXAutoTextEntry()

SwXAutoTextEntry::~SwXAutoTextEntry ( )
overrideprivatevirtual

Definition at line 655 of file unoatxt.cxx.

References implFlushDocument().

◆ SwXAutoTextEntry()

SwXAutoTextEntry::SwXAutoTextEntry ( SwGlossaries pGlss,
OUString  aGroupName,
OUString  aEntryName 
)

Definition at line 647 of file unoatxt.cxx.

References aEntryName.

Member Function Documentation

◆ applyTo()

void SwXAutoTextEntry::applyTo ( const css::uno::Reference< css::text::XTextRange > &  xRange)
overridevirtual

◆ createTextCursor()

uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursor ( )
overridevirtual

Definition at line 730 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ createTextCursorByRange()

uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursorByRange ( const css::uno::Reference< css::text::XTextRange > &  aTextPosition)
overridevirtual

Definition at line 737 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ disposing()

void SwXAutoTextEntry::disposing ( std::unique_lock< std::mutex > &  )
overrideprivatevirtual

Reimplemented from comphelper::WeakComponentImplHelperBase.

Definition at line 724 of file unoatxt.cxx.

References implFlushDocument().

◆ EnsureBodyText()

void SwXAutoTextEntry::EnsureBodyText ( )
inlineprivate

◆ GetBodyText()

void SwXAutoTextEntry::GetBodyText ( )
private

◆ getEnd()

uno::Reference< text::XTextRange > SwXAutoTextEntry::getEnd ( )
overridevirtual

Definition at line 791 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ GetEntryName()

const OUString & SwXAutoTextEntry::GetEntryName ( ) const
inline

◆ getEvents()

uno::Reference< container::XNameReplace > SwXAutoTextEntry::getEvents ( )
overridevirtual

Definition at line 888 of file unoatxt.cxx.

◆ GetGlossaries()

const SwGlossaries * SwXAutoTextEntry::GetGlossaries ( ) const
inline

◆ GetGroupName()

const OUString & SwXAutoTextEntry::GetGroupName ( ) const
inline

◆ getImplementationName()

OUString SwXAutoTextEntry::getImplementationName ( )
overridevirtual

Definition at line 872 of file unoatxt.cxx.

◆ getStart()

uno::Reference< text::XTextRange > SwXAutoTextEntry::getStart ( )
overridevirtual

Definition at line 784 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ getString()

OUString SwXAutoTextEntry::getString ( )
overridevirtual

Definition at line 798 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ getSupportedServiceNames()

uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames ( )
overridevirtual

Definition at line 882 of file unoatxt.cxx.

◆ getText()

uno::Reference< text::XText > SwXAutoTextEntry::getText ( )
overridevirtual

Definition at line 777 of file unoatxt.cxx.

◆ implFlushDocument()

void SwXAutoTextEntry::implFlushDocument ( bool  _bCloseDoc = false)
private

ensure that the current content (which may only be in-memory so far) is flushed to the auto text group file

If somebody modifies an auto text via this class, then this is not directly reflected to the respective glossaries file (on disk), instead we hold a copy of this text (in [p|x]BodyText). On the other hand, in applyTo, we do not work with this copy, but just tell the target for the application to insert the content which we're responsible for - and this target doesn't know about our copy, but only about the persistent version. So we need to ensure that before somebody else does something with our auto text, we flush our (in-memory) copy to disk.

Definition at line 663 of file unoatxt.cxx.

References tools::SvRef< typename T >::clear(), SfxListener::EndListening(), tools::SvRef< typename T >::is(), and m_xDocSh.

Referenced by applyTo(), disposing(), Notify(), and ~SwXAutoTextEntry().

◆ insertControlCharacter()

void SwXAutoTextEntry::insertControlCharacter ( const css::uno::Reference< css::text::XTextRange > &  xRange,
sal_Int16  nControlCharacter,
sal_Bool  bAbsorb 
)
overridevirtual

Definition at line 752 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ insertString()

void SwXAutoTextEntry::insertString ( const css::uno::Reference< css::text::XTextRange > &  xRange,
const OUString &  aString,
sal_Bool  bAbsorb 
)
overridevirtual

Definition at line 745 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ insertTextContent()

void SwXAutoTextEntry::insertTextContent ( const css::uno::Reference< css::text::XTextRange > &  xRange,
const css::uno::Reference< css::text::XTextContent > &  xContent,
sal_Bool  bAbsorb 
)
overridevirtual

Definition at line 760 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ Invalidate()

void SwXAutoTextEntry::Invalidate ( )
inline

Definition at line 218 of file unoatxt.hxx.

References m_pGlossaries.

◆ Notify()

void SwXAutoTextEntry::Notify ( SfxBroadcaster rBC,
const SfxHint rHint 
)
overrideprivatevirtual

◆ removeTextContent()

void SwXAutoTextEntry::removeTextContent ( const css::uno::Reference< css::text::XTextContent > &  xContent)
overridevirtual

Definition at line 769 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ setString()

void SwXAutoTextEntry::setString ( const OUString &  aString)
overridevirtual

Definition at line 805 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ supportsService()

sal_Bool SwXAutoTextEntry::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 877 of file unoatxt.cxx.

References cppu::supportsService().

Member Data Documentation

◆ m_pGlossaries

SwGlossaries* SwXAutoTextEntry::m_pGlossaries
private

Definition at line 155 of file unoatxt.hxx.

Referenced by applyTo(), GetBodyText(), GetGlossaries(), and Invalidate().

◆ m_sEntryName

OUString SwXAutoTextEntry::m_sEntryName
private

Definition at line 157 of file unoatxt.hxx.

Referenced by applyTo(), GetBodyText(), and GetEntryName().

◆ m_sGroupName

OUString SwXAutoTextEntry::m_sGroupName
private

Definition at line 156 of file unoatxt.hxx.

Referenced by applyTo(), GetBodyText(), and GetGroupName().

◆ m_xDocSh

SwDocShellRef SwXAutoTextEntry::m_xDocSh
private

Definition at line 158 of file unoatxt.hxx.

Referenced by GetBodyText(), implFlushDocument(), and Notify().

◆ mxBodyText

rtl::Reference<SwXBodyText> SwXAutoTextEntry::mxBodyText
private

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