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 .
23 #include <vcl/weld.hxx>
24 #include <sfx2/basedlgs.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/linguistic2/XHyphenator.hpp>
27 #include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
29 class SvxSpellWrapper
;
31 class SvxHyphenWordDialog
: public SfxDialogController
34 SvxSpellWrapper
*const m_pHyphWrapper
;
35 css::uno::Reference
< css::linguistic2::XHyphenator
> m_xHyphenator
;
36 css::uno::Reference
< css::linguistic2::XPossibleHyphens
> m_xPossHyph
;
37 OUString m_aEditWord
; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position
38 OUString m_aActWord
; // actual word to be hyphenated
39 LanguageType m_nActLanguage
; // and its language
40 sal_Int16 m_nMaxHyphenationPos
; // right most valid hyphenation pos
42 sal_Int32 m_nHyphenationPositionsOffset
;
46 std::unique_ptr
<weld::Entry
> m_xWordEdit
;
47 std::unique_ptr
<weld::Button
> m_xLeftBtn
;
48 std::unique_ptr
<weld::Button
> m_xRightBtn
;
49 std::unique_ptr
<weld::Button
> m_xOkBtn
;
50 std::unique_ptr
<weld::Button
> m_xContBtn
;
51 std::unique_ptr
<weld::Button
> m_xDelBtn
;
52 std::unique_ptr
<weld::Button
> m_xHyphAll
;
53 std::unique_ptr
<weld::Button
> m_xCloseBtn
;
55 void EnableLRBtn_Impl();
56 OUString
EraseUnusableHyphens_Impl();
58 void InitControls_Impl();
59 void ContinueHyph_Impl( sal_Int32 nInsPos
= -1 ); // continue by default
61 void select_region(int nStart
, int nEnd
);
63 DECL_LINK(Left_Impl
, weld::Button
&, void);
64 DECL_LINK(Right_Impl
, weld::Button
&, void);
65 DECL_LINK(CutHdl_Impl
, weld::Button
&, void);
66 DECL_LINK(ContinueHdl_Impl
, weld::Button
&, void);
67 DECL_LINK(DeleteHdl_Impl
, weld::Button
&, void);
68 DECL_LINK(HyphenateAllHdl_Impl
, weld::Button
&, void);
69 DECL_LINK(CancelHdl_Impl
, weld::Button
&, void);
70 DECL_LINK(GetFocusHdl_Impl
, weld::Widget
&, void);
71 DECL_LINK(CursorChangeHdl_Impl
, weld::Entry
&, void);
74 SvxHyphenWordDialog(OUString aWord
, LanguageType nLang
,
75 weld::Widget
* pParent
,
76 css::uno::Reference
<css::linguistic2::XHyphenator
> const &xHyphen
,
77 SvxSpellWrapper
* pWrapper
);
78 virtual ~SvxHyphenWordDialog() override
;
80 void SetWindowTitle( LanguageType nLang
);
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */