LibreOffice Module sw (master)  1
glosdoc.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_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
21 
22 #include <rtl/ustring.hxx>
23 #include <com/sun/star/text/XAutoTextGroup.hpp>
24 
25 class SwTextBlocks;
26 class SwDocShell;
27 
28 #ifndef SW_DECL_SWDOCSHELL_DEFINED
29 #define SW_DECL_SWDOCSHELL_DEFINED
30 #include <tools/ref.hxx>
32 #endif
33 #include <cppuhelper/weakref.hxx>
34 
35 #include <vector>
36 #include <swdllapi.h>
37 
38 typedef std::vector< css::uno::WeakReference< css::text::XAutoTextGroup > > UnoAutoTextGroups;
39 typedef std::vector< css::uno::WeakReference< css::text::XAutoTextEntry > > UnoAutoTextEntries;
40 
41 #define GLOS_DELIM u'*'
42 
44 {
47 
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;
53 
54  SAL_DLLPRIVATE std::unique_ptr<SwTextBlocks> GetGlosDoc(const OUString &rName, bool bCreate = true) const;
55  SAL_DLLPRIVATE std::vector<OUString> & GetNameList();
56 
57  // implementation in unoatxt.cxx
58  SAL_DLLPRIVATE void RemoveFileFromList( const OUString& rGroup );
59  SAL_DLLPRIVATE void InvalidateUNOOjects();
60 
61 public:
62  SwGlossaries();
63  ~SwGlossaries();
64 
74  css::uno::Reference< css::text::XAutoTextGroup >
75  GetAutoTextGroup(
76  const OUString& _rGroupName
77  );
78 
92  css::uno::Reference< css::text::XAutoTextEntry >
93  GetAutoTextEntry(
94  const OUString& _rCompleteGroupName,
95  const OUString& _rGroupName,
96  const OUString& _rEntryName
97  );
98 
99  size_t GetGroupCnt();
100  OUString const & GetGroupName(size_t);
101  OUString GetGroupTitle( const OUString& rGroupName );
102 
103  bool FindGroupName(OUString& rGroup);
104 
105  std::unique_ptr<SwTextBlocks>
106  GetGroupDoc(const OUString &rName,
107  bool bCreate = false);
108  static OUString GetDefName();
109  static OUString GetExtension();
110 
111  OUString GetCompleteGroupName( const OUString& GroupName );
112 
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() { return m_bError; }
120  std::vector<OUString> const& GetPathArray() const { return m_PathArr; }
121 };
122 
123 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< OUString > m_aInvalidPaths
Definition: glosdoc.hxx:49
bool IsGlosPathErr()
Definition: glosdoc.hxx:119
std::vector< OUString > m_GlosArr
Definition: glosdoc.hxx:51
UnoAutoTextGroups m_aGlossaryGroups
Definition: glosdoc.hxx:45
UnoAutoTextEntries m_aGlossaryEntries
Definition: glosdoc.hxx:46
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool m_bError
Definition: glosdoc.hxx:52
std::vector< css::uno::WeakReference< css::text::XAutoTextGroup > > UnoAutoTextGroups
Definition: glosdoc.hxx:38
tools::SvRef< SwDocShell > SwDocShellRef
Definition: glosdoc.hxx:31
std::vector< OUString > const & GetPathArray() const
Definition: glosdoc.hxx:120
std::vector< OUString > m_PathArr
Definition: glosdoc.hxx:50
std::vector< css::uno::WeakReference< css::text::XAutoTextEntry > > UnoAutoTextEntries
Definition: glosdoc.hxx:39
OUString m_aPath
Definition: glosdoc.hxx:48