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#pragma once
20
21#include <vcl/weld.hxx>
22#include <com/sun/star/uno/Reference.hxx>
23#include <com/sun/star/uno/Sequence.hxx>
24#include <svx/langbox.hxx>
25
26namespace com::sun::star{
27 namespace linguistic2{
28 class XDictionary;
29 class XSpellChecker1;
30 }
31}
32
33// forward ---------------------------------------------------------------
34
35
36// class SvxNewDictionaryDialog ------------------------------------------
37
39{
40private:
41 std::unique_ptr<weld::Entry> m_xNameEdit;
42 std::unique_ptr<SvxLanguageBox> 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
50public:
52
53 const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() const { return m_xNewDic; }
54};
55
56// class SvxEditDictionaryDialog -----------------------------------------
57
59{
60private:
61 OUString sModify;
62 OUString sNew;
64
65 css::uno::Sequence<
66 css::uno::Reference<
67 css::linguistic2::XDictionary > > aDics;
68
72
74 std::unique_ptr<weld::ComboBox> m_xAllDictsLB;
75 std::unique_ptr<weld::Label> m_xLangFT;
76 std::unique_ptr<SvxLanguageBox> 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 bool NewDelHdl(const weld::Widget*);
93
94 void ShowWords_Impl( sal_uInt16 nId );
95 void SetLanguage_Impl( LanguageType nLanguage );
96 bool IsDicReadonly_Impl() const { return bDicIsReadonly; }
97 void SetDicReadonly_Impl( css::uno::Reference<
98 css::linguistic2::XDictionary > const &xDic );
99
100 void RemoveDictEntry(int nEntry);
101 int GetLBInsertPos(std::u16string_view rDicWord);
102
103public:
104 SvxEditDictionaryDialog(weld::Window* pParent, std::u16string_view rName);
105 virtual ~SvxEditDictionaryDialog() override;
106};
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(SelectLangHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::TreeView > m_xSingleColumnLB
Definition: optdict.hxx:80
void ShowWords_Impl(sal_uInt16 nId)
Definition: optdict.cxx:463
void SetLanguage_Impl(LanguageType nLanguage)
Definition: optdict.cxx:368
int GetLBInsertPos(std::u16string_view rDicWord)
Definition: optdict.cxx:374
DECL_LINK(NewDelButtonHdl, weld::Button &, void)
virtual ~SvxEditDictionaryDialog() override
Definition: optdict.cxx:347
DECL_LINK(SelectHdl, weld::TreeView &, void)
std::unique_ptr< weld::Label > m_xLangFT
Definition: optdict.hxx:75
css::uno::Sequence< css::uno::Reference< css::linguistic2::XDictionary > > aDics
Definition: optdict.hxx:67
std::unique_ptr< weld::Label > m_xReplaceFT
Definition: optdict.hxx:78
std::unique_ptr< weld::TreeView > m_xDoubleColumnLB
Definition: optdict.hxx:81
bool bFirstSelect
snapshot copy to work on
Definition: optdict.hxx:69
void RemoveDictEntry(int nEntry)
Definition: optdict.cxx:392
std::unique_ptr< weld::Button > m_xNewReplacePB
Definition: optdict.hxx:82
DECL_LINK(SelectBookHdl_Impl, weld::ComboBox &, void)
SvxEditDictionaryDialog(weld::Window *pParent, std::u16string_view rName)
Definition: optdict.cxx:219
DECL_LINK(EntrySizeAllocHdl, const Size &, void)
OUString sReplaceFT_Text
Definition: optdict.hxx:63
void SetDicReadonly_Impl(css::uno::Reference< css::linguistic2::XDictionary > const &xDic)
Definition: optdict.cxx:351
bool NewDelHdl(const weld::Widget *)
Definition: optdict.cxx:600
DECL_LINK(ModifyHdl, weld::Entry &, void)
weld::TreeView * m_pWordsLB
Definition: optdict.hxx:73
bool IsDicReadonly_Impl() const
Definition: optdict.hxx:96
DECL_LINK(NewDelActionHdl, weld::Entry &, bool)
std::unique_ptr< weld::Entry > m_xWordED
Definition: optdict.hxx:77
std::unique_ptr< SvxLanguageBox > m_xLangLB
Definition: optdict.hxx:76
std::unique_ptr< weld::ComboBox > m_xAllDictsLB
Definition: optdict.hxx:74
std::unique_ptr< weld::Entry > m_xReplaceED
Definition: optdict.hxx:79
std::unique_ptr< weld::Button > m_xDeletePB
Definition: optdict.hxx:83
std::unique_ptr< SvxLanguageBox > m_xLanguageLB
Definition: optdict.hxx:42
std::unique_ptr< weld::Entry > m_xNameEdit
Definition: optdict.hxx:41
const css::uno::Reference< css::linguistic2::XDictionary > & GetNewDictionary() const
Definition: optdict.hxx:53
DECL_LINK(ModifyHdl_Impl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xOKBtn
Definition: optdict.hxx:44
DECL_LINK(OKHdl_Impl, weld::Button &, void)
css::uno::Reference< css::linguistic2::XDictionary > m_xNewDic
Definition: optdict.hxx:45
std::unique_ptr< weld::CheckButton > m_xExceptBtn
Definition: optdict.hxx:43
SvxNewDictionaryDialog(weld::Window *pParent)
Definition: optdict.cxx:112