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 _SWUI_IDXMRK_HXX
29 : : #define _SWUI_IDXMRK_HXX
30 : :
31 : : #include <com/sun/star/container/XNameAccess.hpp>
32 : : #include <sfx2/basedlgs.hxx>
33 : :
34 : : #include <vcl/fixed.hxx>
35 : : #include <vcl/lstbox.hxx>
36 : : #include <vcl/combobox.hxx>
37 : : #include <svx/stddlg.hxx>
38 : :
39 : : #include <vcl/field.hxx>
40 : :
41 : : #include <vcl/group.hxx>
42 : :
43 : : #include <vcl/button.hxx>
44 : :
45 : : #include <vcl/button.hxx>
46 : : #include <sfx2/childwin.hxx>
47 : : #include "toxe.hxx"
48 : : #include <svtools/stdctrl.hxx>
49 : : #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
50 : :
51 : : class SwWrtShell;
52 : : class SwTOXMgr;
53 : : class SwTOXMark;
54 : : /*--------------------------------------------------------------------
55 : : Description: insert mark for index entry
56 : : --------------------------------------------------------------------*/
57 : : class SwIndexMarkFloatDlg;
58 : : class SwIndexMarkModalDlg;
59 : :
60 : : class SwIndexMarkDlg : public Window
61 : : {
62 : : friend class SwIndexMarkFloatDlg;
63 : : friend class SwIndexMarkModalDlg;
64 : : FixedLine aIndexFL;
65 : : FixedText aTypeFT;
66 : : ListBox aTypeDCB;
67 : : ImageButton aNewBT;
68 : :
69 : : FixedText aEntryFT;
70 : : Edit aEntryED;
71 : : FixedText aPhoneticFT0;
72 : : Edit aPhoneticED0;
73 : :
74 : : FixedText aKeyFT;
75 : : ComboBox aKeyDCB;
76 : : FixedText aPhoneticFT1;
77 : : Edit aPhoneticED1;
78 : :
79 : : FixedText aKey2FT;
80 : : ComboBox aKey2DCB;
81 : : FixedText aPhoneticFT2;
82 : : Edit aPhoneticED2;
83 : :
84 : : FixedText aLevelFT;
85 : : NumericField aLevelED;
86 : : CheckBox aMainEntryCB;
87 : : CheckBox aApplyToAllCB;
88 : : CheckBox aSearchCaseSensitiveCB;
89 : : CheckBox aSearchCaseWordOnlyCB;
90 : :
91 : :
92 : : OKButton aOKBT;
93 : : CancelButton aCancelBT;
94 : : HelpButton aHelpBT;
95 : : PushButton aDelBT;
96 : : //PushButton aNewBT;
97 : :
98 : : ImageButton aPrevSameBT;
99 : : ImageButton aNextSameBT;
100 : : ImageButton aPrevBT;
101 : : ImageButton aNextBT;
102 : :
103 : : String aOrgStr;
104 : : sal_Int32 nOptionsId;
105 : : sal_Bool bDel;
106 : : sal_Bool bNewMark;
107 : : sal_Bool bSelected;
108 : :
109 : : sal_Bool bPhoneticED0_ChangedByUser;
110 : : sal_Bool bPhoneticED1_ChangedByUser;
111 : : sal_Bool bPhoneticED2_ChangedByUser;
112 : : LanguageType nLangForPhoneticReading; //Language of current text used for phonetic reading proposal
113 : : sal_Bool bIsPhoneticReadingEnabled; //this value states whether phonetic reading is enabled in principle dependent of global cjk settings and language of current entry
114 : : com::sun::star::uno::Reference< com::sun::star::i18n::XExtendedIndexEntrySupplier >
115 : : xExtendedIndexEntrySupplier;
116 : :
117 : : SwTOXMgr* pTOXMgr;
118 : : SwWrtShell* pSh;
119 : :
120 : : void Apply();
121 : : void InitControls();
122 : : void InsertMark();
123 : : void UpdateMark();
124 : :
125 : : DECL_LINK( InsertHdl, Button * );
126 : : DECL_LINK(CloseHdl, void *);
127 : : DECL_LINK(DelHdl, void *);
128 : : DECL_LINK(NextHdl, void *);
129 : : DECL_LINK(NextSameHdl, void *);
130 : : DECL_LINK(PrevHdl, void *);
131 : : DECL_LINK(PrevSameHdl, void *);
132 : : DECL_LINK( ModifyHdl, ListBox* pBox = 0 );
133 : : DECL_LINK( KeyDCBModifyHdl, ComboBox * );
134 : : DECL_LINK(NewUserIdxHdl, void *);
135 : : DECL_LINK( SearchTypeHdl, CheckBox*);
136 : : DECL_LINK( PhoneticEDModifyHdl, Edit * );
137 : :
138 : : //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
139 : : //it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
140 : : //or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
141 : : void UpdateLanguageDependenciesForPhoneticReading();
142 : : String GetDefaultPhoneticReading( const String& rText );
143 : :
144 : : void UpdateKeyBoxes();
145 : :
146 : : void UpdateDialog();
147 : : void InsertUpdate();
148 : :
149 : : virtual void Activate();
150 : :
151 : : public:
152 : :
153 : : SwIndexMarkDlg( Window *pParent,
154 : : sal_Bool bNewDlg,
155 : : const ResId& rResId,
156 : : sal_Int32 _nOptionsId,
157 : : SwWrtShell& rWrtShell );
158 : :
159 : :
160 : : ~SwIndexMarkDlg();
161 : :
162 : : void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark = 0);
163 : 0 : sal_Bool IsTOXType(const String& rName)
164 : 0 : {return LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos(rName);}
165 : : };
166 : :
167 : 0 : class SwIndexMarkFloatDlg : public SfxModelessDialog
168 : : {
169 : : SwIndexMarkDlg aDlg;
170 : : virtual void Activate();
171 : : public:
172 : : SwIndexMarkFloatDlg( SfxBindings* pBindings,
173 : : SfxChildWindow* pChild,
174 : : Window *pParent,
175 : : SfxChildWinInfo* pInfo,
176 : : sal_Bool bNew=sal_True);
177 : : void ReInitDlg(SwWrtShell& rWrtShell);
178 : : };
179 : :
180 : 0 : class SwIndexMarkModalDlg : public SvxStandardDialog
181 : : {
182 : : SwIndexMarkDlg aDlg;
183 : : public:
184 : : SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark);
185 : :
186 : : virtual void Apply();
187 : : void ReInitDlg(SwWrtShell& rWrtShell);
188 : : };
189 : :
190 : : class SwAuthMarkModalDlg;
191 : :
192 : : class SwAuthMarkDlg : public Window
193 : : {
194 : : static sal_Bool bIsFromComponent;
195 : :
196 : : friend class SwAuthMarkModalDlg;
197 : : friend class SwAuthMarkFloatDlg;
198 : :
199 : : RadioButton aFromComponentRB;
200 : : RadioButton aFromDocContentRB;
201 : : FixedText aAuthorFT;
202 : : FixedInfo aAuthorFI;
203 : : FixedText aTitleFT;
204 : : FixedInfo aTitleFI;
205 : : FixedText aEntryFT;
206 : : Edit aEntryED;
207 : : ListBox aEntryLB;
208 : :
209 : : FixedLine aEntryFL;
210 : :
211 : : OKButton aOKBT;
212 : : CancelButton aCancelBT;
213 : : HelpButton aHelpBT;
214 : : PushButton aCreateEntryPB;
215 : : PushButton aEditEntryPB;
216 : :
217 : : String sChangeST;
218 : : sal_Bool bNewEntry;
219 : : sal_Bool bBibAccessInitialized;
220 : :
221 : : SwWrtShell* pSh;
222 : :
223 : : String m_sColumnTitles[AUTH_FIELD_END];
224 : : String m_sFields[AUTH_FIELD_END];
225 : :
226 : : String m_sCreatedEntry[AUTH_FIELD_END];
227 : :
228 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xBibAccess;
229 : :
230 : : DECL_LINK(InsertHdl, void *);
231 : : DECL_LINK(CloseHdl, void *);
232 : : DECL_LINK(CreateEntryHdl, PushButton*);
233 : : DECL_LINK(CompEntryHdl, ListBox*);
234 : : DECL_LINK(ChangeSourceHdl, RadioButton*);
235 : : DECL_LINK(IsEntryAllowedHdl, Edit*);
236 : : DECL_LINK(EditModifyHdl, Edit*);
237 : :
238 : : void InitControls();
239 : : virtual void Activate();
240 : : public:
241 : :
242 : : SwAuthMarkDlg( Window *pParent,
243 : : const ResId& rResId,
244 : : sal_Bool bNew=sal_True);
245 : : ~SwAuthMarkDlg();
246 : :
247 : : void ReInitDlg(SwWrtShell& rWrtShell);
248 : : };
249 : :
250 : 0 : class SwAuthMarkFloatDlg : public SfxModelessDialog
251 : : {
252 : : SwAuthMarkDlg aDlg;
253 : : virtual void Activate();
254 : : public:
255 : : SwAuthMarkFloatDlg( SfxBindings* pBindings,
256 : : SfxChildWindow* pChild,
257 : : Window *pParent,
258 : : SfxChildWinInfo* pInfo,
259 : : sal_Bool bNew=sal_True);
260 : : void ReInitDlg(SwWrtShell& rWrtShell);
261 : : };
262 : :
263 : 0 : class SwAuthMarkModalDlg : public SvxStandardDialog
264 : : {
265 : : SwAuthMarkDlg aDlg;
266 : : public:
267 : : SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh);
268 : :
269 : : virtual void Apply();
270 : : void ReInitDlg(SwWrtShell& rWrtShell);
271 : : };
272 : :
273 : : #endif // _SWUI_IDXMRK_HXX
274 : :
275 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|