LibreOffice Module sfx2 (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SfxDocumentTemplates Class Reference

#include <doctempl.hxx>

Collaboration diagram for SfxDocumentTemplates:
[legend]

Public Member Functions

 SfxDocumentTemplates ()
 
 SfxDocumentTemplates (const SfxDocumentTemplates &)
 
 ~SfxDocumentTemplates ()
 
const SfxDocumentTemplatesoperator= (const SfxDocumentTemplates &)
 
void ReInitFromComponent ()
 
sal_uInt16 GetRegionCount () const
 
OUString GetRegionName (sal_uInt16 nIdx) const
 
OUString GetFullRegionName (sal_uInt16 nIdx) const
 
sal_uInt16 GetCount (sal_uInt16 nRegion) const
 
OUString GetName (sal_uInt16 nRegion, sal_uInt16 nIdx) const
 
OUString GetPath (sal_uInt16 nRegion, sal_uInt16 nIdx) const
 
OUString GetTemplateTargetURLFromComponent (std::u16string_view aGroupName, std::u16string_view aTitle)
 
bool Copy (sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx)
 
bool Move (sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx)
 
bool Delete (sal_uInt16 nRegion, sal_uInt16 nIdx)
 
bool InsertDir (const OUString &rText, sal_uInt16 nRegion)
 
bool InsertTemplate (sal_uInt16 nSourceRegion, sal_uInt16 nIdx, const OUString &rName, const OUString &rPath)
 
bool SetName (const OUString &rName, sal_uInt16 nRegion, sal_uInt16 nIdx)
 Change the name of an entry or a directory. More...
 
bool CopyTo (sal_uInt16 nRegion, sal_uInt16 nIdx, std::u16string_view rName) const
 
bool CopyFrom (sal_uInt16 nRegion, sal_uInt16 nIdx, OUString &rName)
 
bool GetFull (std::u16string_view rRegion, std::u16string_view rName, OUString &rPath)
 
bool GetLogicNames (std::u16string_view rPath, OUString &rRegion, OUString &rName) const
 
void Update ()
 updates the configuration where the document templates structure is stored. More...
 

Static Public Member Functions

static OUString ConvertResourceString (const OUString &rString)
 Convert a template name to its localised pair if it exists. More...
 

Private Member Functions

SAL_DLLPRIVATE bool CopyOrMove (sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx, sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx, bool bMove)
 

Private Attributes

tools::SvRef< SfxDocTemplate_ImplpImp
 

Detailed Description

Definition at line 37 of file doctempl.hxx.

Constructor & Destructor Documentation

◆ SfxDocumentTemplates() [1/2]

SfxDocumentTemplates::SfxDocumentTemplates ( )

Definition at line 1211 of file doctempl.cxx.

References gpTemplateData, and pImp.

◆ SfxDocumentTemplates() [2/2]

SfxDocumentTemplates::SfxDocumentTemplates ( const SfxDocumentTemplates )

◆ ~SfxDocumentTemplates()

SfxDocumentTemplates::~SfxDocumentTemplates ( )

Definition at line 1225 of file doctempl.cxx.

References pImp.

Member Function Documentation

◆ ConvertResourceString()

OUString SfxDocumentTemplates::ConvertResourceString ( const OUString &  rString)
static

◆ Copy()

bool SfxDocumentTemplates::Copy ( sal_uInt16  nTargetRegion,
sal_uInt16  nTargetIdx,
sal_uInt16  nSourceRegion,
sal_uInt16  nSourceIdx 
)

Definition at line 685 of file doctempl.cxx.

References CopyOrMove(), and pImp.

◆ CopyFrom()

bool SfxDocumentTemplates::CopyFrom ( sal_uInt16  nRegion,
sal_uInt16  nIdx,
OUString &  rName 
)

◆ CopyOrMove()

bool SfxDocumentTemplates::CopyOrMove ( sal_uInt16  nTargetRegion,
sal_uInt16  nTargetIdx,
sal_uInt16  nSourceRegion,
sal_uInt16  nSourceIdx,
bool  bMove 
)
private

Definition at line 551 of file doctempl.cxx.

References GetTemplateTargetURLFromComponent(), pImp, and SAL_WARN.

Referenced by Copy(), and Move().

◆ CopyTo()

bool SfxDocumentTemplates::CopyTo ( sal_uInt16  nRegion,
sal_uInt16  nIdx,
std::u16string_view  rName 
) const

◆ Delete()

bool SfxDocumentTemplates::Delete ( sal_uInt16  nRegion,
sal_uInt16  nIdx 
)

Definition at line 923 of file doctempl.cxx.

References pImp.

◆ GetCount()

sal_uInt16 SfxDocumentTemplates::GetCount ( sal_uInt16  nRegion) const

◆ GetFull()

bool SfxDocumentTemplates::GetFull ( std::u16string_view  rRegion,
std::u16string_view  rName,
OUString &  rPath 
)

◆ GetFullRegionName()

OUString SfxDocumentTemplates::GetFullRegionName ( sal_uInt16  nIdx) const

◆ GetLogicNames()

bool SfxDocumentTemplates::GetLogicNames ( std::u16string_view  rPath,
OUString &  rRegion,
OUString &  rName 
) const

◆ GetName()

OUString SfxDocumentTemplates::GetName ( sal_uInt16  nRegion,
sal_uInt16  nIdx 
) const

Definition at line 362 of file doctempl.cxx.

Referenced by SfxSaveAsTemplateDialog::IsTemplateNameUnique().

◆ GetPath()

OUString SfxDocumentTemplates::GetPath ( sal_uInt16  nRegion,
sal_uInt16  nIdx 
) const

Definition at line 396 of file doctempl.cxx.

Referenced by SfxNewFileDialog::GetTemplateFileName().

◆ GetRegionCount()

sal_uInt16 SfxDocumentTemplates::GetRegionCount ( ) const

◆ GetRegionName()

OUString SfxDocumentTemplates::GetRegionName ( sal_uInt16  nIdx) const

Definition at line 284 of file doctempl.cxx.

References pData.

◆ GetTemplateTargetURLFromComponent()

OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent ( std::u16string_view  aGroupName,
std::u16string_view  aTitle 
)

◆ InsertDir()

bool SfxDocumentTemplates::InsertDir ( const OUString &  rText,
sal_uInt16  nRegion 
)

Definition at line 986 of file doctempl.cxx.

References tools::SvRef< typename T >::get(), and pImp.

◆ InsertTemplate()

bool SfxDocumentTemplates::InsertTemplate ( sal_uInt16  nSourceRegion,
sal_uInt16  nIdx,
const OUString &  rName,
const OUString &  rPath 
)

Definition at line 1026 of file doctempl.cxx.

References pImp, and pos.

Referenced by SfxSaveAsTemplateDialog::SaveTemplate().

◆ Move()

bool SfxDocumentTemplates::Move ( sal_uInt16  nTargetRegion,
sal_uInt16  nTargetIdx,
sal_uInt16  nSourceRegion,
sal_uInt16  nSourceIdx 
)

Definition at line 656 of file doctempl.cxx.

References CopyOrMove(), and pImp.

◆ operator=()

const SfxDocumentTemplates & SfxDocumentTemplates::operator= ( const SfxDocumentTemplates )

References Copy, Delete, GetName(), GetPath(), Move, and Update.

◆ ReInitFromComponent()

void SfxDocumentTemplates::ReInitFromComponent ( )

Definition at line 1246 of file doctempl.cxx.

References pImp.

◆ SetName()

bool SfxDocumentTemplates::SetName ( const OUString &  rName,
sal_uInt16  nRegion,
sal_uInt16  nIdx 
)

Change the name of an entry or a directory.

Parameters
rNameThe new name to set
nRegionThe id of the region to rename or containing the template to rename
nIdxThe id of the template to rename or USHRT_MAX to rename the region.
Returns
sal_True if the action could be performed, sal_False otherwise

Definition at line 1044 of file doctempl.cxx.

References pImp.

◆ Update()

void SfxDocumentTemplates::Update ( )

updates the configuration where the document templates structure is stored.

The info about the document templates (which files, which groups etc.) is stored in the configuration. This means that just by copying files into OOo's template directories, this change is not reflected in the SfxDocumentTemplates - 'cause the configuration is not synchronous with the file system. This can be enforced with this method.

Definition at line 1237 of file doctempl.cxx.

References pImp.

Referenced by SfxSaveAsTemplateDialog::SaveTemplate(), and SfxNewFileDialog::SfxNewFileDialog().

Member Data Documentation

◆ pImp

tools::SvRef<SfxDocTemplate_Impl> SfxDocumentTemplates::pImp
private

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