merge the formfield patch from ooo-build
[ooovba.git] / svx / source / dialog / hyphen.hxx
blobe872bfae2871098d4bed03fd2e62bf2b1a5530b8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hyphen.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_HYPHEN_HXX
31 #define _SVX_HYPHEN_HXX
33 // include ---------------------------------------------------------------
35 #include <vcl/edit.hxx>
36 #ifndef _SV_BUTTON_HXX
37 #include <vcl/button.hxx>
38 #endif
39 #include <vcl/fixed.hxx>
40 #include <sfx2/basedlgs.hxx>
41 #include <com/sun/star/uno/Reference.hxx>
42 // forward ---------------------------------------------------------------
44 namespace com{namespace sun{namespace star{
45 namespace linguistic2{
46 class XHyphenator;
47 class XPossibleHyphens;
48 }}}}
50 class SvxSpellWrapper;
52 // class SvxHyphenEdit ---------------------------------------------------
54 class SvxHyphenEdit : public Edit
56 public:
57 SvxHyphenEdit( Window* pParent, const ResId& rResId );
59 protected:
60 virtual void KeyInput( const KeyEvent &rKEvt );
63 // class SvxHyphenWordDialog ---------------------------------------------
65 class SvxHyphenWordDialog : public SfxModalDialog
67 public:
68 SvxHyphenWordDialog( const String &rWord, LanguageType nLang,
69 Window* pParent,
70 ::com::sun::star::uno::Reference<
71 ::com::sun::star::linguistic2::XHyphenator > &xHyphen,
72 SvxSpellWrapper* pWrapper );
74 void SelLeft();
75 void SelRight();
77 private:
78 FixedText aWordFT;
79 SvxHyphenEdit aWordEdit;
80 ImageButton aLeftBtn;
81 ImageButton aRightBtn;
82 OKButton aOkBtn;
83 CancelButton aCancelBtn;
84 PushButton aContBtn;
85 PushButton aDelBtn;
86 HelpButton aHelpBtn;
87 String aLabel;
88 SvxSpellWrapper* pHyphWrapper;
89 ::com::sun::star::uno::Reference<
90 ::com::sun::star::linguistic2::XHyphenator > xHyphenator;
91 ::com::sun::star::uno::Reference<
92 ::com::sun::star::linguistic2::XPossibleHyphens > xPossHyph;
93 String aActWord; // actual (to be displayed) word
94 LanguageType nActLanguage; // and language
95 sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos
96 sal_uInt16 nHyphPos;
97 sal_uInt16 nOldPos;
98 sal_Bool bBusy;
100 #ifdef _SVX_HYPHEN_CXX
101 void EnableLRBtn_Impl();
102 //void EnableCutBtn_Impl();
103 void SetLabel_Impl( LanguageType nLang );
104 String EraseUnusableHyphens_Impl(
105 ::com::sun::star::uno::Reference<
106 ::com::sun::star::linguistic2::XPossibleHyphens > &rxPossHyph,
107 sal_uInt16 nMaxHyphenationPos );
109 void InitControls_Impl();
110 void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 );
111 sal_uInt16 GetHyphIndex_Impl();
113 DECL_LINK( CutHdl_Impl, Button* );
114 DECL_LINK( DeleteHdl_Impl, Button* );
115 DECL_LINK( ContinueHdl_Impl, Button* );
116 DECL_LINK( CancelHdl_Impl, Button* );
117 DECL_LINK( Left_Impl, Button* );
118 DECL_LINK( Right_Impl, Button* );
119 DECL_LINK( GetFocusHdl_Impl, Edit* );
120 DECL_LINK( LangError_Impl, void* );
121 #endif
125 #endif