Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / cui / source / inc / optdict.hxx
blob8e382cc32e8ff0ef1fb4a451b4190f949029b8ad
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 <vcl/weld.hxx>
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
24 #include <svx/langbox.hxx>
26 namespace com::sun::star{
27 namespace linguistic2{
28 class XDictionary;
29 class XSpellChecker1;
33 // forward ---------------------------------------------------------------
36 // class SvxNewDictionaryDialog ------------------------------------------
38 class SvxNewDictionaryDialog : public weld::GenericDialogController
40 private:
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;
47 DECL_LINK(OKHdl_Impl, weld::Button&, void);
48 DECL_LINK(ModifyHdl_Impl, weld::Entry&, void);
50 public:
51 SvxNewDictionaryDialog(weld::Window* pParent);
53 const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() const { return m_xNewDic; }
56 // class SvxEditDictionaryDialog -----------------------------------------
58 class SvxEditDictionaryDialog : public weld::GenericDialogController
60 private:
61 OUString sModify;
62 OUString sNew;
63 OUString sReplaceFT_Text;
65 css::uno::Sequence<
66 css::uno::Reference<
67 css::linguistic2::XDictionary > > aDics; //! snapshot copy to work on
69 bool bFirstSelect;
70 bool bDoNothing;
71 bool bDicIsReadonly;
73 weld::TreeView* m_pWordsLB;
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;
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*);
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 );
100 void RemoveDictEntry(int nEntry);
101 int GetLBInsertPos(std::u16string_view rDicWord);
103 public:
104 SvxEditDictionaryDialog(weld::Window* pParent, std::u16string_view rName);
105 virtual ~SvxEditDictionaryDialog() override;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */