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