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