LibreOffice Module sw (master) 1
gloshdl.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_GLOSHDL_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
21
22#include <memory>
23#include <rtl/ustring.hxx>
24#include <vcl/weld.hxx>
25
26#include <swdllapi.h>
27
28class SwWrtShell;
29class SwTextBlocks;
30class SvxMacro;
31class SwGlossaries;
32class SfxViewFrame;
33
35{
36
38 OUString m_aCurGrp;
41 std::unique_ptr<SwTextBlocks>
43
44 SAL_DLLPRIVATE bool Expand(weld::Window* pParent, const OUString& rShortName,
46 std::unique_ptr<SwTextBlocks> pGlossary );
47
48public:
49 void GlossaryDlg();
50
51 size_t GetGroupCnt() const;
52 OUString GetGroupName( size_t, OUString* pTitle );
53 void NewGroup(OUString & rGroupName, const OUString& rTitle);
54 bool DelGroup(const OUString &);
55 void RenameGroup(const OUString& rOld, OUString& rNew, const OUString& rNewTitle);
56 void SetCurGroup(const OUString &aGrp, bool bApi = false, bool bAlwaysCreateNew = false);
57
58 sal_uInt16 GetGlossaryCnt() const;
59 OUString GetGlossaryName(sal_uInt16);
60 OUString GetGlossaryShortName(std::u16string_view aName);
61 OUString GetGlossaryShortName(sal_uInt16);
62
63 bool Rename( const OUString& rOldShortName, const OUString& rNewShortName,
64 const OUString& rNewName);
65 bool CopyOrMove( const OUString& rSourceGroupName, OUString& rSourceShortName,
66 const OUString& rDestGroupName, const OUString& rLongName, bool bMove );
67 bool HasShortName(const OUString &rShortName) const;
68 // when NewGlossary is called from Basic then the previously set group should
69 // be newly created if applicable.
70 bool NewGlossary(const OUString &rName, const OUString &rShortName,
71 bool bApiCall = false, bool bNoAttr = false );
72 bool DelGlossary(const OUString&);
73 bool CopyToClipboard(SwWrtShell& rSh, const OUString& rShortName);
74
75 bool ExpandGlossary(weld::Window* pParent);
76 bool InsertGlossary(const OUString &rName);
77
78 void SetMacros(const OUString& rName,
79 const SvxMacro* pStart,
80 const SvxMacro* pEnd,
81 SwTextBlocks *pGlossary = nullptr );
82 void GetMacros(const OUString& rShortName,
83 SvxMacro& rStart,
84 SvxMacro& rEnd,
85 SwTextBlocks* pGlossary = nullptr );
86
87 bool IsReadOnly( const OUString* = nullptr ) const;
88 bool IsOld() const;
89
90 bool FindGroupName(OUString& rGroup); // find group without path index
91
92 bool ImportGlossaries( const OUString& rName );
93
96};
97
98#endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwWrtShell * m_pWrtShell
Definition: gloshdl.hxx:40
SwGlossaries & m_rStatGlossaries
Definition: gloshdl.hxx:37
std::unique_ptr< SwTextBlocks > m_pCurGrp
Definition: gloshdl.hxx:42
OUString m_aCurGrp
Definition: gloshdl.hxx:38
SfxViewFrame & m_rViewFrame
Definition: gloshdl.hxx:39
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
static std::unique_ptr< SwGlossaries > pGlossaries
Definition: initui.cxx:38
#define SW_DLLPUBLIC
Definition: swdllapi.h:28