LibreOffice Module sw (master) 1
Public Member Functions | Static 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 sal_Int64 SAL_CALL getSomething (const css::uno::Sequence< sal_Int8 > &aIdentifier) override
 
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::lang::XUnoTunnel, css::text::XText, css::document::XEventsSupplier >
virtual void SAL_CALL acquire () noexcept final override
 
virtual void SAL_CALL release () noexcept final 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 > &)
 

Static Public Member Functions

static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId ()
 

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 Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

Definition at line 152 of file unoatxt.hxx.

Constructor & Destructor Documentation

◆ ~SwXAutoTextEntry()

SwXAutoTextEntry::~SwXAutoTextEntry ( )
overrideprivatevirtual

Definition at line 678 of file unoatxt.cxx.

References implFlushDocument().

◆ SwXAutoTextEntry()

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

Definition at line 670 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 753 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 760 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 747 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 814 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 911 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 895 of file unoatxt.cxx.

◆ getSomething()

sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething ( const css::uno::Sequence< sal_Int8 > &  aIdentifier)
overridevirtual

Definition at line 665 of file unoatxt.cxx.

References comphelper::getSomethingImpl().

◆ getStart()

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

Definition at line 807 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ getString()

OUString SwXAutoTextEntry::getString ( )
overridevirtual

Definition at line 821 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ getSupportedServiceNames()

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

Definition at line 905 of file unoatxt.cxx.

◆ getText()

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

Definition at line 800 of file unoatxt.cxx.

◆ getUnoTunnelId()

const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId ( )
static

Definition at line 659 of file unoatxt.cxx.

References comphelper::UnoIdInit::getSeq().

◆ 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 686 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 775 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 768 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 783 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ Invalidate()

void SwXAutoTextEntry::Invalidate ( )
inline

Definition at line 231 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 792 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ setString()

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

Definition at line 828 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

◆ supportsService()

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

Definition at line 900 of file unoatxt.cxx.

References cppu::supportsService().

Member Data Documentation

◆ m_pGlossaries

SwGlossaries* SwXAutoTextEntry::m_pGlossaries
private

Definition at line 163 of file unoatxt.hxx.

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

◆ m_sEntryName

OUString SwXAutoTextEntry::m_sEntryName
private

Definition at line 165 of file unoatxt.hxx.

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

◆ m_sGroupName

OUString SwXAutoTextEntry::m_sGroupName
private

Definition at line 164 of file unoatxt.hxx.

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

◆ m_xDocSh

SwDocShellRef SwXAutoTextEntry::m_xDocSh
private

Definition at line 166 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: