1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
28 #ifndef SW_DECL_SWDOCSHELL_DEFINED
29 #define SW_DECL_SWDOCSHELL_DEFINED
30 #include <tools/ref.hxx>
31 typedef tools::SvRef
<SwDocShell
> SwDocShellRef
;
33 #include <cppuhelper/weakref.hxx>
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
;
49 std::vector
<OUString
> m_aInvalidPaths
;
50 std::vector
<OUString
> m_PathArr
;
51 std::vector
<OUString
> m_GlosArr
;
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();
65 /** returns the cached AutoTextGroup (if any) for the given group name
66 The group is created if it does not yet exist
69 If <arg>_bCreate</arg> is <TRUE/>, the SolarMutex must be locked when calling into this method.
72 the name of the glossaries group
74 css::uno::Reference
< css::text::XAutoTextGroup
>
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
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
88 the name of the glossaries group, as to be passed to the entry
90 the name of the auto text entry
92 css::uno::Reference
< css::text::XAutoTextEntry
>
94 const OUString
& _rCompleteGroupName
,
95 const OUString
& _rGroupName
,
96 const OUString
& _rEntryName
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
);
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: */