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