LibreOffice Module sfx2 (master) 1
doctempl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_SFX2_DOCTEMPL_HXX
20#define INCLUDED_SFX2_DOCTEMPL_HXX
21
22#include <sal/config.h>
23
24#include <string_view>
25
26#include <rtl/ustring.hxx>
27#include <sal/types.h>
28#include <sfx2/dllapi.h>
29#include <tools/ref.hxx>
30
31// CLASS -----------------------------------------------------------------
32
34
35// class SfxDocumentTemplates --------------------------------------------
36
38{
39private:
41
42 SAL_DLLPRIVATE bool CopyOrMove( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx,
43 sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx, bool bMove );
44public:
48
50
51 void ReInitFromComponent();
52
53 sal_uInt16 GetRegionCount() const;
54 OUString GetRegionName(sal_uInt16 nIdx) const; //dv!
55 OUString GetFullRegionName(sal_uInt16 nIdx) const;
56
57 sal_uInt16 GetCount(sal_uInt16 nRegion) const;
58 OUString GetName(sal_uInt16 nRegion, sal_uInt16 nIdx) const; //dv!
59 OUString GetPath(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
60
61 // Allows to retrieve the target template URL from the UCB
62 OUString GetTemplateTargetURLFromComponent(std::u16string_view aGroupName,
63 std::u16string_view aTitle );
64
65 // Convert a resource string - a template name - to its localised pair
66 // if it exists in sfx2/inc/strings.hxx
67 static OUString ConvertResourceString(const OUString& rString);
68
69 bool Copy(sal_uInt16 nTargetRegion,
70 sal_uInt16 nTargetIdx,
71 sal_uInt16 nSourceRegion,
72 sal_uInt16 nSourceIdx);
73 bool Move(sal_uInt16 nTargetRegion,
74 sal_uInt16 nTargetIdx,
75 sal_uInt16 nSourceRegion,
76 sal_uInt16 nSourceIdx);
77 bool Delete(sal_uInt16 nRegion, sal_uInt16 nIdx);
78 bool InsertDir(const OUString &rText, sal_uInt16 nRegion);
79
80 bool InsertTemplate (sal_uInt16 nSourceRegion, sal_uInt16 nIdx, const OUString &rName, const OUString &rPath);
81
95 bool SetName(const OUString &rName, sal_uInt16 nRegion, sal_uInt16 nIdx);
96
97 bool CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, std::u16string_view rName) const;
98 bool CopyFrom(sal_uInt16 nRegion, sal_uInt16 nIdx, OUString &rName);
99
100 bool GetFull(
101 std::u16string_view rRegion, std::u16string_view rName, OUString& rPath );
102 bool GetLogicNames( std::u16string_view rPath, OUString& rRegion, OUString& rName ) const;
103
111 void Update();
112};
113
114#endif // INCLUDED_SFX2_DOCTEMPL_HXX
115
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxDocumentTemplates(const SfxDocumentTemplates &)
const SfxDocumentTemplates & operator=(const SfxDocumentTemplates &)
tools::SvRef< SfxDocTemplate_Impl > pImp
Definition: doctempl.hxx:40
virtual OUString GetName() const override
virtual OUString GetPath() const override
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29