LibreOffice Module sfx2 (master) 1
|
#include <doctempl.hxx>
Public Member Functions | |
SfxDocumentTemplates () | |
SfxDocumentTemplates (const SfxDocumentTemplates &) | |
~SfxDocumentTemplates () | |
const SfxDocumentTemplates & | operator= (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_Impl > | pImp |
Definition at line 37 of file doctempl.hxx.
SfxDocumentTemplates::SfxDocumentTemplates | ( | ) |
Definition at line 1211 of file doctempl.cxx.
References gpTemplateData, and pImp.
SfxDocumentTemplates::SfxDocumentTemplates | ( | const SfxDocumentTemplates & | ) |
SfxDocumentTemplates::~SfxDocumentTemplates | ( | ) |
Definition at line 1225 of file doctempl.cxx.
References pImp.
|
static |
Convert a template name to its localised pair if it exists.
rString | Name to be translated. |
Definition at line 464 of file doctempl.cxx.
References i, SAL_N_ELEMENTS, SfxResId(), STR_TEMPLATE_NAME10_DEF, STR_TEMPLATE_NAME11_DEF, STR_TEMPLATE_NAME12_DEF, STR_TEMPLATE_NAME13_DEF, STR_TEMPLATE_NAME14_DEF, STR_TEMPLATE_NAME15_DEF, STR_TEMPLATE_NAME16_DEF, STR_TEMPLATE_NAME17_DEF, STR_TEMPLATE_NAME18_DEF, STR_TEMPLATE_NAME19_DEF, STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME20_DEF, STR_TEMPLATE_NAME21_DEF, STR_TEMPLATE_NAME22_DEF, STR_TEMPLATE_NAME23_DEF, STR_TEMPLATE_NAME24_DEF, STR_TEMPLATE_NAME25_DEF, STR_TEMPLATE_NAME26_DEF, STR_TEMPLATE_NAME27_DEF, STR_TEMPLATE_NAME28_DEF, STR_TEMPLATE_NAME29_DEF, STR_TEMPLATE_NAME2_DEF, STR_TEMPLATE_NAME30_DEF, STR_TEMPLATE_NAME31_DEF, STR_TEMPLATE_NAME32_DEF, STR_TEMPLATE_NAME33_DEF, STR_TEMPLATE_NAME3_DEF, STR_TEMPLATE_NAME4_DEF, STR_TEMPLATE_NAME5_DEF, STR_TEMPLATE_NAME6_DEF, STR_TEMPLATE_NAME7_DEF, STR_TEMPLATE_NAME8_DEF, and STR_TEMPLATE_NAME9_DEF.
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.
bool SfxDocumentTemplates::CopyFrom | ( | sal_uInt16 | nRegion, |
sal_uInt16 | nIdx, | ||
OUString & | rName | ||
) |
Definition at line 784 of file doctempl.cxx.
References INetURLObject::All, aURL, Content, Exception, INetURLObject::GetMainURL(), comphelper::getProcessComponentContext(), getTextProperty_Impl(), INetURLObject::insertName(), INetURLObject::LAST_SEGMENT, comphelper::makePropertyValue(), INetURLObject::NONE, pImp, SAL_WARN, TARGET_URL, and INetURLObject::WithCharset.
|
private |
Definition at line 551 of file doctempl.cxx.
References GetTemplateTargetURLFromComponent(), pImp, and SAL_WARN.
bool SfxDocumentTemplates::CopyTo | ( | sal_uInt16 | nRegion, |
sal_uInt16 | nIdx, | ||
std::u16string_view | rName | ||
) | const |
Definition at line 715 of file doctempl.cxx.
References Any, aTargetURL, COMMAND_TRANSFER, Content, Exception, comphelper::getProcessComponentContext(), INetURLObject::LAST_SEGMENT, INetURLObject::NONE, and INetURLObject::WithCharset.
bool SfxDocumentTemplates::Delete | ( | sal_uInt16 | nRegion, |
sal_uInt16 | nIdx | ||
) |
Definition at line 923 of file doctempl.cxx.
References pImp.
sal_uInt16 SfxDocumentTemplates::GetCount | ( | sal_uInt16 | nRegion | ) | const |
Definition at line 333 of file doctempl.cxx.
References pData.
Referenced by SfxSaveAsTemplateDialog::IsTemplateNameUnique(), and SfxSaveAsTemplateDialog::SaveTemplate().
bool SfxDocumentTemplates::GetFull | ( | std::u16string_view | rRegion, |
std::u16string_view | rName, | ||
OUString & | rPath | ||
) |
Definition at line 1097 of file doctempl.cxx.
References GetRegionCount(), i, nCount, and pImp.
Referenced by SfxApplication::NewDocExec_Impl(), and SfxObjectShell::UpdateFromTemplate_Impl().
OUString SfxDocumentTemplates::GetFullRegionName | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 250 of file doctempl.cxx.
Referenced by SfxSaveAsTemplateDialog::initialize(), and SfxNewFileDialog::SfxNewFileDialog().
bool SfxDocumentTemplates::GetLogicNames | ( | std::u16string_view | rPath, |
OUString & | rRegion, | ||
OUString & | rName | ||
) | const |
Definition at line 1152 of file doctempl.cxx.
References INetURLObject::GetMainURL(), i, nCount, INetURLObject::NONE, pData, INetURLObject::SetSmartProtocol(), and INetURLObject::SetURL().
OUString SfxDocumentTemplates::GetName | ( | sal_uInt16 | nRegion, |
sal_uInt16 | nIdx | ||
) | const |
Definition at line 362 of file doctempl.cxx.
Referenced by SfxSaveAsTemplateDialog::IsTemplateNameUnique().
OUString SfxDocumentTemplates::GetPath | ( | sal_uInt16 | nRegion, |
sal_uInt16 | nIdx | ||
) | const |
Definition at line 396 of file doctempl.cxx.
Referenced by SfxNewFileDialog::GetTemplateFileName().
sal_uInt16 SfxDocumentTemplates::GetRegionCount | ( | ) | const |
Definition at line 313 of file doctempl.cxx.
References pImp.
Referenced by GetFull(), SfxNewFileDialog::GetTemplateFileName(), SfxSaveAsTemplateDialog::initialize(), and SfxNewFileDialog::SfxNewFileDialog().
OUString SfxDocumentTemplates::GetRegionName | ( | sal_uInt16 | nIdx | ) | const |
Definition at line 284 of file doctempl.cxx.
References pData.
OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent | ( | std::u16string_view | aGroupName, |
std::u16string_view | aTitle | ||
) |
Definition at line 429 of file doctempl.cxx.
References INetURLObject::All, Content, INetURLObject::GetMainURL(), comphelper::getProcessComponentContext(), getTextProperty_Impl(), INetURLObject::insertName(), INetURLObject::LAST_SEGMENT, INetURLObject::NONE, pImp, SvtPathOptions::SubstituteVariable(), and TARGET_URL.
Referenced by CopyOrMove(), and SfxSaveAsTemplateDialog::SaveTemplate().
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.
bool SfxDocumentTemplates::InsertTemplate | ( | sal_uInt16 | nSourceRegion, |
sal_uInt16 | nIdx, | ||
const OUString & | rName, | ||
const OUString & | rPath | ||
) |
Definition at line 1026 of file doctempl.cxx.
Referenced by SfxSaveAsTemplateDialog::SaveTemplate().
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.
const SfxDocumentTemplates & SfxDocumentTemplates::operator= | ( | const SfxDocumentTemplates & | ) |
void SfxDocumentTemplates::ReInitFromComponent | ( | ) |
Definition at line 1246 of file doctempl.cxx.
References pImp.
bool SfxDocumentTemplates::SetName | ( | const OUString & | rName, |
sal_uInt16 | nRegion, | ||
sal_uInt16 | nIdx | ||
) |
Change the name of an entry or a directory.
rName | The new name to set |
nRegion | The id of the region to rename or containing the template to rename |
nIdx | The id of the template to rename or USHRT_MAX to rename the region. |
Definition at line 1044 of file doctempl.cxx.
References pImp.
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().
|
private |
Definition at line 40 of file doctempl.hxx.
Referenced by Copy(), CopyFrom(), CopyOrMove(), Delete(), GetFull(), GetRegionCount(), GetTemplateTargetURLFromComponent(), InsertDir(), InsertTemplate(), Move(), ReInitFromComponent(), SetName(), SfxDocumentTemplates(), Update(), and ~SfxDocumentTemplates().