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_GLOSSARY_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSSARY_HXX
22 #include <vcl/customweld.hxx>
23 #include <vcl/textfilter.hxx>
24 #include <vcl/weld.hxx>
26 #include <com/sun/star/text/XAutoTextContainer2.hpp>
28 #include <rtl/ustring.hxx>
29 #include <sfx2/basedlgs.hxx>
33 class SwNewGlosNameDlg
;
38 class SwOneExampleFrame
;
40 const short RET_EDIT
= 100;
42 class SwGlossaryDlg
: public SfxDialogController
44 friend class SwNewGlosNameDlg
;
46 OUString
const m_sReadonlyPath
;
48 css::uno::Reference
< css::text::XAutoTextContainer2
> m_xAutoText
;
50 SwGlossaryHdl
* m_pGlossaryHdl
;
52 OUString m_sResumeGroup
;
53 OUString m_sResumeShortName
;
56 const bool m_bSelection
: 1;
59 bool m_bIsDocReadOnly
:1;
63 std::vector
<std::unique_ptr
<GroupUserData
>> m_xGroupData
;
65 std::unique_ptr
<weld::CheckButton
> m_xInsertTipCB
;
66 std::unique_ptr
<weld::Entry
> m_xNameED
;
67 std::unique_ptr
<weld::Label
> m_xShortNameLbl
;
68 TextFilter m_aNoSpaceFilter
;
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
;
80 void EnableShortName(bool bOn
= true);
83 DECL_LINK( NameModify
, weld::Entry
&, void );
84 DECL_LINK( NameDoubleClick
, weld::TreeView
&, bool );
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 );
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();
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;}
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
115 return m_xShortNameEdit
->get_text();
117 static OUString
GetCurrGroup();
118 static void SetActGroup(const OUString
& rNewGroup
);
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */