bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / hyphen.hxx
blob3bf97672b99bf6cfe7d86500496706499132e6e5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include <memory>
24 #include <vcl/edit.hxx>
25 #include <vcl/button.hxx>
26 #include <vcl/fixed.hxx>
27 #include <sfx2/basedlgs.hxx>
28 #include <com/sun/star/uno/Reference.hxx>
29 #include <com/sun/star/linguistic2/XHyphenator.hpp>
30 #include <com/sun/star/linguistic2/XPossibleHyphens.hpp>
32 class SvxSpellWrapper;
34 class HyphenEdit : public Edit
36 public:
37 HyphenEdit(vcl::Window* pParent);
39 protected:
40 virtual void KeyInput(const KeyEvent &rKEvt) SAL_OVERRIDE;
43 class SvxHyphenWordDialog : public SfxModalDialog
45 VclPtr<HyphenEdit> m_pWordEdit;
46 VclPtr<PushButton> m_pLeftBtn;
47 VclPtr<PushButton> m_pRightBtn;
48 VclPtr<PushButton> m_pOkBtn;
49 VclPtr<PushButton> m_pContBtn;
50 VclPtr<PushButton> m_pDelBtn;
51 VclPtr<PushButton> m_pHyphAll;
52 VclPtr<CloseButton> m_pCloseBtn;
53 OUString aLabel;
54 SvxSpellWrapper* pHyphWrapper;
55 css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator;
56 css::uno::Reference< css::linguistic2::XPossibleHyphens > xPossHyph;
57 OUString aEditWord; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position
58 OUString aActWord; // actual word to be hyphenated
59 LanguageType nActLanguage; // and its language
60 sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
61 sal_uInt16 nHyphPos;
62 sal_uInt16 nOldPos;
63 sal_Int32 nHyphenationPositionsOffset;
64 bool bBusy;
67 void EnableLRBtn_Impl();
68 OUString EraseUnusableHyphens_Impl( css::uno::Reference< css::linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos );
70 void InitControls_Impl();
71 void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
72 sal_uInt16 GetHyphIndex_Impl();
74 DECL_LINK(Left_Impl, void *);
75 DECL_LINK(Right_Impl, void *);
76 DECL_LINK(CutHdl_Impl, void *);
77 DECL_LINK(ContinueHdl_Impl, void *);
78 DECL_LINK(DeleteHdl_Impl, void *);
79 DECL_LINK( HyphenateAllHdl_Impl, Button* );
80 DECL_LINK(CancelHdl_Impl, void *);
81 DECL_LINK(GetFocusHdl_Impl, void *);
83 public:
84 SvxHyphenWordDialog( const OUString &rWord, LanguageType nLang,
85 vcl::Window* pParent,
86 css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen,
87 SvxSpellWrapper* pWrapper );
88 virtual ~SvxHyphenWordDialog();
89 virtual void dispose() SAL_OVERRIDE;
91 void SetWindowTitle( LanguageType nLang );
92 void SelLeft();
93 void SelRight();
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */