nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / glosdoc.hxx
blob14b4be59eef66a50df5c07596a608684b1520b1a
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_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
22 #include <rtl/ustring.hxx>
23 #include <com/sun/star/text/XAutoTextGroup.hpp>
25 class SwTextBlocks;
26 class SwDocShell;
28 #ifndef SW_DECL_SWDOCSHELL_DEFINED
29 #define SW_DECL_SWDOCSHELL_DEFINED
30 #include <tools/ref.hxx>
31 typedef tools::SvRef<SwDocShell> SwDocShellRef;
32 #endif
33 #include <cppuhelper/weakref.hxx>
35 #include <vector>
36 #include <swdllapi.h>
38 typedef std::vector< css::uno::WeakReference< css::text::XAutoTextGroup > > UnoAutoTextGroups;
39 typedef std::vector< css::uno::WeakReference< css::text::XAutoTextEntry > > UnoAutoTextEntries;
41 #define GLOS_DELIM u'*'
43 class SW_DLLPUBLIC SwGlossaries
45 UnoAutoTextGroups m_aGlossaryGroups;
46 UnoAutoTextEntries m_aGlossaryEntries;
48 OUString m_aPath;
49 std::vector<OUString> m_aInvalidPaths;
50 std::vector<OUString> m_PathArr;
51 std::vector<OUString> m_GlosArr;
52 bool m_bError;
54 SAL_DLLPRIVATE std::unique_ptr<SwTextBlocks> GetGlosDoc(const OUString &rName, bool bCreate = true) const;
55 SAL_DLLPRIVATE std::vector<OUString> & GetNameList();
57 // implementation in unoatxt.cxx
58 SAL_DLLPRIVATE void RemoveFileFromList( const OUString& rGroup );
59 SAL_DLLPRIVATE void InvalidateUNOOjects();
61 public:
62 SwGlossaries();
63 ~SwGlossaries();
65 /** returns the cached AutoTextGroup (if any) for the given group name
66 The group is created if it does not yet exist
68 @precond
69 If <arg>_bCreate</arg> is <TRUE/>, the SolarMutex must be locked when calling into this method.
71 @param _rGroupName
72 the name of the glossaries group
74 css::uno::Reference< css::text::XAutoTextGroup >
75 GetAutoTextGroup(
76 const OUString& _rGroupName
79 /** returns the cached AutoTextEntry (if any) for the given group/with the given name
80 The entry is created if it does not yet exist
82 @precond
83 If <arg>_bCreate</arg> is <TRUE/>, the SolarMutex must be locked when calling into this method.
85 @param _rGroupAccessName
86 the name to access the group
87 @param _rGroupName
88 the name of the glossaries group, as to be passed to the entry
89 @param _rEntryName
90 the name of the auto text entry
92 css::uno::Reference< css::text::XAutoTextEntry >
93 GetAutoTextEntry(
94 const OUString& _rCompleteGroupName,
95 const OUString& _rGroupName,
96 const OUString& _rEntryName
99 size_t GetGroupCnt();
100 OUString const & GetGroupName(size_t);
101 OUString GetGroupTitle( const OUString& rGroupName );
103 bool FindGroupName(OUString& rGroup);
105 std::unique_ptr<SwTextBlocks>
106 GetGroupDoc(const OUString &rName,
107 bool bCreate = false);
108 static OUString GetDefName();
109 static OUString GetExtension();
111 OUString GetCompleteGroupName( const OUString& GroupName );
113 bool NewGroupDoc(OUString &rGroupName, const OUString& rTitle);
114 bool RenameGroupDoc(const OUString& sOldGroup, OUString& sNewGroup, const OUString& rNewTitle);
115 bool DelGroupDoc(const OUString &);
116 SwDocShellRef EditGroupDoc(const OUString &rGrpName, const OUString& rShortName, bool bShow = true );
117 void UpdateGlosPath(bool bFull);
118 void ShowError();
119 bool IsGlosPathErr() const { return m_bError; }
120 std::vector<OUString> const& GetPathArray() const { return m_PathArr; }
123 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */