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 
28 class SwWrtShell;
29 class SwTextBlocks;
30 class SvxMacro;
31 class SwGlossaries;
32 class SfxViewFrame;
33 
35 {
36 
38  OUString 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 
48 public:
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(const OUString &rName);
61  OUString GetGlossaryShortName(sal_uInt16);
62 
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);
72 
73  bool ExpandGlossary(weld::Window* pParent);
74  bool InsertGlossary(const OUString &rName);
75 
76  void SetMacros(const OUString& rName,
77  const SvxMacro* pStart,
78  const SvxMacro* pEnd,
79  SwTextBlocks *pGlossary = nullptr );
80  void GetMacros(const OUString& rShortName,
81  SvxMacro& rStart,
82  SvxMacro& rEnd,
83  SwTextBlocks* pGlossary = nullptr );
84 
85  bool IsReadOnly( const OUString* = nullptr ) const;
86  bool IsOld() const;
87 
88  bool FindGroupName(OUString& rGroup); // find group without path index
89 
90  bool ImportGlossaries( const OUString& rName );
91 
92  SwGlossaryHdl(SfxViewFrame* pViewFrame, SwWrtShell *);
93  ~SwGlossaryHdl();
94 };
95 
96 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwWrtShell * pWrtShell
Definition: gloshdl.hxx:40
bool IsReadOnly(const OUString &rURL, bool *pbExist)
std::unique_ptr< SwTextBlocks > pCurGrp
Definition: gloshdl.hxx:42
SwGlossaries & rStatGlossaries
Definition: gloshdl.hxx:37
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
static std::unique_ptr< SwGlossaries > pGlossaries
Definition: initui.cxx:41
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
OUString aCurGrp
Definition: gloshdl.hxx:38
SfxViewFrame *const pViewFrame
Definition: gloshdl.hxx:39