xref: /aoo41x/main/sw/source/ui/inc/swuiidxmrk.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SWUI_IDXMRK_HXX
28 #define _SWUI_IDXMRK_HXX
29 
30 #include <com/sun/star/container/XNameAccess.hpp>
31 #include <sfx2/basedlgs.hxx>
32 
33 #ifndef _FIXED_HXX //autogen
34 #include <vcl/fixed.hxx>
35 #endif
36 #include <vcl/lstbox.hxx>
37 #ifndef _COMBOBOX_HXX //autogen
38 #include <vcl/combobox.hxx>
39 #endif
40 #include <svx/stddlg.hxx>
41 
42 #ifndef _FIELD_HXX //autogen
43 #include <vcl/field.hxx>
44 #endif
45 
46 #ifndef _GROUP_HXX //autogen
47 #include <vcl/group.hxx>
48 #endif
49 
50 #ifndef _BUTTON_HXX //autogen
51 #include <vcl/button.hxx>
52 #endif
53 
54 #ifndef _IMAGEBTN_HXX //autogen
55 #include <vcl/button.hxx>
56 #endif
57 #include <sfx2/childwin.hxx>
58 #include "toxe.hxx"
59 #include <svtools/stdctrl.hxx>
60 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
61 
62 class SwWrtShell;
63 class SwTOXMgr;
64 class SwTOXMark;
65 /*--------------------------------------------------------------------
66 	 Beschreibung:	Markierung fuer Verzeichniseintrag einfuegen
67  --------------------------------------------------------------------*/
68 class SwIndexMarkFloatDlg;
69 class SwIndexMarkModalDlg;
70 class SwIndexMarkDlg : public Window
71 {
72 	friend class SwIndexMarkFloatDlg;
73 	friend class SwIndexMarkModalDlg;
74 	FixedLine       aIndexFL;
75 	FixedText 		aTypeFT;
76 	ListBox			aTypeDCB;
77 	ImageButton 	aNewBT;
78 
79 	FixedText 		aEntryFT;
80 	Edit 			aEntryED;
81 	FixedText 		aPhoneticFT0;
82 	Edit			aPhoneticED0;
83 
84 	FixedText 		aKeyFT;
85 	ComboBox		aKeyDCB;
86 	FixedText 		aPhoneticFT1;
87 	Edit			aPhoneticED1;
88 
89 	FixedText 		aKey2FT;
90 	ComboBox 		aKey2DCB;
91 	FixedText 		aPhoneticFT2;
92 	Edit			aPhoneticED2;
93 
94 	FixedText 		aLevelFT;
95 	NumericField	aLevelED;
96  	CheckBox		aMainEntryCB;
97  	CheckBox		aApplyToAllCB;
98  	CheckBox		aSearchCaseSensitiveCB;
99  	CheckBox	   	aSearchCaseWordOnlyCB;
100 
101 
102 	OKButton 		aOKBT;
103 	CancelButton 	aCancelBT;
104 	HelpButton 		aHelpBT;
105 	PushButton		aDelBT;
106 	//PushButton		aNewBT;
107 
108 	ImageButton		aPrevSameBT;
109 	ImageButton		aNextSameBT;
110 	ImageButton		aPrevBT;
111 	ImageButton		aNextBT;
112 
113 	String			aOrgStr;
114 	sal_Int32		nOptionsId;
115 	sal_Bool			bDel;
116 	sal_Bool			bNewMark;
117 	sal_Bool			bSelected;
118 
119 	sal_Bool			bPhoneticED0_ChangedByUser;
120 	sal_Bool			bPhoneticED1_ChangedByUser;
121 	sal_Bool			bPhoneticED2_ChangedByUser;
122 	LanguageType	nLangForPhoneticReading; //Language of current text used for phonetic reading proposal
123 	sal_Bool			bIsPhoneticReadingEnabled; //this value states wether phopentic reading is enabled in principle dependend of global cjk settings and language of current entry
124 	com::sun::star::uno::Reference< com::sun::star::i18n::XExtendedIndexEntrySupplier >
125 					xExtendedIndexEntrySupplier;
126 
127 	SwTOXMgr*	   	pTOXMgr;
128 	SwWrtShell*	   	pSh;
129 
130 	void			Apply();
131 	void 			InitControls();
132 	void			InsertMark();
133 	void 			UpdateMark();
134 
135 	DECL_LINK( InsertHdl, Button * );
136 	DECL_LINK( CloseHdl, Button * );
137 	DECL_LINK( DelHdl, Button * );
138 	DECL_LINK( NextHdl, Button * );
139 	DECL_LINK( NextSameHdl, Button * );
140 	DECL_LINK( PrevHdl, Button * );
141 	DECL_LINK( PrevSameHdl, Button * );
142 	DECL_LINK( ModifyHdl, ListBox* pBox = 0 );
143 	DECL_LINK( KeyDCBModifyHdl, ComboBox * );
144 	DECL_LINK( NewUserIdxHdl, Button*);
145 	DECL_LINK( SearchTypeHdl, CheckBox*);
146 	DECL_LINK( PhoneticEDModifyHdl, Edit * );
147 
148 	//this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
149 	//it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
150 	//or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
151 	void			UpdateLanguageDependenciesForPhoneticReading();
152 	String			GetDefaultPhoneticReading( const String& rText );
153 
154 	void 			UpdateKeyBoxes();
155 
156 	void			UpdateDialog();
157 	void			InsertUpdate();
158 
159 	virtual void	Activate();
160 
161 public:
162 
163 	SwIndexMarkDlg( Window *pParent,
164 				   	sal_Bool bNewDlg,
165 					const ResId& rResId,
166                     sal_Int32 _nOptionsId,
167                     SwWrtShell& rWrtShell );
168 
169 
170 	~SwIndexMarkDlg();
171 
172     void    ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark = 0);
173 	sal_Bool	IsTOXType(const String& rName)
174 				{return LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos(rName);}
175 };
176 /* -----------------06.10.99 10:11-------------------
177 
178  --------------------------------------------------*/
179 class SwIndexMarkFloatDlg : public SfxModelessDialog
180 {
181 	SwIndexMarkDlg		aDlg;
182 	virtual void	Activate();
183 	public:
184 		SwIndexMarkFloatDlg( 	SfxBindings* pBindings,
185 				   				SfxChildWindow* pChild,
186 				   				Window *pParent,
187 								SfxChildWinInfo* pInfo,
188 				   				sal_Bool bNew=sal_True);
189 	void	ReInitDlg(SwWrtShell& rWrtShell);
190 };
191 /* -----------------06.10.99 10:33-------------------
192 
193  --------------------------------------------------*/
194 class SwIndexMarkModalDlg : public SvxStandardDialog
195 {
196 	SwIndexMarkDlg		aDlg;
197 public:
198     SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark);
199 
200 	virtual void		Apply();
201 	void	ReInitDlg(SwWrtShell& rWrtShell);
202 };
203 
204 /* -----------------15.09.99 08:39-------------------
205 
206  --------------------------------------------------*/
207 class SwAuthMarkModalDlg;
208 class SwAuthMarkDlg : public Window
209 {
210 	static sal_Bool 	bIsFromComponent;
211 
212 	friend class SwAuthMarkModalDlg;
213     friend class SwAuthMarkFloatDlg;
214 
215     RadioButton     aFromComponentRB;
216 	RadioButton		aFromDocContentRB;
217 	FixedText		aAuthorFT;
218 	FixedInfo		aAuthorFI;
219 	FixedText		aTitleFT;
220 	FixedInfo		aTitleFI;
221 	FixedText		aEntryFT;
222 	Edit			aEntryED;
223 	ListBox 		aEntryLB;
224 
225     FixedLine       aEntryFL;
226 
227 	OKButton 		aOKBT;
228 	CancelButton 	aCancelBT;
229 	HelpButton 		aHelpBT;
230 	PushButton 		aCreateEntryPB;
231 	PushButton 		aEditEntryPB;
232 
233 	String			sChangeST;
234 	sal_Bool 			bNewEntry;
235 	sal_Bool			bBibAccessInitialized;
236 
237 	SwWrtShell*	   	pSh;
238 
239 	String			m_sColumnTitles[AUTH_FIELD_END];
240 	String			m_sFields[AUTH_FIELD_END];
241 
242 	String 			m_sCreatedEntry[AUTH_FIELD_END];
243 
244 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >  	xBibAccess;
245 
246 	DECL_LINK(InsertHdl, PushButton*);
247 	DECL_LINK(CloseHdl, PushButton*);
248 	DECL_LINK(CreateEntryHdl, PushButton*);
249 	DECL_LINK(CompEntryHdl, ListBox*);
250 	DECL_LINK(ChangeSourceHdl, RadioButton*);
251 	DECL_LINK(IsEntryAllowedHdl, Edit*);
252     DECL_LINK(EditModifyHdl, Edit*);
253 
254 	void InitControls();
255     virtual void    Activate();
256 public:
257 
258 	SwAuthMarkDlg( Window *pParent,
259 					const ResId& rResId,
260 				   	sal_Bool bNew=sal_True);
261 	~SwAuthMarkDlg();
262 
263 	void	ReInitDlg(SwWrtShell& rWrtShell);
264 };
265 /* -----------------06.10.99 10:11-------------------
266 
267  --------------------------------------------------*/
268 class SwAuthMarkFloatDlg : public SfxModelessDialog
269 {
270 	SwAuthMarkDlg		aDlg;
271 	virtual void	Activate();
272 	public:
273 		SwAuthMarkFloatDlg( 	SfxBindings* pBindings,
274 				   				SfxChildWindow* pChild,
275 				   				Window *pParent,
276 								SfxChildWinInfo* pInfo,
277 				   				sal_Bool bNew=sal_True);
278 	void	ReInitDlg(SwWrtShell& rWrtShell);
279 };
280 /* -----------------06.10.99 10:33-------------------
281 
282  --------------------------------------------------*/
283 class SwAuthMarkModalDlg : public SvxStandardDialog
284 {
285 	SwAuthMarkDlg		aDlg;
286 public:
287 	SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh);
288 
289 	virtual void		Apply();
290 	void	ReInitDlg(SwWrtShell& rWrtShell);
291 };
292 
293 
294 #endif // _SWUI_IDXMRK_HXX
295 
296