LibreOffice Module sw (master)  1
glossary.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_GLOSSARY_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSSARY_HXX
21 
22 #include <vcl/edit.hxx>
23 #include <vcl/customweld.hxx>
24 #include <vcl/weld.hxx>
25 
26 #include <com/sun/star/text/XAutoTextContainer2.hpp>
27 
28 #include <rtl/ustring.hxx>
29 #include <sfx2/basedlgs.hxx>
30 
31 struct GroupUserData;
32 class SwGlossaryHdl;
33 class SwNewGlosNameDlg;
34 class SwWrtShell;
35 class SfxViewFrame;
36 class PopupMenu;
37 class Menu;
38 class SwOneExampleFrame;
39 
40 const short RET_EDIT = 100;
41 
43 {
44  friend class SwNewGlosNameDlg;
45 
46  OUString const m_sReadonlyPath;
47 
48  css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText;
49 
51 
52  OUString m_sResumeGroup;
54  bool m_bResume;
55 
56  const bool m_bSelection : 1;
57  bool m_bReadOnly : 1;
58  bool m_bIsOld : 1;
60 
62 
63  std::vector<std::unique_ptr<GroupUserData>> m_xGroupData;
64 
65  std::unique_ptr<weld::CheckButton> m_xInsertTipCB;
66  std::unique_ptr<weld::Entry> m_xNameED;
67  std::unique_ptr<weld::Label> m_xShortNameLbl;
69  std::unique_ptr<weld::Entry> m_xShortNameEdit;
70  std::unique_ptr<weld::TreeView> m_xCategoryBox;
71  std::unique_ptr<weld::CheckButton> m_xFileRelCB;
72  std::unique_ptr<weld::CheckButton> m_xNetRelCB;
73  std::unique_ptr<weld::Button> m_xInsertBtn;
74  std::unique_ptr<weld::MenuButton> m_xEditBtn;
75  std::unique_ptr<weld::Button> m_xBibBtn;
76  std::unique_ptr<weld::Button> m_xPathBtn;
77  std::unique_ptr<SwOneExampleFrame> m_xExampleFrame;
78  std::unique_ptr<weld::CustomWeld> m_xExampleFrameWin;
79 
80  void EnableShortName(bool bOn = true);
81  void ShowPreview();
82 
83  DECL_LINK( NameModify, weld::Entry&, void );
84  DECL_LINK( NameDoubleClick, weld::TreeView&, void );
85  DECL_LINK( GrpSelect, weld::TreeView&, void );
86  DECL_LINK( MenuHdl, const OString&, void );
87  DECL_LINK( EnableHdl, weld::ToggleButton&, void );
88  DECL_LINK( BibHdl, weld::Button&, void );
89  DECL_LINK( InsertHdl, weld::Button&, void );
90  DECL_LINK( PathHdl, weld::Button&, void );
91  DECL_LINK( CheckBoxHdl, weld::ToggleButton&, void );
92  DECL_LINK( PreviewLoadedHdl, SwOneExampleFrame&, void );
93  DECL_LINK( KeyInputHdl, const KeyEvent&, bool );
94  DECL_LINK( TextFilterHdl, OUString&, bool );
95 
96  void Apply();
97  void Init();
98  std::unique_ptr<weld::TreeIter> DoesBlockExist(const OUString& sBlock, const OUString& rShort);
99  void ShowAutoText(const OUString& rGroup, const OUString& rShortName);
100  void ResumeShowAutoText();
101 
102  bool GetResumeData(OUString& rGroup, OUString& rShortName)
103  {rGroup = m_sResumeGroup; rShortName = m_sResumeShortName; return m_bResume;}
104  void SetResumeData(const OUString& rGroup, const OUString& rShortName)
105  {m_sResumeGroup = rGroup; m_sResumeShortName = rShortName; m_bResume = true;}
106 
107  void DeleteEntry();
108 public:
109  SwGlossaryDlg(SfxViewFrame const * pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell);
110  virtual short run() override;
111  virtual ~SwGlossaryDlg() override;
112  OUString GetCurrGrpName() const;
113  OUString GetCurrShortName() const
114  {
115  return m_xShortNameEdit->get_text();
116  }
117  static OUString GetCurrGroup();
118  static void SetActGroup(const OUString& rNewGroup);
119 };
120 
121 #endif
122 
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetResumeData(OUString &rGroup, OUString &rShortName)
Definition: glossary.hxx:102
bool m_bIsDocReadOnly
Definition: glossary.hxx:59
void ShowAutoText(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.cxx:903
std::unique_ptr< weld::Entry > m_xShortNameEdit
Definition: glossary.hxx:69
virtual ~SwGlossaryDlg() override
Definition: glossary.cxx:251
std::unique_ptr< weld::CheckButton > m_xNetRelCB
Definition: glossary.hxx:72
static void SetActGroup(const OUString &rNewGroup)
Definition: glossary.cxx:176
bool m_bResume
Definition: glossary.hxx:54
std::unique_ptr< weld::Button > m_xInsertBtn
Definition: glossary.hxx:73
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
std::unique_ptr< weld::Label > m_xShortNameLbl
Definition: glossary.hxx:67
OUString m_sResumeShortName
Definition: glossary.hxx:53
SwGlossaryHdl * m_pGlossaryHdl
Definition: glossary.hxx:50
bool m_bReadOnly
Definition: glossary.hxx:57
void Apply()
Definition: glossary.cxx:330
static OUString GetCurrGroup()
Definition: glossary.cxx:169
std::unique_ptr< weld::MenuButton > m_xEditBtn
Definition: glossary.hxx:74
virtual short run() override
Definition: glossary.cxx:322
std::unique_ptr< weld::Entry > m_xNameED
Definition: glossary.hxx:66
SwGlossaryDlg(SfxViewFrame const *pViewFrame, SwGlossaryHdl *pGlosHdl, SwWrtShell *pWrtShell)
Definition: glossary.cxx:187
std::unique_ptr< weld::CustomWeld > m_xExampleFrameWin
Definition: glossary.hxx:78
OUString const m_sReadonlyPath
Definition: glossary.hxx:46
std::unique_ptr< weld::CheckButton > m_xFileRelCB
Definition: glossary.hxx:71
std::unique_ptr< weld::Button > m_xBibBtn
Definition: glossary.hxx:75
OUString GetCurrGrpName() const
Definition: glossary.cxx:856
SwWrtShell * m_pShell
Definition: glossary.hxx:61
void EnableShortName(bool bOn=true)
Definition: glossary.cxx:346
std::unique_ptr< weld::TreeView > m_xCategoryBox
Definition: glossary.hxx:70
OUString m_sResumeGroup
Definition: glossary.hxx:52
DECL_LINK(NameModify, weld::Entry &, void)
void ShowPreview()
Definition: glossary.cxx:893
void ResumeShowAutoText()
Definition: glossary.cxx:913
std::vector< std::unique_ptr< GroupUserData > > m_xGroupData
Definition: glossary.hxx:63
OUString GetCurrShortName() const
Definition: glossary.hxx:113
css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText
Definition: glossary.hxx:48
std::unique_ptr< SwOneExampleFrame > m_xExampleFrame
Definition: glossary.hxx:77
void DeleteEntry()
Definition: glossary.cxx:946
std::unique_ptr< weld::CheckButton > m_xInsertTipCB
Definition: glossary.hxx:65
void SetResumeData(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.hxx:104
std::unique_ptr< weld::TreeIter > DoesBlockExist(const OUString &sBlock, const OUString &rShort)
Definition: glossary.cxx:353
const short RET_EDIT
Definition: glossary.hxx:40
TextFilter m_aNoSpaceFilter
Definition: glossary.hxx:68
const bool m_bSelection
Definition: glossary.hxx:56
std::unique_ptr< weld::Button > m_xPathBtn
Definition: glossary.hxx:76