1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <com/sun/star/linguistic2/XThesaurus.hpp>
23 #include <vcl/idle.hxx>
24 #include <sfx2/basedlgs.hxx>
31 class SvxThesaurusDialog
: public SfxDialogController
35 css::uno::Reference
< css::linguistic2::XThesaurus
> xThesaurus
;
37 LanguageType nLookUpLanguage
;
38 std::stack
< OUString
> aLookUpHistory
;
41 std::unique_ptr
<weld::Button
> m_xLeftBtn
;
42 std::unique_ptr
<weld::ComboBox
> m_xWordCB
;
43 std::unique_ptr
<weld::TreeView
> m_xAlternativesCT
;
44 std::unique_ptr
<weld::Label
> m_xNotFound
;
45 std::unique_ptr
<weld::Entry
> m_xReplaceEdit
;
46 std::unique_ptr
<weld::ComboBox
> m_xLangLB
;
47 std::unique_ptr
<weld::Button
> m_xReplaceBtn
;
48 ImplSVEvent
* m_nSelectFirstEvent
;
51 virtual ~SvxThesaurusDialog() override
;
54 DECL_LINK( ReplaceBtnHdl_Impl
, weld::Button
&, void );
55 DECL_LINK( LeftBtnHdl_Impl
, weld::Button
&, void );
56 DECL_LINK( LanguageHdl_Impl
, weld::ComboBox
&, void );
57 DECL_LINK( WordSelectHdl_Impl
, weld::ComboBox
&, void );
58 DECL_LINK( AlternativesSelectHdl_Impl
, weld::TreeView
&, void );
59 DECL_LINK( AlternativesDoubleClickHdl_Impl
, weld::TreeView
&, bool );
60 DECL_LINK( SelectFirstHdl_Impl
, void*, void );
61 DECL_LINK( ReplaceEditHdl_Impl
, weld::Entry
&, void );
62 DECL_LINK( ModifyTimer_Hdl
, Timer
*, void );
63 DECL_LINK( KeyInputHdl
, const KeyEvent
&, bool );
65 /// @throws css::lang::IllegalArgumentException
66 /// @throws css::uno::RuntimeException
67 css::uno::Sequence
< css::uno::Reference
< css::linguistic2::XMeaning
> >
68 queryMeanings_Impl( OUString
& rTerm
, const css::lang::Locale
& rLocale
, const css::beans::PropertyValues
& rProperties
);
70 bool UpdateAlternativesBox_Impl();
71 void LookUp( const OUString
&rText
);
75 SvxThesaurusDialog(weld::Widget
* pParent
,
76 css::uno::Reference
< css::linguistic2::XThesaurus
> const & xThesaurus
,
77 const OUString
&rWord
, LanguageType nLanguage
);
78 void SetWindowTitle( LanguageType nLanguage
);
79 OUString
GetWord() const;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */