lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / sfx2 / doctempl.hxx
blob6ad16ceb63c24aa55a7cd208fbc26d964f5d62bd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SFX2_DOCTEMPL_HXX
20 #define INCLUDED_SFX2_DOCTEMPL_HXX
22 #include <rtl/ustring.hxx>
23 #include <sal/config.h>
24 #include <sal/types.h>
25 #include <sfx2/dllapi.h>
26 #include <tools/ref.hxx>
28 // CLASS -----------------------------------------------------------------
30 class SfxDocTemplate_Impl;
32 // class SfxDocumentTemplates --------------------------------------------
34 class SFX2_DLLPUBLIC SfxDocumentTemplates
36 private:
37 tools::SvRef<SfxDocTemplate_Impl> pImp;
39 SAL_DLLPRIVATE bool CopyOrMove( sal_uInt16 nTargetRegion, sal_uInt16 nTargetIdx,
40 sal_uInt16 nSourceRegion, sal_uInt16 nSourceIdx, bool bMove );
41 public:
42 SfxDocumentTemplates();
43 SfxDocumentTemplates(const SfxDocumentTemplates &);
44 ~SfxDocumentTemplates();
46 const SfxDocumentTemplates &operator=(const SfxDocumentTemplates &);
48 void ReInitFromComponent();
50 sal_uInt16 GetRegionCount() const;
51 OUString GetRegionName(sal_uInt16 nIdx) const; //dv!
52 OUString GetFullRegionName(sal_uInt16 nIdx) const;
54 sal_uInt16 GetCount(sal_uInt16 nRegion) const;
55 OUString GetName(sal_uInt16 nRegion, sal_uInt16 nIdx) const; //dv!
56 OUString GetPath(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
58 // Allows to retrieve the target template URL from the UCB
59 OUString GetTemplateTargetURLFromComponent( const OUString& aGroupName,
60 const OUString& aTitle );
62 // Convert a resource string - a template name - to its localised pair
63 // if it exists in sfx2/inc/strings.hxx
64 static OUString ConvertResourceString(const OUString& rString);
66 bool Copy(sal_uInt16 nTargetRegion,
67 sal_uInt16 nTargetIdx,
68 sal_uInt16 nSourceRegion,
69 sal_uInt16 nSourceIdx);
70 bool Move(sal_uInt16 nTargetRegion,
71 sal_uInt16 nTargetIdx,
72 sal_uInt16 nSourceRegion,
73 sal_uInt16 nSourceIdx);
74 bool Delete(sal_uInt16 nRegion, sal_uInt16 nIdx);
75 bool InsertDir(const OUString &rText, sal_uInt16 nRegion);
77 bool InsertTemplate (sal_uInt16 nSourceRegion, sal_uInt16 nIdx, const OUString &rName, const OUString &rPath);
79 /** Change the name of an entry or a directory
81 \param rName
82 The new name to set
83 \param nRegion
84 The id of the region to rename or containing the template to rename
85 \param nIdx
86 The id of the template to rename or USHRT_MAX to rename the region.
88 \return
89 sal_True if the action could be performed, sal_False otherwise
92 bool SetName(const OUString &rName, sal_uInt16 nRegion, sal_uInt16 nIdx);
94 bool CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const OUString &rName) const;
95 bool CopyFrom(sal_uInt16 nRegion, sal_uInt16 nIdx, OUString &rName);
97 bool GetFull( const OUString& rRegion, const OUString& rName, OUString& rPath );
98 bool GetLogicNames( const OUString& rPath, OUString& rRegion, OUString& rName ) const;
100 /** updates the configuration where the document templates structure is stored.
102 <p>The info about the document templates (which files, which groups etc.) is stored in the
103 configuration. This means that just by copying files into OOo's template directories, this
104 change is not reflected in the SfxDocumentTemplates - 'cause the configuration is not synchronous with
105 the file system. This can be enforced with this method.</p>
107 void Update();
110 #endif // INCLUDED_SFX2_DOCTEMPL_HXX
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */