1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
37 #include <svtools/stdctrl.hxx>
38 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
43 /*--------------------------------------------------------------------
44 Description: insert mark for index entry
45 --------------------------------------------------------------------*/
46 class SwIndexMarkFloatDlg
;
47 class SwIndexMarkModalDlg
;
53 friend class SwIndexMarkFloatDlg
;
54 friend class SwIndexMarkModalDlg
;
61 FixedText
* m_pPhoneticFT0
;
66 FixedText
* m_pPhoneticFT1
;
71 FixedText
* m_pPhoneticFT2
;
74 FixedText
* m_pLevelFT
;
75 NumericField
* m_pLevelNF
;
76 CheckBox
* m_pMainEntryCB
;
77 CheckBox
* m_pApplyToAllCB
;
78 CheckBox
* m_pSearchCaseSensitiveCB
;
79 CheckBox
* m_pSearchCaseWordOnlyCB
;
83 CloseButton
* m_pCloseBT
;
86 PushButton
* m_pPrevSameBT
;
87 PushButton
* m_pNextSameBT
;
88 PushButton
* m_pPrevBT
;
89 PushButton
* m_pNextBT
;
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
;
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();
140 SwIndexMarkPane(Dialog
&rDialog
,
142 SwWrtShell
& rWrtShell
);
144 Dialog
&GetDialog() { return m_rDialog
; }
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();
159 SwIndexMarkFloatDlg( SfxBindings
* pBindings
,
160 SfxChildWindow
* pChild
,
162 SfxChildWinInfo
* pInfo
,
163 sal_Bool bNew
=sal_True
);
164 void ReInitDlg(SwWrtShell
& rWrtShell
);
167 class SwIndexMarkModalDlg
: public SvxStandardDialog
169 SwIndexMarkPane m_aContent
;
171 SwIndexMarkModalDlg(Window
*pParent
, SwWrtShell
& rSh
, SwTOXMark
* pCurTOXMark
);
173 virtual void Apply();
174 void ReInitDlg(SwWrtShell
& rWrtShell
);
177 class SwAuthMarkModalDlg
;
179 class SwAuthorMarkPane
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
;
195 PushButton
* m_pActionBT
;
196 CloseButton
* m_pCloseBT
;
197 PushButton
* m_pCreateEntryPB
;
198 PushButton
* m_pEditEntryPB
;
201 sal_Bool bBibAccessInitialized
;
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
*);
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();
235 SwAuthMarkFloatDlg( SfxBindings
* pBindings
,
236 SfxChildWindow
* pChild
,
238 SfxChildWinInfo
* pInfo
,
239 sal_Bool bNew
=sal_True
);
240 void ReInitDlg(SwWrtShell
& rWrtShell
);
243 class SwAuthMarkModalDlg
: public SvxStandardDialog
245 SwAuthorMarkPane m_aContent
;
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: */