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/customweld.hxx>
23#include <vcl/textfilter.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
31struct GroupUserData;
32class SwGlossaryHdl;
34class SwWrtShell;
35class SfxViewFrame;
36class PopupMenu;
37class Menu;
39
40const short RET_EDIT = 100;
41
43
45{
46 friend class SwNewGlosNameDlg;
47
48 OUString const m_sReadonlyPath;
49
50 css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText;
51
53
57
58 const bool m_bSelection : 1;
59 bool m_bReadOnly : 1;
60 bool m_bIsOld : 1;
62
64
65 std::vector<std::unique_ptr<GroupUserData>> m_xGroupData;
66
67 std::unique_ptr<weld::CheckButton> m_xInsertTipCB;
68 std::unique_ptr<weld::Entry> m_xNameED;
69 std::unique_ptr<weld::Label> m_xShortNameLbl;
71 std::unique_ptr<weld::Entry> m_xShortNameEdit;
72 std::unique_ptr<weld::TreeView> m_xCategoryBox;
73 std::unique_ptr<weld::CheckButton> m_xFileRelCB;
74 std::unique_ptr<weld::CheckButton> m_xNetRelCB;
75 std::unique_ptr<weld::Button> m_xInsertBtn;
76 std::unique_ptr<weld::MenuButton> m_xEditBtn;
77 std::unique_ptr<weld::Button> m_xBibBtn;
78 std::unique_ptr<weld::Button> m_xPathBtn;
79 std::unique_ptr<SwOneExampleFrame> m_xExampleFrame;
80 std::unique_ptr<weld::CustomWeld> m_xExampleFrameWin;
81 std::unique_ptr<SwGlossaryDropTarget> m_xDropTarget;
82
83 void EnableShortName(bool bOn = true);
84 void ShowPreview();
85
86 DECL_LINK( NameModify, weld::Entry&, void );
87 DECL_LINK( NameDoubleClick, weld::TreeView&, bool );
88 DECL_LINK( GrpSelect, weld::TreeView&, void );
89 DECL_LINK( MenuHdl, const OUString&, void );
90 DECL_LINK( EnableHdl, weld::Toggleable&, void );
91 DECL_LINK( BibHdl, weld::Button&, void );
92 DECL_LINK( InsertHdl, weld::Button&, void );
93 DECL_LINK( PathHdl, weld::Button&, void );
94 DECL_LINK( CheckBoxHdl, weld::Toggleable&, void );
95 DECL_LINK( PreviewLoadedHdl, SwOneExampleFrame&, void );
96 DECL_LINK( KeyInputHdl, const KeyEvent&, bool );
97 DECL_LINK( TextFilterHdl, OUString&, bool );
98
99 void Apply();
100 void Init();
101 std::unique_ptr<weld::TreeIter> DoesBlockExist(std::u16string_view sBlock, std::u16string_view rShort);
102 void ShowAutoText(const OUString& rGroup, const OUString& rShortName);
103 void ResumeShowAutoText();
104
105 bool GetResumeData(OUString& rGroup, OUString& rShortName)
106 {rGroup = m_sResumeGroup; rShortName = m_sResumeShortName; return m_bResume;}
107 void SetResumeData(const OUString& rGroup, const OUString& rShortName)
108 {m_sResumeGroup = rGroup; m_sResumeShortName = rShortName; m_bResume = true;}
109
110 void DeleteEntry();
111public:
112 SwGlossaryDlg(const SfxViewFrame& rViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell);
113 virtual short run() override;
114 virtual ~SwGlossaryDlg() override;
115 OUString GetCurrGrpName() const;
116 OUString GetCurrShortName() const
117 {
118 return m_xShortNameEdit->get_text();
119 }
120 static OUString GetCurrGroup();
121 static void SetActGroup(const OUString& rNewGroup);
122};
123
124#endif
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwGlossaryDlg(const SfxViewFrame &rViewFrame, SwGlossaryHdl *pGlosHdl, SwWrtShell *pWrtShell)
Definition: glossary.cxx:290
SwGlossaryHdl * m_pGlossaryHdl
Definition: glossary.hxx:52
std::unique_ptr< weld::CheckButton > m_xFileRelCB
Definition: glossary.hxx:73
DECL_LINK(PreviewLoadedHdl, SwOneExampleFrame &, void)
OUString const m_sReadonlyPath
Definition: glossary.hxx:48
std::unique_ptr< weld::MenuButton > m_xEditBtn
Definition: glossary.hxx:76
void ResumeShowAutoText()
Definition: glossary.cxx:1033
const bool m_bSelection
Definition: glossary.hxx:58
DECL_LINK(PathHdl, weld::Button &, void)
std::unique_ptr< SwGlossaryDropTarget > m_xDropTarget
Definition: glossary.hxx:81
bool m_bIsDocReadOnly
Definition: glossary.hxx:61
static void SetActGroup(const OUString &rNewGroup)
Definition: glossary.cxx:168
void Apply()
Definition: glossary.cxx:431
OUString GetCurrGrpName() const
Definition: glossary.cxx:976
std::unique_ptr< weld::CheckButton > m_xInsertTipCB
Definition: glossary.hxx:67
DECL_LINK(EnableHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Button > m_xBibBtn
Definition: glossary.hxx:77
void EnableShortName(bool bOn=true)
Definition: glossary.cxx:447
OUString GetCurrShortName() const
Definition: glossary.hxx:116
bool m_bReadOnly
Definition: glossary.hxx:59
TextFilter m_aNoSpaceFilter
Definition: glossary.hxx:70
virtual short run() override
Definition: glossary.cxx:423
std::unique_ptr< weld::CheckButton > m_xNetRelCB
Definition: glossary.hxx:74
void DeleteEntry()
Definition: glossary.cxx:1065
OUString m_sResumeGroup
Definition: glossary.hxx:54
std::unique_ptr< weld::Button > m_xPathBtn
Definition: glossary.hxx:78
std::unique_ptr< weld::TreeView > m_xCategoryBox
Definition: glossary.hxx:72
SwWrtShell * m_pShell
Definition: glossary.hxx:63
DECL_LINK(GrpSelect, weld::TreeView &, void)
std::unique_ptr< weld::Entry > m_xShortNameEdit
Definition: glossary.hxx:71
css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText
Definition: glossary.hxx:50
DECL_LINK(NameDoubleClick, weld::TreeView &, bool)
void SetResumeData(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.hxx:107
std::unique_ptr< weld::Entry > m_xNameED
Definition: glossary.hxx:68
void ShowAutoText(const OUString &rGroup, const OUString &rShortName)
Definition: glossary.cxx:1023
std::unique_ptr< weld::Button > m_xInsertBtn
Definition: glossary.hxx:75
bool m_bResume
Definition: glossary.hxx:56
std::unique_ptr< SwOneExampleFrame > m_xExampleFrame
Definition: glossary.hxx:79
static OUString GetCurrGroup()
Definition: glossary.cxx:161
DECL_LINK(InsertHdl, weld::Button &, void)
OUString m_sResumeShortName
Definition: glossary.hxx:55
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
DECL_LINK(BibHdl, weld::Button &, void)
DECL_LINK(CheckBoxHdl, weld::Toggleable &, void)
DECL_LINK(MenuHdl, const OUString &, void)
std::unique_ptr< weld::TreeIter > DoesBlockExist(std::u16string_view sBlock, std::u16string_view rShort)
Definition: glossary.cxx:454
virtual ~SwGlossaryDlg() override
Definition: glossary.cxx:357
bool GetResumeData(OUString &rGroup, OUString &rShortName)
Definition: glossary.hxx:105
std::unique_ptr< weld::CustomWeld > m_xExampleFrameWin
Definition: glossary.hxx:80
void ShowPreview()
Definition: glossary.cxx:1013
DECL_LINK(NameModify, weld::Entry &, void)
std::unique_ptr< weld::Label > m_xShortNameLbl
Definition: glossary.hxx:69
DECL_LINK(TextFilterHdl, OUString &, bool)
std::vector< std::unique_ptr< GroupUserData > > m_xGroupData
Definition: glossary.hxx:65
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
const short RET_EDIT
Definition: glossary.hxx:40