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

#include <SwXMLTextBlocks.hxx>

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

Public Member Functions

 SwXMLTextBlocks (const OUString &rFile)
 
 SwXMLTextBlocks (const css::uno::Reference< css::embed::XStorage > &, const OUString &rFile)
 
void AddName (const OUString &, const OUString &, const OUString &, bool bOnlyText)
 
virtual void AddName (const OUString &, const OUString &, bool bOnlyText=false) override
 
virtual ~SwXMLTextBlocks () override
 
virtual ErrCode Delete (sal_uInt16) override
 
virtual ErrCode Rename (sal_uInt16, const OUString &) override
 
virtual ErrCode CopyBlock (SwImpBlocks &rImp, OUString &rShort, const OUString &rLong) override
 
virtual void ClearDoc () override
 Delete the document's content. More...
 
virtual ErrCode GetDoc (sal_uInt16) override
 
virtual ErrCode BeginPutDoc (const OUString &, const OUString &) override
 
virtual ErrCode PutDoc () override
 
virtual ErrCode PutText (const OUString &, const OUString &, const OUString &) override
 
virtual ErrCode MakeBlockList () override
 
virtual ErrCode OpenFile (bool bReadOnly=true) override
 
virtual void CloseFile () override
 
ErrCode GetText (std::u16string_view rShort, OUString &)
 
virtual bool IsOnlyTextBlock (const OUString &rShort) const override
 
bool IsOnlyTextBlock (sal_uInt16 nIdx) const
 
void SetIsTextOnly (const OUString &rShort, bool bNewValue)
 
virtual ErrCode GetMacroTable (sal_uInt16, SvxMacroTableDtor &rMacroTable) override
 
virtual ErrCode SetMacroTable (sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable) override
 
virtual bool PutMuchEntries (bool bOn) override
 
SwDocGetDoc () const
 
ErrCode StartPutBlock (const OUString &rShort, const OUString &rPackageName)
 
ErrCode PutBlock ()
 
ErrCode GetBlockText (std::u16string_view rShort, OUString &rText)
 
ErrCode PutBlockText (const OUString &rShort, std::u16string_view rText, const OUString &rPackageName)
 
void MakeBlockText (std::u16string_view rText)
 
- Public Member Functions inherited from SwImpBlocks
virtual ~SwImpBlocks ()
 
sal_uInt16 GetCount () const
 Hashcode for Block names. More...
 
sal_uInt16 GetIndex (const OUString &) const
 Get count of Text Blocks. More...
 
sal_uInt16 GetLongIndex (std::u16string_view) const
 Index for shortnames. More...
 
OUString GetShortName (sal_uInt16) const
 Index for longnames. More...
 
OUString GetLongName (sal_uInt16) const
 Return shortname for index. More...
 
OUString GetPackageName (sal_uInt16) const
 Return longname for index. More...
 
const OUString & GetFileName () const
 Return packagename for index. More...
 
void SetName (const OUString &rName)
 Return physical file name. More...
 
const OUString & GetName () const
 
const OUString & GetBaseURL () const
 
void SetBaseURL (const OUString &rURL)
 
virtual ErrCode Delete (sal_uInt16)=0
 
virtual ErrCode Rename (sal_uInt16, const OUString &)=0
 
virtual ErrCode CopyBlock (SwImpBlocks &rImp, OUString &rShort, const OUString &rLong)=0
 
virtual ErrCode GetDoc (sal_uInt16)=0
 
virtual ErrCode BeginPutDoc (const OUString &, const OUString &)=0
 
virtual ErrCode PutDoc ()=0
 
virtual ErrCode PutText (const OUString &, const OUString &, const OUString &)=0
 
virtual ErrCode MakeBlockList ()=0
 
virtual ErrCode OpenFile (bool bReadOnly=true)=0
 
virtual void CloseFile ()=0
 
virtual bool IsOnlyTextBlock (const OUString &rShort) const
 
virtual ErrCode GetMacroTable (sal_uInt16 nIdx, SvxMacroTableDtor &rMacroTable)
 
virtual ErrCode SetMacroTable (sal_uInt16 nIdx, const SvxMacroTableDtor &rMacroTable)
 
virtual bool PutMuchEntries (bool bOn)
 

Static Public Member Functions

static OUString GeneratePackageName (std::u16string_view rShort)
 
static bool IsFileUCBStorage (const OUString &rFileName)
 
- Static Public Member Functions inherited from SwImpBlocks
static sal_uInt16 Hash (std::u16string_view)
 Calculate hash code (is not guaranteed to be unique) More...
 

Private Member Functions

void ReadInfo ()
 
void WriteInfo ()
 
void InitBlockMode (const css::uno::Reference< css::embed::XStorage > &rStorage)
 
void ResetBlockMode ()
 

Private Attributes

SfxObjectShellRef m_xDocShellRef
 
SwXmlFlags m_nFlags
 
OUString m_aPackageName
 
tools::SvRef< SfxMediumm_xMedium
 
