LibreOffice Module cui (master)  1
hyphen.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 #ifndef INCLUDED_CUI_SOURCE_INC_HYPHEN_HXX
20 #define INCLUDED_CUI_SOURCE_INC_HYPHEN_HXX
21 
22 #include <memory>
23 
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>
29 
30 class SvxSpellWrapper;
31 
33 {
34  OUString m_aLabel;
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
42  sal_Int32 m_nOldPos;
45  bool m_bBusy;
46 
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;
55 
56  void EnableLRBtn_Impl();
57  OUString EraseUnusableHyphens_Impl();
58 
59  void InitControls_Impl();
60  void ContinueHyph_Impl( sal_Int32 nInsPos = -1 ); // continue by default
61 
62  void select_region(int nStart, int nEnd);
63 
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);
73 
74 public:
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;
80 
81  void SetWindowTitle( LanguageType nLang );
82  bool SelLeft();
83  bool SelRight();
84 };
85 
86 #endif
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_aActWord
Definition: hyphen.hxx:39
LanguageType m_nActLanguage
Definition: hyphen.hxx:40
std::unique_ptr< weld::Button > m_xCloseBtn
Definition: hyphen.hxx:54
void InitControls_Impl()
Definition: hyphen.cxx:180
sal_Int32 m_nHyphenationPositionsOffset
Definition: hyphen.hxx:43
std::unique_ptr< weld::Button > m_xLeftBtn
Definition: hyphen.hxx:48
void select_region(int nStart, int nEnd)
Definition: hyphen.cxx:386
void ContinueHyph_Impl(sal_Int32 nInsPos=-1)
Definition: hyphen.cxx:198
void SetWindowTitle(LanguageType nLang)
Definition: hyphen.cxx:466
sal_Int32 m_nOldPos
Definition: hyphen.hxx:42
std::unique_ptr< weld::Button > m_xHyphAll
Definition: hyphen.hxx:53
std::unique_ptr< weld::Button > m_xContBtn
Definition: hyphen.hxx:51
sal_Int16 m_nMaxHyphenationPos
Definition: hyphen.hxx:41
OUString m_aLabel
Definition: hyphen.hxx:34
SvxSpellWrapper *const m_pHyphWrapper
Definition: hyphen.hxx:35
std::unique_ptr< weld::Entry > m_xWordEdit
Definition: hyphen.hxx:47
void EnableLRBtn_Impl()
Definition: hyphen.cxx:52
std::unique_ptr< weld::Button > m_xDelBtn
Definition: hyphen.hxx:52
virtual ~SvxHyphenWordDialog() override
Definition: hyphen.cxx:460
OUString EraseUnusableHyphens_Impl()
Definition: hyphen.cxx:80
css::uno::Reference< css::linguistic2::XHyphenator > m_xHyphenator
Definition: hyphen.hxx:36
css::uno::Reference< css::linguistic2::XPossibleHyphens > m_xPossHyph
Definition: hyphen.hxx:37
std::unique_ptr< weld::Button > m_xRightBtn
Definition: hyphen.hxx:49
SvxHyphenWordDialog(const OUString &rWord, LanguageType nLang, weld::Window *pParent, css::uno::Reference< css::linguistic2::XHyphenator > const &xHyphen, SvxSpellWrapper *pWrapper)
Definition: hyphen.cxx:404
std::unique_ptr< weld::Button > m_xOkBtn
Definition: hyphen.hxx:50
OUString m_aEditWord
Definition: hyphen.hxx:38
DECL_LINK(Left_Impl, weld::Button &, void)