Line data Source code
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 _SVX_HYPHEN_HXX
20 : #define _SVX_HYPHEN_HXX
21 :
22 : #include <memory>
23 :
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>
31 :
32 : using namespace ::com::sun::star;
33 :
34 : class SvxSpellWrapper;
35 :
36 0 : class HyphenEdit : public Edit
37 : {
38 : public:
39 : HyphenEdit(Window* pParent);
40 :
41 : protected:
42 : virtual void KeyInput(const KeyEvent &rKEvt);
43 : };
44 :
45 : class SvxHyphenWordDialog : public SfxModalDialog
46 : {
47 : HyphenEdit* m_pWordEdit;
48 : PushButton* m_pLeftBtn;
49 : PushButton* m_pRightBtn;
50 : PushButton* m_pOkBtn;
51 : PushButton* m_pContBtn;
52 : PushButton* m_pDelBtn;
53 : PushButton* m_pHyphAll;
54 : PushButton* m_pCloseBtn;
55 : String aLabel;
56 : SvxSpellWrapper* pHyphWrapper;
57 : uno::Reference< linguistic2::XHyphenator > xHyphenator;
58 : uno::Reference< linguistic2::XPossibleHyphens > xPossHyph;
59 : String aEditWord; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position
60 : String aActWord; // actual word to be hyphenated
61 : LanguageType nActLanguage; // and its language
62 : sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
63 : sal_uInt16 nHyphPos;
64 : sal_uInt16 nOldPos;
65 : sal_Int32 nHyphenationPositionsOffset;
66 : sal_Bool bBusy;
67 :
68 :
69 : void EnableLRBtn_Impl();
70 : String EraseUnusableHyphens_Impl( uno::Reference< linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos );
71 :
72 : void InitControls_Impl();
73 : void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
74 : sal_uInt16 GetHyphIndex_Impl();
75 :
76 : DECL_LINK(Left_Impl, void *);
77 : DECL_LINK(Right_Impl, void *);
78 : DECL_LINK(CutHdl_Impl, void *);
79 : DECL_LINK(ContinueHdl_Impl, void *);
80 : DECL_LINK(DeleteHdl_Impl, void *);
81 : DECL_LINK( HyphenateAllHdl_Impl, Button* );
82 : DECL_LINK(CancelHdl_Impl, void *);
83 : DECL_LINK(GetFocusHdl_Impl, void *);
84 :
85 : public:
86 : SvxHyphenWordDialog( const String &rWord, LanguageType nLang,
87 : Window* pParent,
88 : uno::Reference< linguistic2::XHyphenator > &xHyphen,
89 : SvxSpellWrapper* pWrapper );
90 : virtual ~SvxHyphenWordDialog();
91 :
92 : void SetWindowTitle( LanguageType nLang );
93 : void SelLeft();
94 : void SelRight();
95 : };
96 :
97 :
98 : #endif
99 :
100 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|