css::uno::Reference< css::embed::XStorage > m_xBlkRoot
 
css::uno::Reference< css::embed::XStorage > m_xRoot
 

Additional Inherited Members

- Protected Types inherited from SwImpBlocks
enum class  FileType {
  NoFile ,
  None ,
  XML
}
 
- Protected Member Functions inherited from SwImpBlocks
 SwImpBlocks (const OUString &)
 
virtual void ClearDoc ()
 Delete the document's content. More...
 
std::unique_ptr< SwPaMMakePaM ()
 Creating a PaM, that spans the whole document. More...
 
virtual void AddName (const OUString &, const OUString &, bool bOnlyText=false)
 
bool IsFileChanged () const
 
void Touch ()
 
- Static Protected Member Functions inherited from SwImpBlocks
static FileType GetFileType (const OUString &)
 Is the provided file a storage or doesn't it exist? More...
 
- Protected Attributes inherited from SwImpBlocks
OUString m_aFile
 
OUString m_aName
 
OUString m_aCurrentText
 
OUString m_aShort
 
OUString m_aLong
 
OUString m_sBaseURL
 
SwBlockNames m_aNames
 
Date m_aDateModified
 
tools::Time m_aTimeModified
 
rtl::Reference< SwDocm_xDoc
 
sal_uInt16 m_nCurrentIndex
 
bool m_bReadOnly: 1
 
bool m_bInPutMuchBlocks: 1
 
bool m_bInfoChanged: 1
 

Detailed Description

Definition at line 41 of file SwXMLTextBlocks.hxx.

Constructor & Destructor Documentation

◆ SwXMLTextBlocks() [1/2]

SwXMLTextBlocks::SwXMLTextBlocks ( const OUString &  rFile)

◆ SwXMLTextBlocks() [2/2]

SwXMLTextBlocks::SwXMLTextBlocks ( const css::uno::Reference< css::embed::XStorage > &  ,
const OUString &  rFile 
)

◆ ~SwXMLTextBlocks()

SwXMLTextBlocks::~SwXMLTextBlocks ( )
overridevirtual

Member Function Documentation

◆ AddName() [1/2]

void SwXMLTextBlocks::AddName ( const OUString &  rShort,
const OUString &  rLong,
bool  bOnlyText = false 
)
overridevirtual

Reimplemented from SwImpBlocks.

Definition at line 143 of file SwXMLTextBlocks.cxx.

References AddName(), GeneratePackageName(), and m_aPackageName.

◆ AddName() [2/2]

void SwXMLTextBlocks::AddName ( const OUString &  rShort,
const OUString &  rLong,
const OUString &  rPackageName,
bool  bOnlyText 
)

◆ BeginPutDoc()

ErrCode SwXMLTextBlocks::BeginPutDoc ( const OUString &  rShort,
const OUString &  rLong 
)
overridevirtual

◆ ClearDoc()

void SwXMLTextBlocks::ClearDoc ( )
overridevirtual

Delete the document's content.

Reimplemented from SwImpBlocks.

Definition at line 133 of file SwXMLTextBlocks.cxx.

References SfxObjectShell::ClearEmbeddedObjects(), SwDocShell::InvalidateModel(), SwImpBlocks::m_xDoc, and SwDocShell::ReactivateModel().

Referenced by PutText().

◆ CloseFile()

void SwXMLTextBlocks::CloseFile ( )
overridevirtual

◆ CopyBlock()

ErrCode SwXMLTextBlocks::CopyBlock ( SwImpBlocks rImp,
OUString &  rShort,
const OUString &  rLong 
)
overridevirtual

◆ Delete()

ErrCode SwXMLTextBlocks::Delete ( sal_uInt16  n)
overridevirtual

◆ GeneratePackageName()

OUString SwXMLTextBlocks::GeneratePackageName ( std::u16string_view  rShort)
static

Definition at line 516 of file SwXMLTextBlocks.cxx.

References aBuf, nPos, and OUStringToOString().

Referenced by AddName(), BeginPutDoc(), GetBlockText(), PutText(), and Rename().

◆ GetBlockText()

ErrCode SwXMLTextBlocks::GetBlockText ( std::u16string_view  rShort,
OUString &  rText 
)

◆ GetDoc() [1/2]

SwDoc * SwXMLTextBlocks::GetDoc ( ) const
inline

Definition at line 89 of file SwXMLTextBlocks.hxx.

References SwImpBlocks::m_xDoc.

◆ GetDoc() [2/2]

ErrCode SwXMLTextBlocks::GetDoc ( sal_uInt16  nIdx)
overridevirtual

◆ GetMacroTable()

ErrCode SwXMLTextBlocks::GetMacroTable ( sal_uInt16  nIdx,
SvxMacroTableDtor rMacroTable 
)
overridevirtual

◆ GetText()

ErrCode SwXMLTextBlocks::GetText ( std::u16string_view  rShort,
OUString &  rText 
)

Definition at line 398 of file SwXMLTextBlocks.cxx.

References GetBlockText().

