bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / glosdoc.hxx
bloba3a6c798dc5a7356e5570fc87d4bbe173691553f
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 _GLOSDOC_HXX
20 #define _GLOSDOC_HXX
22 #include <tools/string.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 SV_DECL_REF( SwDocShell )
32 #endif
33 #include <cppuhelper/weakref.hxx>
35 #include <vector>
36 #include "swdllapi.h"
38 typedef ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XAutoTextGroup > AutoTextGroupRef;
39 typedef ::std::vector< AutoTextGroupRef > UnoAutoTextGroups;
41 typedef ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XAutoTextEntry > AutoTextEntryRef;
42 typedef ::std::vector< AutoTextEntryRef > UnoAutoTextEntries;
44 #define GLOS_DELIM (sal_Unicode)'*'
46 // CLASS -----------------------------------------------------------------
47 class SW_DLLPUBLIC SwGlossaries
49 UnoAutoTextGroups m_aGlossaryGroups;
50 UnoAutoTextEntries m_aGlossaryEntries;
52 String m_aPath;
53 std::vector<rtl::OUString> m_aInvalidPaths;
54 std::vector<String> m_PathArr;
55 std::vector<String> m_GlosArr;
56 sal_Bool m_bError;
58 SW_DLLPRIVATE SwTextBlocks* GetGlosDoc(const String &rName, sal_Bool bCreate = sal_True) const;
59 SW_DLLPRIVATE std::vector<String> & GetNameList();
61 // implementation in unoatxt.cxx
62 SW_DLLPRIVATE void RemoveFileFromList( const String& rGroup );
63 SW_DLLPRIVATE void InvalidateUNOOjects();
65 public:
66 SwGlossaries();
67 ~SwGlossaries();
69 /** returns the cached AutoTextGroup (if any) for the given group name
71 @precond
72 If <arg>_bCreate</arg> is <TRUE/>, the SolarMutex must be locked when calling into this method.
74 @param _rGroupName
75 the name of the glossaries group
76 @param _bCreate
77 if <TRUE/>, the group is created if it does not yet exist
79 ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextGroup >
80 GetAutoTextGroup(
81 const OUString& _rGroupName,
82 bool _bCreate = false
85 /** returns the cached AutoTextEntry (if any) for the given group/with the given name
87 @precond
88 If <arg>_bCreate</arg> is <TRUE/>, the SolarMutex must be locked when calling into this method.
90 @param _rGroupAccessName
91 the name to access the group
92 @param _rGroupName
93 the name of the glossaries group, as to be passed to the entry
94 @param _rEntryName
95 the name of the auto text entry
96 @param _bCreate
97 if <TRUE/>, the entry is created if it does not yet exist
99 ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextEntry >
100 GetAutoTextEntry(
101 const String& _rCompleteGroupName,
102 const OUString& _rGroupName,
103 const OUString& _rEntryName,
104 bool _bCreate = false
107 sal_uInt16 GetGroupCnt();
108 String GetGroupName(sal_uInt16 );
109 String GetGroupTitle( const String& rGroupName );
111 sal_Bool FindGroupName(String & rGroup);
113 SwTextBlocks* GetGroupDoc(const String &rName,
114 sal_Bool bCreate = sal_False);
115 SwTextBlocks* GetDefGroupDoc() { return GetGroupDoc(GetDefName()); }
116 void PutGroupDoc(SwTextBlocks *pBlock);
117 static String GetDefName();
118 static String GetExtension();
120 String GetCompleteGroupName( const OUString& GroupName );
122 sal_Bool NewGroupDoc(String &rGroupName, const String& rTitle);
123 sal_Bool RenameGroupDoc(const String& sOldGroup, String& sNewGroup, const String& rNewTitle);
124 sal_Bool DelGroupDoc(const String &);
125 SwDocShellRef EditGroupDoc(const String &rGrpName, const String& rShortName, sal_Bool bShow = sal_True );
126 void SaveGroupDoc(const String &rGrpName, const String& rLongName );
127 void UpdateGlosPath(sal_Bool bFull);
128 void ShowError();
129 inline sal_uLong IsGlosPathErr() { return m_bError; }
130 std::vector<String> const& GetPathArray() const { return m_PathArr; }
134 #endif // _GLOSDOC_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */