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_GLOSHDL_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
23 #include <rtl/ustring.hxx>
24 #include <vcl/weld.hxx>
34 class SW_DLLPUBLIC SwGlossaryHdl
37 SwGlossaries
& rStatGlossaries
;
39 SfxViewFrame
* pViewFrame
;
40 SwWrtShell
* pWrtShell
;
41 std::unique_ptr
<SwTextBlocks
>
44 SAL_DLLPRIVATE
bool Expand(weld::Window
* pParent
, const OUString
& rShortName
,
45 SwGlossaries
* pGlossaries
,
46 std::unique_ptr
<SwTextBlocks
> pGlossary
);
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);
58 sal_uInt16
GetGlossaryCnt() const;
59 OUString
GetGlossaryName(sal_uInt16
);
60 OUString
GetGlossaryShortName(const OUString
&rName
);
61 OUString
GetGlossaryShortName(sal_uInt16
);
63 bool Rename( const OUString
& rOldShortName
, const OUString
& rNewShortName
,
64 const OUString
& rNewName
);
65 bool HasShortName(const OUString
&rShortName
) const;
66 // when NewGlossary is called from Basic then the previously set group should
67 // be newly created if applicable.
68 bool NewGlossary(const OUString
&rName
, const OUString
&rShortName
,
69 bool bApiCall
= false, bool bNoAttr
= false );
70 bool DelGlossary(const OUString
&);
71 bool CopyToClipboard(SwWrtShell
& rSh
, const OUString
& rShortName
);
73 bool ExpandGlossary(weld::Window
* pParent
);
74 bool InsertGlossary(const OUString
&rName
);
76 void SetMacros(const OUString
& rName
,
77 const SvxMacro
* pStart
,
79 SwTextBlocks
*pGlossary
= nullptr );
80 void GetMacros(const OUString
& rShortName
,
83 SwTextBlocks
* pGlossary
= nullptr );
85 bool IsReadOnly( const OUString
* = nullptr ) const;
88 bool FindGroupName(OUString
& rGroup
); // find group without path index
90 bool ImportGlossaries( const OUString
& rName
);
92 SwGlossaryHdl(SfxViewFrame
* pViewFrame
, SwWrtShell
*);
96 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */