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 *, const OUString &rGroupName, const OUString &rEntryName)
 
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
 
void RemoveBroadcaster_Impl (SfxBroadcaster &rBC)
 

Static Public Member Functions

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

Private Member Functions

void EnsureBodyText ()
 
void GetBodyText ()
 
void SAL_CALL disposing () 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

SwGlossariespGlossaries
 
OUString const sGroupName
 
OUString const sEntryName
 
SwDocShellRef xDocSh
 
rtl::Reference< SwXBodyTextmxBodyText
 

Additional Inherited Members

- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

Definition at line 155 of file unoatxt.hxx.

Constructor & Destructor Documentation

SwXAutoTextEntry::~SwXAutoTextEntry ( )
overrideprivatevirtual

Definition at line 706 of file unoatxt.cxx.

References implFlushDocument().

SwXAutoTextEntry::SwXAutoTextEntry ( SwGlossaries pGlss,
const OUString &  rGroupName,
const OUString &  rEntryName 
)

Definition at line 697 of file unoatxt.cxx.

References m_aMutex.

Member Function Documentation

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

Definition at line 780 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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

Definition at line 787 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

void SwXAutoTextEntry::disposing ( )
overrideprivate

Definition at line 774 of file unoatxt.cxx.

References implFlushDocument().

void SwXAutoTextEntry::EnsureBodyText ( )
inlineprivate
void SwXAutoTextEntry::GetBodyText ( )
private
uno::Reference< text::XTextRange > SwXAutoTextEntry::getEnd ( )
overridevirtual

Definition at line 841 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

const OUString& SwXAutoTextEntry::GetEntryName ( ) const
inline
uno::Reference< container::XNameReplace > SwXAutoTextEntry::getEvents ( )
overridevirtual

Definition at line 950 of file unoatxt.cxx.

const SwGlossaries* SwXAutoTextEntry::GetGlossaries ( ) const
inline
const OUString& SwXAutoTextEntry::GetGroupName ( ) const
inline
OUString SwXAutoTextEntry::getImplementationName ( )
overridevirtual

Definition at line 934 of file unoatxt.cxx.

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

Definition at line 688 of file unoatxt.cxx.

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

Definition at line 834 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

OUString SwXAutoTextEntry::getString ( )
overridevirtual

Definition at line 848 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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

Definition at line 944 of file unoatxt.cxx.

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

Definition at line 827 of file unoatxt.cxx.

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

Definition at line 683 of file unoatxt.cxx.

References sw::proofreadingiterator::get().

Referenced by SwGlossaries::GetAutoTextEntry().

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 714 of file unoatxt.cxx.

References tools::SvRef< T >::clear(), SfxObjectShell::DoClose(), SfxListener::EndListening(), SwDocShell::GetDoc(), SwDoc::getIDocumentState(), tools::SvRef< T >::is(), IDocumentState::IsModified(), SwDocShell::Save(), and xDocSh.

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

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

Definition at line 802 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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

Definition at line 795 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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 810 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

void SwXAutoTextEntry::Invalidate ( )
inline

Definition at line 235 of file unoatxt.hxx.

void SwXAutoTextEntry::Notify ( SfxBroadcaster rBC,
const SfxHint rHint 
)
overrideprivatevirtual
void SwXAutoTextEntry::removeTextContent ( const css::uno::Reference< css::text::XTextContent > &  xContent)
overridevirtual

Definition at line 819 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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

Definition at line 855 of file unoatxt.cxx.

References EnsureBodyText(), and mxBodyText.

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

Definition at line 939 of file unoatxt.cxx.

References cppu::supportsService().

Member Data Documentation

rtl::Reference<SwXBodyText> SwXAutoTextEntry::mxBodyText
private
SwGlossaries* SwXAutoTextEntry::pGlossaries
private

Definition at line 167 of file unoatxt.hxx.

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

OUString const SwXAutoTextEntry::sEntryName
private

Definition at line 169 of file unoatxt.hxx.

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

OUString const SwXAutoTextEntry::sGroupName
private

Definition at line 168 of file unoatxt.hxx.

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

SwDocShellRef SwXAutoTextEntry::xDocSh
private

Definition at line 170 of file unoatxt.hxx.

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


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