LibreOffice Module cui (master)  1
optdict.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_OPTDICT_HXX
20 #define INCLUDED_CUI_SOURCE_INC_OPTDICT_HXX
21 
22 #include <vcl/weld.hxx>
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include <svx/langbox.hxx>
26 
27 namespace com{namespace sun{namespace star{
28 namespace linguistic2{
29  class XDictionary;
30  class XSpellChecker1;
31 }}}}
32 
33 // forward ---------------------------------------------------------------
34 
35 
36 // class SvxNewDictionaryDialog ------------------------------------------
37 
39 {
40 private:
41  std::unique_ptr<weld::Entry> m_xNameEdit;
42  std::unique_ptr<LanguageBox> m_xLanguageLB;
43  std::unique_ptr<weld::CheckButton> m_xExceptBtn;
44  std::unique_ptr<weld::Button> m_xOKBtn;
45  css::uno::Reference<css::linguistic2::XDictionary> m_xNewDic;
46 
47  DECL_LINK(OKHdl_Impl, weld::Button&, void);
48  DECL_LINK(ModifyHdl_Impl, weld::Entry&, void);
49 
50 public:
52 
53  const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() { return m_xNewDic; }
54 };
55 
56 // class SvxEditDictionaryDialog -----------------------------------------
57 
59 {
60 private:
61  OUString sModify;
62  OUString sNew;
63  OUString sReplaceFT_Text;
64 
65  css::uno::Sequence<
66  css::uno::Reference<
67  css::linguistic2::XDictionary > > aDics;
68 
70  bool bDoNothing;
72 
74  std::unique_ptr<weld::ComboBox> m_xAllDictsLB;
75  std::unique_ptr<weld::Label> m_xLangFT;
76  std::unique_ptr<LanguageBox> m_xLangLB;
77  std::unique_ptr<weld::Entry> m_xWordED;
78  std::unique_ptr<weld::Label> m_xReplaceFT;
79  std::unique_ptr<weld::Entry> m_xReplaceED;
80  std::unique_ptr<weld::TreeView> m_xSingleColumnLB;
81  std::unique_ptr<weld::TreeView> m_xDoubleColumnLB;
82  std::unique_ptr<weld::Button> m_xNewReplacePB;
83  std::unique_ptr<weld::Button> m_xDeletePB;
84 
85  DECL_LINK(SelectBookHdl_Impl, weld::ComboBox&, void);
86  DECL_LINK(SelectLangHdl_Impl, weld::ComboBox&, void);
87  DECL_LINK(SelectHdl, weld::TreeView&, void);
88  DECL_LINK(NewDelButtonHdl, weld::Button&, void);
89  DECL_LINK(NewDelActionHdl, weld::Entry&, bool);
90  DECL_LINK(ModifyHdl, weld::Entry&, void);
91  DECL_LINK(EntrySizeAllocHdl, const Size&, void);
92  DECL_STATIC_LINK(SvxEditDictionaryDialog, InsertTextHdl, OUString&, bool);
93  bool NewDelHdl(const weld::Widget*);
94 
95  void ShowWords_Impl( sal_uInt16 nId );
96  void SetLanguage_Impl( LanguageType nLanguage );
97  bool IsDicReadonly_Impl() const { return bDicIsReadonly; }
98  void SetDicReadonly_Impl( css::uno::Reference<
99  css::linguistic2::XDictionary > const &xDic );
100 
101  void RemoveDictEntry(int nEntry);
102  int GetLBInsertPos(const OUString &rDicWord);
103 
104 public:
105  SvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName);
106  virtual ~SvxEditDictionaryDialog() override;
107 };
108 
109 #endif
110 
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetLanguage_Impl(LanguageType nLanguage)
Definition: optdict.cxx:354
std::unique_ptr< weld::Entry > m_xWordED
Definition: optdict.hxx:77
virtual ~SvxEditDictionaryDialog() override
Definition: optdict.cxx:333
std::unique_ptr< LanguageBox > m_xLangLB
Definition: optdict.hxx:76
int GetLBInsertPos(const OUString &rDicWord)
Definition: optdict.cxx:360
css::uno::Sequence< css::uno::Reference< css::linguistic2::XDictionary > > aDics
Definition: optdict.hxx:67
std::unique_ptr< weld::Button > m_xDeletePB
Definition: optdict.hxx:83
std::unique_ptr< weld::Button > m_xOKBtn
Definition: optdict.hxx:44
std::unique_ptr< weld::Button > m_xNewReplacePB
Definition: optdict.hxx:82
bool bFirstSelect
snapshot copy to work on
Definition: optdict.hxx:69
std::unique_ptr< weld::Entry > m_xReplaceED
Definition: optdict.hxx:79
OUString sReplaceFT_Text
Definition: optdict.hxx:63
bool NewDelHdl(const weld::Widget *)
Definition: optdict.cxx:586
std::unique_ptr< weld::TreeView > m_xDoubleColumnLB
Definition: optdict.hxx:81
SvxEditDictionaryDialog(weld::Window *pParent, const OUString &rName)
Definition: optdict.cxx:203
std::unique_ptr< weld::TreeView > m_xSingleColumnLB
Definition: optdict.hxx:80
css::uno::Reference< css::linguistic2::XDictionary > m_xNewDic
Definition: optdict.hxx:45
const css::uno::Reference< css::linguistic2::XDictionary > & GetNewDictionary()
Definition: optdict.hxx:53
std::unique_ptr< weld::Label > m_xReplaceFT
Definition: optdict.hxx:78
std::unique_ptr< weld::Label > m_xLangFT
Definition: optdict.hxx:75
std::unique_ptr< LanguageBox > m_xLanguageLB
Definition: optdict.hxx:42
bool IsDicReadonly_Impl() const
Definition: optdict.hxx:97
std::unique_ptr< weld::CheckButton > m_xExceptBtn
Definition: optdict.hxx:43
std::unique_ptr< weld::ComboBox > m_xAllDictsLB
Definition: optdict.hxx:74
weld::TreeView * m_pWordsLB
Definition: optdict.hxx:73
void SetDicReadonly_Impl(css::uno::Reference< css::linguistic2::XDictionary > const &xDic)
Definition: optdict.cxx:337
void ShowWords_Impl(sal_uInt16 nId)
Definition: optdict.cxx:449
void RemoveDictEntry(int nEntry)
Definition: optdict.cxx:378
DECL_LINK(OKHdl_Impl, weld::Button &, void)
SvxNewDictionaryDialog(weld::Window *pParent)
Definition: optdict.cxx:96
DECL_LINK(SelectBookHdl_Impl, weld::ComboBox &, void)
DECL_STATIC_LINK(SvxEditDictionaryDialog, InsertTextHdl, OUString &, bool)
std::unique_ptr< weld::Entry > m_xNameEdit
Definition: optdict.hxx:41