Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_OPTDICT_HXX
29 : : #define _SVX_OPTDICT_HXX
30 : :
31 : : #include <vcl/dialog.hxx>
32 : : #include <vcl/fixed.hxx>
33 : : #include <vcl/lstbox.hxx>
34 : : #include <vcl/button.hxx>
35 : : #include <vcl/group.hxx>
36 : : #include <vcl/combobox.hxx>
37 : : #include <vcl/timer.hxx>
38 : : #include <vcl/edit.hxx>
39 : : #include <vcl/decoview.hxx>
40 : : #include <com/sun/star/util/Language.hpp>
41 : : #include <com/sun/star/uno/Reference.hxx>
42 : : #include <com/sun/star/uno/Sequence.hxx>
43 : :
44 : :
45 : : #include <svx/simptabl.hxx>
46 : : #include <svx/langbox.hxx>
47 : :
48 : : namespace com{namespace sun{namespace star{
49 : : namespace linguistic2{
50 : : class XDictionary;
51 : : class XSpellChecker1;
52 : : }}}}
53 : :
54 : : // forward ---------------------------------------------------------------
55 : :
56 : :
57 : : // class SvxNewDictionaryDialog ------------------------------------------
58 : :
59 [ # # ][ # # ]: 0 : class SvxNewDictionaryDialog : public ModalDialog
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
60 : : {
61 : : private:
62 : : FixedLine aNewDictBox;
63 : : FixedText aNameText;
64 : : Edit aNameEdit;
65 : : FixedText aLanguageText;
66 : : SvxLanguageBox aLanguageLB;
67 : : CheckBox aExceptBtn;
68 : : OKButton aOKBtn;
69 : : CancelButton aCancelBtn;
70 : : HelpButton aHelpBtn;
71 : : ::com::sun::star::uno::Reference<
72 : : ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
73 : : ::com::sun::star::uno::Reference<
74 : : ::com::sun::star::linguistic2::XDictionary > xNewDic;
75 : :
76 : : #ifdef _SVX_OPTDICT_CXX
77 : : DECL_LINK(OKHdl_Impl, void *);
78 : : DECL_LINK(ModifyHdl_Impl, void *);
79 : : #endif
80 : :
81 : : public:
82 : : SvxNewDictionaryDialog( Window* pParent,
83 : : ::com::sun::star::uno::Reference<
84 : : ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl );
85 : :
86 : : ::com::sun::star::uno::Reference<
87 : : ::com::sun::star::linguistic2::XDictionary >
88 : 0 : GetNewDictionary() { return xNewDic; }
89 : : };
90 : :
91 : : // class SvxDictEdit ----------------------------------------------------
92 : :
93 [ # # ]: 0 : class SvxDictEdit : public Edit
94 : : {
95 : : Link aActionLink;
96 : : sal_Bool bSpaces;
97 : :
98 : : public:
99 : 0 : SvxDictEdit(Window* pParent, const ResId& rResId) :
100 [ # # ]: 0 : Edit(pParent, rResId), bSpaces(sal_False){}
101 : :
102 : 0 : void SetActionHdl( const Link& rLink )
103 : 0 : { aActionLink = rLink;}
104 : :
105 : 0 : void SetSpaces(sal_Bool bSet)
106 : 0 : {bSpaces = bSet;}
107 : :
108 : : virtual void KeyInput( const KeyEvent& rKEvent );
109 : : };
110 : :
111 : : // class SvxEditDictionaryDialog -----------------------------------------
112 : :
113 : : class SvxEditDictionaryDialog : public ModalDialog
114 : : {
115 : : private:
116 : :
117 : : FixedText aBookFT;
118 : : ListBox aAllDictsLB;
119 : : FixedText aLangFT;
120 : : SvxLanguageBox aLangLB;
121 : :
122 : : FixedText aWordFT;
123 : : SvxDictEdit aWordED;
124 : : FixedText aReplaceFT;
125 : : SvxDictEdit aReplaceED;
126 : : SvTabListBox aWordsLB;
127 : : PushButton aNewReplacePB;
128 : : PushButton aDeletePB;
129 : : FixedLine aEditDictsBox;
130 : :
131 : : HelpButton aHelpBtn;
132 : : CancelButton aCloseBtn;
133 : : String sModify;
134 : : String sNew;
135 : : DecorationView aDecoView;
136 : :
137 : : ::com::sun::star::uno::Sequence<
138 : : ::com::sun::star::uno::Reference<
139 : : ::com::sun::star::linguistic2::XDictionary > > aDics; //! snapshot copy to work on
140 : : ::com::sun::star::uno::Reference<
141 : : ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
142 : :
143 : : short nOld;
144 : : long nWidth;
145 : : sal_Bool bFirstSelect;
146 : : sal_Bool bDoNothing;
147 : : sal_Bool bDicIsReadonly;
148 : :
149 : : #ifdef _SVX_OPTDICT_CXX
150 : : DECL_LINK(SelectBookHdl_Impl, void *);
151 : : DECL_LINK(SelectLangHdl_Impl, void *);
152 : : DECL_LINK(SelectHdl, SvTabListBox*);
153 : : DECL_LINK(NewDelHdl, PushButton*);
154 : : DECL_LINK(ModifyHdl, Edit*);
155 : :
156 : :
157 : : void ShowWords_Impl( sal_uInt16 nId );
158 : : void SetLanguage_Impl( ::com::sun::star::util::Language nLanguage );
159 : 0 : sal_Bool IsDicReadonly_Impl() const { return bDicIsReadonly; }
160 : : void SetDicReadonly_Impl( ::com::sun::star::uno::Reference<
161 : : ::com::sun::star::linguistic2::XDictionary > &xDic );
162 : :
163 : : void RemoveDictEntry(SvLBoxEntry* pEntry);
164 : : sal_uInt16 GetLBInsertPos(const String &rDicWord);
165 : :
166 : : #endif
167 : :
168 : : protected:
169 : :
170 : : virtual void Paint( const Rectangle& rRect );
171 : :
172 : : public:
173 : : SvxEditDictionaryDialog( Window* pParent,
174 : : const String& rName,
175 : : ::com::sun::star::uno::Reference<
176 : : ::com::sun::star::linguistic2::XSpellChecker1> &xSpl );
177 : : ~SvxEditDictionaryDialog();
178 : :
179 : : sal_uInt16 GetSelectedDict() {return aAllDictsLB.GetSelectEntryPos();}
180 : : };
181 : :
182 : :
183 : : #endif
184 : :
185 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|