Referenced by SwAutoCorrect::PutText().

◆ InitBlockMode()

void SwXMLTextBlocks::InitBlockMode ( const css::uno::Reference< css::embed::XStorage > &  rStorage)
private

Definition at line 51 of file SwXMLTextBlocks.cxx.

References m_xBlkRoot, and m_xRoot.

Referenced by OpenFile(), and SwXMLTextBlocks().

◆ IsFileUCBStorage()

bool SwXMLTextBlocks::IsFileUCBStorage ( const OUString &  rFileName)
static

◆ IsOnlyTextBlock() [1/2]

bool SwXMLTextBlocks::IsOnlyTextBlock ( const OUString &  rShort) const
overridevirtual

Reimplemented from SwImpBlocks.

Definition at line 484 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::GetIndex(), and SwImpBlocks::m_aNames.

Referenced by CopyBlock(), SwXMLBlockListExport::exportDoc(), GetDoc(), and Rename().

◆ IsOnlyTextBlock() [2/2]

bool SwXMLTextBlocks::IsOnlyTextBlock ( sal_uInt16  nIdx) const

Definition at line 494 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::m_aNames.

◆ MakeBlockList()

ErrCode SwXMLTextBlocks::MakeBlockList ( )
overridevirtual

Implements SwImpBlocks.

Definition at line 403 of file SwXMLTextBlocks.cxx.

References ERRCODE_NONE, and WriteInfo().

Referenced by CopyBlock(), and PutMuchEntries().

◆ MakeBlockText()

void SwXMLTextBlocks::MakeBlockText ( std::u16string_view  rText)

◆ OpenFile()

ErrCode SwXMLTextBlocks::OpenFile ( bool  bReadOnly = true)
overridevirtual

◆ PutBlock()

ErrCode SwXMLTextBlocks::PutBlock ( )

◆ PutBlockText()

ErrCode SwXMLTextBlocks::PutBlockText ( const OUString &  rShort,
std::u16string_view  rText,
const OUString &  rPackageName 
)

◆ PutDoc()

ErrCode SwXMLTextBlocks::PutDoc ( )
overridevirtual

Implements SwImpBlocks.

Definition at line 391 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::MakePaM(), and PutBlock().

Referenced by SwAutoCorrect::PutText().

◆ PutMuchEntries()

bool SwXMLTextBlocks::PutMuchEntries ( bool  bOn)
overridevirtual

◆ PutText()

ErrCode SwXMLTextBlocks::PutText ( const OUString &  rShort,
const OUString &  rName,
const OUString &  rText 
)
overridevirtual

◆ ReadInfo()

void SwXMLTextBlocks::ReadInfo ( )
private

◆ Rename()

ErrCode SwXMLTextBlocks::Rename ( sal_uInt16  nIdx,
const OUString &  rNewShort 
)
overridevirtual

◆ ResetBlockMode()

void SwXMLTextBlocks::ResetBlockMode ( )
private

Definition at line 57 of file SwXMLTextBlocks.cxx.

References m_xBlkRoot, and m_xRoot.

Referenced by CloseFile(), SwXMLTextBlocks(), and ~SwXMLTextBlocks().

◆ SetIsTextOnly()

void SwXMLTextBlocks::SetIsTextOnly ( const OUString &  rShort,
bool  bNewValue 
)

Definition at line 477 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::GetIndex(), and SwImpBlocks::m_aNames.

Referenced by BeginPutDoc(), and PutText().

◆ SetMacroTable()

ErrCode SwXMLTextBlocks::SetMacroTable ( sal_uInt16  nIdx,
const SvxMacroTableDtor rMacroTable 
)
overridevirtual

◆ StartPutBlock()

ErrCode SwXMLTextBlocks::StartPutBlock ( const OUString &  rShort,
const OUString &  rPackageName 
)

◆ WriteInfo()

void SwXMLTextBlocks::WriteInfo ( )
private

Member Data Documentation

◆ m_aPackageName

OUString SwXMLTextBlocks::m_aPackageName
private

◆ m_nFlags

SwXmlFlags SwXMLTextBlocks::m_nFlags
private

Definition at line 44 of file SwXMLTextBlocks.hxx.

Referenced by PutBlock(), PutBlockText(), and PutMuchEntries().

◆ m_xBlkRoot

css::uno::Reference< css::embed::XStorage > SwXMLTextBlocks::m_xBlkRoot
private

◆ m_xDocShellRef

SfxObjectShellRef SwXMLTextBlocks::m_xDocShellRef
private

Definition at line 43 of file SwXMLTextBlocks.hxx.

Referenced by SwXMLTextBlocks(), and ~SwXMLTextBlocks().

◆ m_xMedium

tools::SvRef<SfxMedium> SwXMLTextBlocks::m_xMedium
private

Definition at line 46 of file SwXMLTextBlocks.hxx.

Referenced by GetDoc().

◆ m_xRoot

css::uno::Reference< css::embed::XStorage > SwXMLTextBlocks::m_xRoot
private

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