sd: keep a non-owning pointer to the OverridingShell
[LibreOffice.git] / cui / source / inc / optlingu.hxx
blob6c5657acf7bd6c8d6e8cc0a122744b3ac568a49a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <sfx2/tabdlg.hxx>
22 #include <svx/langbox.hxx>
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include <com/sun/star/configuration/ReadWriteAccess.hpp>
27 namespace com::sun::star{
28 namespace beans{
29 class XPropertySet;
31 namespace linguistic2{
32 class XDictionary;
33 class XDictionaryList;
34 class XLinguProperties;
38 class SvxLinguData_Impl;
40 // define ----------------------------------------------------------------
42 #define GROUP_MODULES (sal_uInt16(0x0008))
44 // forward ---------------------------------------------------------------
46 class SvxEditModulesDlg : public weld::GenericDialogController
48 OUString sSpell;
49 OUString sHyph;
50 OUString sThes;
51 OUString sGrammar;
53 std::unique_ptr<SvxLinguData_Impl> pDefaultLinguData;
54 SvxLinguData_Impl& rLinguData;
56 std::unique_ptr<weld::TreeView> m_xModulesCLB;
57 std::unique_ptr<weld::Button> m_xPrioUpPB;
58 std::unique_ptr<weld::Button> m_xPrioDownPB;
59 std::unique_ptr<weld::Button> m_xBackPB;
60 std::unique_ptr<weld::LinkButton> m_xMoreDictsLink;
61 std::unique_ptr<weld::Button> m_xClosePB;
62 std::unique_ptr<SvxLanguageBox> m_xLanguageLB;
64 css::uno::Reference< css::configuration::XReadWriteAccess> m_xReadWriteAccess;
66 DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
67 DECL_LINK( UpDownHdl_Impl, weld::Button&, void );
68 DECL_LINK( ClickHdl_Impl, weld::Button&, void );
69 DECL_LINK( BackHdl_Impl, weld::Button&, void );
70 DECL_LINK( LangSelectListBoxHdl_Impl, weld::ComboBox&, void );
71 DECL_LINK( BoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void );
72 DECL_STATIC_LINK( SvxEditModulesDlg, OnLinkClick, weld::LinkButton&, bool);
73 void LangSelectHdl_Impl(const SvxLanguageBox* pBox);
75 public:
76 SvxEditModulesDlg(weld::Window* pParent, SvxLinguData_Impl& rData);
77 virtual ~SvxEditModulesDlg() override;
80 struct ImplSVEvent;
82 // class SvxLinguTabPage -------------------------------------------------
83 class SvxLinguTabPage : public SfxTabPage
85 private:
86 OUString sCapitalWords;
87 OUString sWordsWithDigits;
88 OUString sSpellSpecial;
89 OUString sSpellAuto;
90 OUString sSpellClosedCompound;
91 OUString sSpellHyphenatedCompound;
92 OUString sGrammarAuto;
93 OUString sNumMinWordlen;
94 OUString sNumPreBreak;
95 OUString sNumPostBreak;
96 OUString sHyphAuto;
97 OUString sHyphSpecial;
99 int nUPN_HYPH_MIN_WORD_LENGTH;
100 int nUPN_HYPH_MIN_LEADING;
101 int nUPN_HYPH_MIN_TRAILING;
103 ImplSVEvent* m_nDlbClickEventId;
105 css::uno::Reference<
106 css::linguistic2::XLinguProperties > xProp;
108 css::uno::Reference<
109 css::linguistic2::XDictionaryList > xDicList;
110 css::uno::Sequence<
111 css::uno::Reference<
112 css::linguistic2::XDictionary > > aDics;
114 std::unique_ptr<SvxLinguData_Impl> pLinguData;
116 std::unique_ptr<weld::Label> m_xLinguModulesFT;
117 std::unique_ptr<weld::TreeView> m_xLinguModulesCLB;
118 std::unique_ptr<weld::Button> m_xLinguModulesEditPB;
119 std::unique_ptr<weld::Label> m_xLinguDicsFT;
120 std::unique_ptr<weld::TreeView> m_xLinguDicsCLB;
121 std::unique_ptr<weld::Button> m_xLinguDicsNewPB;
122 std::unique_ptr<weld::Button> m_xLinguDicsEditPB;
123 std::unique_ptr<weld::Button> m_xLinguDicsDelPB;
124 std::unique_ptr<weld::TreeView> m_xLinguOptionsCLB;
125 std::unique_ptr<weld::Button> m_xLinguOptionsEditPB;
126 std::unique_ptr<weld::Box> m_xMoreDictsBox;
127 std::unique_ptr<weld::LinkButton> m_xMoreDictsLink;
129 void AddDicBoxEntry( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
130 static sal_uInt32 GetDicUserData( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
132 DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
133 DECL_LINK( ClickHdl_Impl, weld::Button&, void );
134 DECL_LINK( BoxDoubleClickHdl_Impl, weld::TreeView&, bool );
135 DECL_LINK( ModulesBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void );
136 DECL_LINK( DicsBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void );
137 DECL_LINK( PostDblClickHdl_Impl, void *, void);
138 DECL_STATIC_LINK( SvxLinguTabPage, OnLinkClick, weld::LinkButton&, bool);
140 void UpdateModulesBox_Impl();
141 void UpdateDicBox_Impl();
143 public:
144 SvxLinguTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet);
145 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
146 virtual ~SvxLinguTabPage() override;
148 virtual OUString GetAllStrings() override;
150 virtual bool FillItemSet( SfxItemSet* rSet ) override;
151 virtual void Reset( const SfxItemSet* rSet ) override;
153 void HideGroups( sal_uInt16 nGrp );
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */