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