LibreOffice Module cui (master)  1
optlingu.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_CUI_SOURCE_INC_OPTLINGU_HXX
20 #define INCLUDED_CUI_SOURCE_INC_OPTLINGU_HXX
21 
22 #include <sfx2/tabdlg.hxx>
23 #include <svx/langbox.hxx>
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <com/sun/star/uno/Sequence.hxx>
26 
27 namespace com{namespace sun{namespace star{
28 namespace beans{
29  class XPropertySet;
30 }
31 namespace linguistic2{
32  class XDictionary;
33  class XDictionaryList;
34  class XLinguProperties;
35 }}}}
36 
37 class SvTreeListEntry;
38 class SvxLinguData_Impl;
39 
40 // define ----------------------------------------------------------------
41 
42 #define GROUP_MODULES (sal_uInt16(0x0008))
43 
44 // forward ---------------------------------------------------------------
45 
47 {
48  OUString sSpell;
49  OUString sHyph;
50  OUString sThes;
51  OUString sGrammar;
52 
53  std::unique_ptr<SvxLinguData_Impl> pDefaultLinguData;
55 
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;
63 
64  DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
65  DECL_LINK( UpDownHdl_Impl, weld::Button&, void );
66  DECL_LINK( ClickHdl_Impl, weld::Button&, void );
67  DECL_LINK( BackHdl_Impl, weld::Button&, void );
68  DECL_LINK( LangSelectListBoxHdl_Impl, weld::ComboBox&, void );
69  typedef std::pair<int, int> row_col;
70  DECL_LINK( BoxCheckButtonHdl_Impl, const row_col&, void );
71  void LangSelectHdl_Impl(const SvxLanguageBox* pBox);
72 
73 public:
75  virtual ~SvxEditModulesDlg() override;
76 };
77 
78 // class SvxLinguTabPage -------------------------------------------------
79 
81 {
82 private:
83  OUString sCapitalWords;
84  OUString sWordsWithDigits;
85  OUString sSpellSpecial;
86  OUString sSpellAuto;
87  OUString sGrammarAuto;
88  OUString sNumMinWordlen;
89  OUString sNumPreBreak;
90  OUString sNumPostBreak;
91  OUString sHyphAuto;
92  OUString sHyphSpecial;
93 
97 
98  css::uno::Reference<
99  css::linguistic2::XLinguProperties > xProp;
100 
101  css::uno::Reference<
102  css::linguistic2::XDictionaryList > xDicList;
103  css::uno::Sequence<
104  css::uno::Reference<
105  css::linguistic2::XDictionary > > aDics;
106 
107  std::unique_ptr<SvxLinguData_Impl> pLinguData;
108 
109  std::unique_ptr<weld::Label> m_xLinguModulesFT;
110  std::unique_ptr<weld::TreeView> m_xLinguModulesCLB;
111  std::unique_ptr<weld::Button> m_xLinguModulesEditPB;
112  std::unique_ptr<weld::Label> m_xLinguDicsFT;
113  std::unique_ptr<weld::TreeView> m_xLinguDicsCLB;
114  std::unique_ptr<weld::Button> m_xLinguDicsNewPB;
115  std::unique_ptr<weld::Button> m_xLinguDicsEditPB;
116  std::unique_ptr<weld::Button> m_xLinguDicsDelPB;
117  std::unique_ptr<weld::TreeView> m_xLinguOptionsCLB;
118  std::unique_ptr<weld::Button> m_xLinguOptionsEditPB;
119  std::unique_ptr<weld::LinkButton> m_xMoreDictsLink;
120 
121  void AddDicBoxEntry( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
122  static sal_uInt32 GetDicUserData( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
123 
124  DECL_LINK( SelectHdl_Impl, weld::TreeView&, void );
125  DECL_LINK( ClickHdl_Impl, weld::Button&, void );
126  DECL_LINK( BoxDoubleClickHdl_Impl, weld::TreeView&, bool );
127  typedef std::pair<int, int> row_col;
128  DECL_LINK( ModulesBoxCheckButtonHdl_Impl, const row_col&, void );
129  DECL_LINK( DicsBoxCheckButtonHdl_Impl, const row_col&, void );
130  DECL_LINK( PostDblClickHdl_Impl, void *, void);
131 
132  void UpdateModulesBox_Impl();
133  void UpdateDicBox_Impl();
134 
135 public:
136  SvxLinguTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet);
137  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
138  virtual ~SvxLinguTabPage() override;
139 
140  virtual bool FillItemSet( SfxItemSet* rSet ) override;
141  virtual void Reset( const SfxItemSet* rSet ) override;
142 
143  void HideGroups( sal_uInt16 nGrp );
144 };
145 
146 #endif
147 
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxEditModulesDlg(weld::Window *pParent, SvxLinguData_Impl &rData)
Definition: optlingu.cxx:1542
std::unique_ptr< weld::Button > m_xLinguDicsDelPB
Definition: optlingu.hxx:116
OUString sHyphSpecial
Definition: optlingu.hxx:92
void UpdateDicBox_Impl()
Definition: optlingu.cxx:1104
SvxLinguData_Impl & rLinguData
Definition: optlingu.hxx:54
OUString sNumMinWordlen
Definition: optlingu.hxx:88
std::unique_ptr< SvxLanguageBox > m_xLanguageLB
Definition: optlingu.hxx:62
std::unique_ptr< weld::LinkButton > m_xMoreDictsLink
Definition: optlingu.hxx:119
std::unique_ptr< weld::Label > m_xLinguModulesFT
Definition: optlingu.hxx:109
std::pair< int, int > row_col
Definition: optlingu.hxx:69
std::unique_ptr< weld::Label > m_xLinguDicsFT
Definition: optlingu.hxx:112
std::unique_ptr< SvxLinguData_Impl > pLinguData
Definition: optlingu.hxx:107
void HideGroups(sal_uInt16 nGrp)
Definition: optlingu.cxx:1526
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: optlingu.cxx:914
std::unique_ptr< weld::Button > m_xPrioUpPB
Definition: optlingu.hxx:57
std::unique_ptr< SvxLinguData_Impl > pDefaultLinguData
Definition: optlingu.hxx:53
void LangSelectHdl_Impl(const SvxLanguageBox *pBox)
Definition: optlingu.cxx:1654
virtual ~SvxLinguTabPage() override
Definition: optlingu.cxx:909
void UpdateModulesBox_Impl()
Definition: optlingu.cxx:1126
std::unique_ptr< weld::TreeView > m_xModulesCLB
Definition: optlingu.hxx:56
OUString sHyphAuto
Definition: optlingu.hxx:91
std::unique_ptr< weld::Button > m_xLinguDicsNewPB
Definition: optlingu.hxx:114
std::unique_ptr< weld::Button > m_xClosePB
Definition: optlingu.hxx:61
std::unique_ptr< weld::TreeView > m_xLinguModulesCLB
Definition: optlingu.hxx:110
std::unique_ptr< weld::LinkButton > m_xMoreDictsLink
Definition: optlingu.hxx:60
std::unique_ptr< weld::Button > m_xLinguOptionsEditPB
Definition: optlingu.hxx:118
OUString sThes
Definition: optlingu.hxx:50
std::unique_ptr< weld::Button > m_xPrioDownPB
Definition: optlingu.hxx:58
int nUPN_HYPH_MIN_LEADING
Definition: optlingu.hxx:95
OUString sGrammarAuto
Definition: optlingu.hxx:87
DECL_LINK(SelectHdl_Impl, weld::TreeView &, void)
SvxLinguTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreSet)
Definition: optlingu.cxx:829
OUString sSpellAuto
Definition: optlingu.hxx:86
OUString sSpellSpecial
Definition: optlingu.hxx:85
class SAL_NO_VTABLE XPropertySet
std::unique_ptr< weld::TreeView > m_xLinguOptionsCLB
Definition: optlingu.hxx:117
std::unique_ptr< weld::TreeView > m_xLinguDicsCLB
Definition: optlingu.hxx:113
css::uno::Reference< css::linguistic2::XDictionaryList > xDicList
Definition: optlingu.hxx:102
std::unique_ptr< weld::Button > m_xBackPB
Definition: optlingu.hxx:59
OUString sSpell
Definition: optlingu.hxx:48
int nUPN_HYPH_MIN_TRAILING
Definition: optlingu.hxx:96
OUString sGrammar
Definition: optlingu.hxx:51
OUString sWordsWithDigits
Definition: optlingu.hxx:84
OUString sCapitalWords
Definition: optlingu.hxx:83
static sal_uInt32 GetDicUserData(const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx)
Definition: optlingu.cxx:1066
OUString sHyph
Definition: optlingu.hxx:49
std::unique_ptr< weld::Button > m_xLinguModulesEditPB
Definition: optlingu.hxx:111
int nUPN_HYPH_MIN_WORD_LENGTH
Definition: optlingu.hxx:94
css::uno::Sequence< css::uno::Reference< css::linguistic2::XDictionary > > aDics
Definition: optlingu.hxx:105
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optlingu.cxx:920
OUString sNumPostBreak
Definition: optlingu.hxx:90
virtual void Reset(const SfxItemSet *rSet) override
Definition: optlingu.cxx:1152
virtual ~SvxEditModulesDlg() override
Definition: optlingu.cxx:1600
std::pair< int, int > row_col
Definition: optlingu.hxx:127
std::unique_ptr< weld::Button > m_xLinguDicsEditPB
Definition: optlingu.hxx:115
void AddDicBoxEntry(const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx)
Definition: optlingu.cxx:1085
DECL_LINK(SelectHdl_Impl, weld::TreeView &, void)
css::uno::Reference< css::linguistic2::XLinguProperties > xProp
Definition: optlingu.hxx:99
OUString sNumPreBreak
Definition: optlingu.hxx:89