LibreOffice Module sw (master)  1
Public Member Functions | Static Public Member Functions | Public Attributes | 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 &, const OUString &) 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 FileType GetFileType () const override
 
virtual ErrCode OpenFile (bool bReadOnly=true) override
 
virtual void CloseFile () override
 
ErrCode GetText (const OUString &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 (const OUString &rShort, OUString &rText)
 
ErrCode PutBlockText (const OUString &rShort, const OUString &rText, const OUString &rPackageName)
 
void MakeBlockText (const OUString &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 (const OUString &) 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 OUString & GetBaseURL () const
 
void SetBaseURL (const OUString &rURL)
 

Static Public Member Functions

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

Public Attributes

css::uno::Reference< css::embed::XStorage > xBlkRoot
 
css::uno::Reference< css::embed::XStorage > xRoot
 

Private Member Functions

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

Private Attributes

SfxObjectShellRef xDocShellRef
 
SwXmlFlags nFlags
 
OUString aPackageName
 
tools::SvRef< SfxMediumxMedium
 

Additional Inherited Members

- Protected Types inherited from SwImpBlocks
enum  FileType {
  FileType::NoFile,
  FileType::None,
  FileType::SW3,
  FileType::XML
}
 
- Protected Member Functions inherited from SwImpBlocks
 SwImpBlocks (const OUString &)
 
std::unique_ptr< SwPaMMakePaM ()
 Creating a PaM, that spans the whole document. More...
 
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 const 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 38 of file SwXMLTextBlocks.hxx.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Reimplemented from SwImpBlocks.

Definition at line 144 of file SwXMLTextBlocks.cxx.

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

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

Delete the document's content.

Reimplemented from SwImpBlocks.

Definition at line 134 of file SwXMLTextBlocks.cxx.

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

Referenced by PutText().

void SwXMLTextBlocks::CloseFile ( )
overridevirtual

Implements SwImpBlocks.

Definition at line 419 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::m_bInfoChanged, ResetBlockMode(), and WriteInfo().

Referenced by PutMuchEntries().

ErrCode SwXMLTextBlocks::Delete ( sal_uInt16  n)
overridevirtual
OUString SwXMLTextBlocks::GeneratePackageName ( const OUString &  rShort)
static

Definition at line 470 of file SwXMLTextBlocks.cxx.

References aBuf, nPos, and OUStringToOString().

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

ErrCode SwXMLTextBlocks::GetBlockText ( const OUString &  rShort,
OUString &  rText 
)

Definition at line 269 of file SwXMLTextBlocks1.cxx.

References ERRCODE_NONE, and comphelper::getProcessComponentContext().

Referenced by GetText().

ErrCode SwXMLTextBlocks::GetDoc ( sal_uInt16  nIdx)
overridevirtual
SwDoc* SwXMLTextBlocks::GetDoc ( ) const
inline

Definition at line 86 of file SwXMLTextBlocks.hxx.

References SwImpBlocks::m_xDoc.

SwImpBlocks::FileType SwXMLTextBlocks::GetFileType ( ) const
overridevirtual

Implements SwImpBlocks.

Definition at line 465 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::XML.

ErrCode SwXMLTextBlocks::GetMacroTable ( sal_uInt16  nIdx,
SvxMacroTableDtor rMacroTable 
)
overridevirtual
ErrCode SwXMLTextBlocks::GetText ( const OUString &  rShort,
OUString &  rText 
)

Definition at line 347 of file SwXMLTextBlocks.cxx.

References GetBlockText().

Referenced by SwAutoCorrect::PutText().

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

Definition at line 52 of file SwXMLTextBlocks.cxx.

References xBlkRoot, and xRoot.

Referenced by OpenFile(), and SwXMLTextBlocks().

bool SwXMLTextBlocks::IsFileUCBStorage ( const OUString &  rFileName)
static
bool SwXMLTextBlocks::IsOnlyTextBlock ( const OUString &  rShort) const
overridevirtual

Reimplemented from SwImpBlocks.

Definition at line 433 of file SwXMLTextBlocks.cxx.

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

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

bool SwXMLTextBlocks::IsOnlyTextBlock ( sal_uInt16  nIdx) const

Definition at line 443 of file SwXMLTextBlocks.cxx.

References SwImpBlocks::m_aNames.

ErrCode SwXMLTextBlocks::MakeBlockList ( )
overridevirtual

Implements SwImpBlocks.

Definition at line 352 of file SwXMLTextBlocks.cxx.

References ERRCODE_NONE, and WriteInfo().

Referenced by PutMuchEntries().

void SwXMLTextBlocks::MakeBlockText ( const OUString &  rText)
ErrCode SwXMLTextBlocks::OpenFile ( bool  bReadOnly = true)
overridevirtual
ErrCode SwXMLTextBlocks::PutBlock ( )
ErrCode SwXMLTextBlocks::PutBlockText ( const OUString &  rShort,
const OUString &  rText,
const OUString &  rPackageName 
)
ErrCode SwXMLTextBlocks::PutDoc ( )
overridevirtual

Implements SwImpBlocks.

Definition at line 340 of file SwXMLTextBlocks.cxx.

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

Referenced by SwAutoCorrect::PutText().

bool SwXMLTextBlocks::PutMuchEntries ( bool  bOn)
overridevirtual
ErrCode SwXMLTextBlocks::PutText ( const OUString &  rShort,
const OUString &  rName,
const OUString &  rText 
)
overridevirtual
void SwXMLTextBlocks::ReadInfo ( )
private

Definition at line 406 of file SwXMLTextBlocks1.cxx.

References comphelper::getProcessComponentContext(), and XMLN_BLOCKLIST.

Referenced by SwXMLTextBlocks().

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

Definition at line 58 of file SwXMLTextBlocks.cxx.

References xBlkRoot, and xRoot.

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

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

Definition at line 426 of file SwXMLTextBlocks.cxx.

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

Referenced by BeginPutDoc(), and PutText().

ErrCode SwXMLTextBlocks::SetMacroTable ( sal_uInt16  nIdx,
const SvxMacroTableDtor rMacroTable 
)
overridevirtual
ErrCode SwXMLTextBlocks::StartPutBlock ( const OUString &  rShort,
const OUString &  rPackageName 
)
void SwXMLTextBlocks::WriteInfo ( )
private

Member Data Documentation

OUString SwXMLTextBlocks::aPackageName
private

Definition at line 42 of file SwXMLTextBlocks.hxx.

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

SwXmlFlags SwXMLTextBlocks::nFlags
private

Definition at line 41 of file SwXMLTextBlocks.hxx.

Referenced by PutBlock(), and PutMuchEntries().

css::uno::Reference< css::embed::XStorage > SwXMLTextBlocks::xBlkRoot
SfxObjectShellRef SwXMLTextBlocks::xDocShellRef
private

Definition at line 40 of file SwXMLTextBlocks.hxx.

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

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

Definition at line 43 of file SwXMLTextBlocks.hxx.

css::uno::Reference< css::embed::XStorage > SwXMLTextBlocks::xRoot

Definition at line 52 of file SwXMLTextBlocks.hxx.

Referenced by InitBlockMode(), PutBlock(), Rename(), ResetBlockMode(), and StartPutBlock().


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