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 <swdllapi.h>
25 
26 class SwWrtShell;
27 class SwTextBlocks;
28 class SvxMacro;
29 class SwGlossaries;
30 class SfxViewFrame;
31 
33 {
34 
36  OUString aCurGrp;
39  std::unique_ptr<SwTextBlocks>
41 
42  SAL_DLLPRIVATE bool Expand(weld::Window* pParent, const OUString& rShortName,
44  std::unique_ptr<SwTextBlocks> pGlossary );
45 
46 public:
47  void GlossaryDlg();
48 
49  size_t GetGroupCnt() const;
50  OUString GetGroupName( size_t, OUString* pTitle );
51  void NewGroup(OUString & rGroupName, const OUString& rTitle);
52  bool DelGroup(const OUString &);
53  void RenameGroup(const OUString& rOld, OUString& rNew, const OUString& rNewTitle);
54  void SetCurGroup(const OUString &aGrp, bool bApi = false, bool bAlwaysCreateNew = false);
55 
56  sal_uInt16 GetGlossaryCnt();
57  OUString GetGlossaryName(sal_uInt16);
58  OUString GetGlossaryShortName(const OUString &rName);
59  OUString GetGlossaryShortName(sal_uInt16);
60 
61  bool Rename( const OUString& rOldShortName, const OUString& rNewShortName,
62  const OUString& rNewName);
63  bool HasShortName(const OUString &rShortName) const;
64  // when NewGlossary is called from Basic then the previously set group should
65  // be newly created if applicable.
66  bool NewGlossary(const OUString &rName, const OUString &rShortName,
67  bool bApiCall = false, bool bNoAttr = false );
68  bool DelGlossary(const OUString&);
69  bool CopyToClipboard(SwWrtShell& rSh, const OUString& rShortName);
70 
71  bool ExpandGlossary(weld::Window* pParent);
72  bool InsertGlossary(const OUString &rName);
73 
74  void SetMacros(const OUString& rName,
75  const SvxMacro* pStart,
76  const SvxMacro* pEnd,
77  SwTextBlocks *pGlossary = nullptr );
78  void GetMacros(const OUString& rShortName,
79  SvxMacro& rStart,
80  SvxMacro& rEnd,
81  SwTextBlocks* pGlossary = nullptr );
82 
83  bool IsReadOnly( const OUString* = nullptr ) const;
84  bool IsOld() const;
85 
86  bool FindGroupName(OUString& rGroup); // find group without path index
87 
88  bool ImportGlossaries( const OUString& rName );
89 
90  SwGlossaryHdl(SfxViewFrame* pViewFrame, SwWrtShell *);
91  ~SwGlossaryHdl();
92 };
93 
94 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_GLOSHDL_HXX
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwWrtShell * pWrtShell
Definition: gloshdl.hxx:38
bool IsReadOnly(const OUString &rURL, bool *pbExist)
std::unique_ptr< SwTextBlocks > pCurGrp
Definition: gloshdl.hxx:40
SwGlossaries & rStatGlossaries
Definition: gloshdl.hxx:35
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
static std::unique_ptr< SwGlossaries > pGlossaries
Definition: initui.cxx:42
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
OUString aCurGrp
Definition: gloshdl.hxx:36
SfxViewFrame *const pViewFrame
Definition: gloshdl.hxx:37