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