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 <unotools/weakref.hxx>
24#include <com/sun/star/text/XAutoTextGroup.hpp>
25
26class SwTextBlocks;
27class SwDocShell;
28
29#ifndef SW_DECL_SWDOCSHELL_DEFINED
30#define SW_DECL_SWDOCSHELL_DEFINED
31#include <tools/ref.hxx>
33#endif
35
36#include <vector>
37#include <swdllapi.h>
38
41
42typedef std::vector< unotools::WeakReference< SwXAutoTextGroup > > UnoAutoTextGroups;
43typedef std::vector< unotools::WeakReference< SwXAutoTextEntry > > UnoAutoTextEntries;
44
45#define GLOS_DELIM u'*'
46
48{
51
52 OUString m_aPath;
53 std::vector<OUString> m_aInvalidPaths;
54 std::vector<OUString> m_PathArr;
55 std::vector<OUString> m_GlosArr;
57
58 SAL_DLLPRIVATE std::unique_ptr<SwTextBlocks> GetGlosDoc(const OUString &rName, bool bCreate = true) const;
59 SAL_DLLPRIVATE std::vector<OUString> & GetNameList();
60
61 // implementation in unoatxt.cxx
62 SAL_DLLPRIVATE void RemoveFileFromList( const OUString& rGroup );
63 SAL_DLLPRIVATE void InvalidateUNOOjects();
64
65public:
68
78 css::uno::Reference< css::text::XAutoTextGroup >
79 GetAutoTextGroup(
80 std::u16string_view _rGroupName
81 );
82
96 css::uno::Reference< css::text::XAutoTextEntry >
97 GetAutoTextEntry(
98 const OUString& _rCompleteGroupName,
99 const OUString& _rGroupName,
100 const OUString& _rEntryName
101 );
102
103 size_t GetGroupCnt();
104 OUString const & GetGroupName(size_t);
105 OUString GetGroupTitle( const OUString& rGroupName );
106
107 bool FindGroupName(OUString& rGroup);
108
109 std::unique_ptr<SwTextBlocks>
110 GetGroupDoc(const OUString &rName,
111 bool bCreate = false);
112 static OUString GetDefName();
113 static OUString GetExtension();
114
115 OUString GetCompleteGroupName( std::u16string_view GroupName );
116
117 bool NewGroupDoc(OUString &rGroupName, const OUString& rTitle);
118 bool RenameGroupDoc(const OUString& sOldGroup, OUString& sNewGroup, const OUString& rNewTitle);
119 bool DelGroupDoc(std::u16string_view);
120 SwDocShellRef EditGroupDoc(const OUString &rGrpName, const OUString& rShortName, bool bShow = true );
121 void UpdateGlosPath(bool bFull);
122 void ShowError();
123 bool IsGlosPathErr() const { return m_bError; }
124 std::vector<OUString> const& GetPathArray() const { return m_PathArr; }
125};
126
127#endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSDOC_HXX
128
129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool m_bError
OUString m_aPath
Definition: glosdoc.hxx:52
std::vector< OUString > const & GetPathArray() const
Definition: glosdoc.hxx:124
bool m_bError
Definition: glosdoc.hxx:56
std::vector< OUString > m_PathArr
Definition: glosdoc.hxx:54
std::vector< OUString > m_aInvalidPaths
Definition: glosdoc.hxx:53
UnoAutoTextGroups m_aGlossaryGroups
Definition: glosdoc.hxx:49
UnoAutoTextEntries m_aGlossaryEntries
Definition: glosdoc.hxx:50
bool IsGlosPathErr() const
Definition: glosdoc.hxx:123
std::vector< OUString > m_GlosArr
Definition: glosdoc.hxx:55
std::vector< unotools::WeakReference< SwXAutoTextEntry > > UnoAutoTextEntries
Definition: glosdoc.hxx:43
tools::SvRef< SwDocShell > SwDocShellRef
Definition: glosdoc.hxx:32
std::vector< unotools::WeakReference< SwXAutoTextGroup > > UnoAutoTextGroups
Definition: glosdoc.hxx:40
#define SW_DLLPUBLIC
Definition: swdllapi.h:28