bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / swuiidxmrk.hxx
blobf09254e2db9475a50ae2a03214f185d54f552b33
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SWUI_IDXMRK_HXX
20 #define _SWUI_IDXMRK_HXX
22 #include <com/sun/star/container/XNameAccess.hpp>
23 #include <sfx2/basedlgs.hxx>
25 #include <svx/stddlg.hxx>
27 #include <vcl/button.hxx>
28 #include <vcl/combobox.hxx>
29 #include <vcl/field.hxx>
30 #include <vcl/fixed.hxx>
31 #include <vcl/group.hxx>
32 #include <vcl/layout.hxx>
33 #include <vcl/lstbox.hxx>
35 #include <sfx2/childwin.hxx>
36 #include "toxe.hxx"
37 #include <svtools/stdctrl.hxx>
38 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
40 class SwWrtShell;
41 class SwTOXMgr;
42 class SwTOXMark;
43 /*--------------------------------------------------------------------
44 Description: insert mark for index entry
45 --------------------------------------------------------------------*/
46 class SwIndexMarkFloatDlg;
47 class SwIndexMarkModalDlg;
49 class SwIndexMarkPane
51 Dialog& m_rDialog;
53 friend class SwIndexMarkFloatDlg;
54 friend class SwIndexMarkModalDlg;
55 VclFrame* m_pFrame;
56 FixedText* m_pTypeFT;
57 ListBox* m_pTypeDCB;
58 PushButton* m_pNewBT;
60 Edit* m_pEntryED;
61 FixedText* m_pPhoneticFT0;
62 Edit* m_pPhoneticED0;
64 FixedText* m_pKey1FT;
65 ComboBox* m_pKey1DCB;
66 FixedText* m_pPhoneticFT1;
67 Edit* m_pPhoneticED1;
69 FixedText* m_pKey2FT;
70 ComboBox* m_pKey2DCB;
71 FixedText* m_pPhoneticFT2;
72 Edit* m_pPhoneticED2;
74 FixedText* m_pLevelFT;
75 NumericField* m_pLevelNF;
76 CheckBox* m_pMainEntryCB;
77 CheckBox* m_pApplyToAllCB;
78 CheckBox* m_pSearchCaseSensitiveCB;
79 CheckBox* m_pSearchCaseWordOnlyCB;
82 PushButton* m_pOKBT;
83 CloseButton* m_pCloseBT;
84 PushButton* m_pDelBT;
86 PushButton* m_pPrevSameBT;
87 PushButton* m_pNextSameBT;
88 PushButton* m_pPrevBT;
89 PushButton* m_pNextBT;
91 String aOrgStr;
92 sal_Bool bDel;
93 sal_Bool bNewMark;
94 sal_Bool bSelected;
96 sal_Bool bPhoneticED0_ChangedByUser;
97 sal_Bool bPhoneticED1_ChangedByUser;
98 sal_Bool bPhoneticED2_ChangedByUser;
99 LanguageType nLangForPhoneticReading; //Language of current text used for phonetic reading proposal
100 sal_Bool bIsPhoneticReadingEnabled; //this value states whether phonetic reading is enabled in principle dependent of global cjk settings and language of current entry
101 com::sun::star::uno::Reference< com::sun::star::i18n::XExtendedIndexEntrySupplier >
102 xExtendedIndexEntrySupplier;
104 SwTOXMgr* pTOXMgr;
105 SwWrtShell* pSh;
107 void Apply();
108 void InitControls();
109 void InsertMark();
110 void UpdateMark();
112 DECL_LINK( InsertHdl, Button * );
113 DECL_LINK(CloseHdl, void *);
114 DECL_LINK(DelHdl, void *);
115 DECL_LINK(NextHdl, void *);
116 DECL_LINK(NextSameHdl, void *);
117 DECL_LINK(PrevHdl, void *);
118 DECL_LINK(PrevSameHdl, void *);
119 DECL_LINK( ModifyHdl, ListBox* pBox = 0 );
120 DECL_LINK( KeyDCBModifyHdl, ComboBox * );
121 DECL_LINK(NewUserIdxHdl, void *);
122 DECL_LINK( SearchTypeHdl, CheckBox*);
123 DECL_LINK( PhoneticEDModifyHdl, Edit * );
125 //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
126 //it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
127 //or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
128 void UpdateLanguageDependenciesForPhoneticReading();
129 String GetDefaultPhoneticReading( const String& rText );
131 void UpdateKeyBoxes();
133 void UpdateDialog();
134 void InsertUpdate();
136 void Activate();
138 public:
140 SwIndexMarkPane(Dialog &rDialog,
141 sal_Bool bNewDlg,
142 SwWrtShell& rWrtShell);
144 Dialog &GetDialog() { return m_rDialog; }
147 ~SwIndexMarkPane();
149 void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark = 0);
150 sal_Bool IsTOXType(const String& rName)
151 {return LISTBOX_ENTRY_NOTFOUND != m_pTypeDCB->GetEntryPos(rName);}
154 class SwIndexMarkFloatDlg : public SfxModelessDialog
156 SwIndexMarkPane m_aContent;
157 virtual void Activate();
158 public:
159 SwIndexMarkFloatDlg( SfxBindings* pBindings,
160 SfxChildWindow* pChild,
161 Window *pParent,
162 SfxChildWinInfo* pInfo,
163 sal_Bool bNew=sal_True);
164 void ReInitDlg(SwWrtShell& rWrtShell);
167 class SwIndexMarkModalDlg : public SvxStandardDialog
169 SwIndexMarkPane m_aContent;
170 public:
171 SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark);
173 virtual void Apply();
174 void ReInitDlg(SwWrtShell& rWrtShell);
177 class SwAuthMarkModalDlg;
179 class SwAuthorMarkPane
181 Dialog& m_rDialog;
183 static sal_Bool bIsFromComponent;
185 friend class SwAuthMarkModalDlg;
186 friend class SwAuthMarkFloatDlg;
188 RadioButton* m_pFromComponentRB;
189 RadioButton* m_pFromDocContentRB;
190 FixedText* m_pAuthorFI;
191 FixedText* m_pTitleFI;
192 Edit* m_pEntryED;
193 ListBox* m_pEntryLB;
195 PushButton* m_pActionBT;
196 CloseButton* m_pCloseBT;
197 PushButton* m_pCreateEntryPB;
198 PushButton* m_pEditEntryPB;
200 sal_Bool bNewEntry;
201 sal_Bool bBibAccessInitialized;
203 SwWrtShell* pSh;
205 String m_sColumnTitles[AUTH_FIELD_END];
206 String m_sFields[AUTH_FIELD_END];
208 String m_sCreatedEntry[AUTH_FIELD_END];
210 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xBibAccess;
212 DECL_LINK(InsertHdl, void *);
213 DECL_LINK(CloseHdl, void *);
214 DECL_LINK(CreateEntryHdl, PushButton*);
215 DECL_LINK(CompEntryHdl, ListBox*);
216 DECL_LINK(ChangeSourceHdl, RadioButton*);
217 DECL_LINK(IsEntryAllowedHdl, Edit*);
218 DECL_LINK(EditModifyHdl, Edit*);
220 void InitControls();
221 void Activate();
222 public:
224 SwAuthorMarkPane( Dialog &rDialog,
225 sal_Bool bNew=sal_True);
227 void ReInitDlg(SwWrtShell& rWrtShell);
230 class SwAuthMarkFloatDlg : public SfxModelessDialog
232 SwAuthorMarkPane m_aContent;
233 virtual void Activate();
234 public:
235 SwAuthMarkFloatDlg( SfxBindings* pBindings,
236 SfxChildWindow* pChild,
237 Window *pParent,
238 SfxChildWinInfo* pInfo,
239 sal_Bool bNew=sal_True);
240 void ReInitDlg(SwWrtShell& rWrtShell);
243 class SwAuthMarkModalDlg : public SvxStandardDialog
245 SwAuthorMarkPane m_aContent;
246 public:
247 SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh);
249 virtual void Apply();
250 void ReInitDlg(SwWrtShell& rWrtShell);
253 #endif // _SWUI_IDXMRK_HXX
255 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */