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 INCLUDED_SW_INC_SWABSTDLG_HXX
20 #define INCLUDED_SW_INC_SWABSTDLG_HXX
22 #include <rtl/ustring.hxx>
23 #include <sfx2/sfxdlg.hxx>
24 #include <com/sun/star/uno/Reference.h>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <boost/optional.hpp>
29 #include "tblenum.hxx"
34 namespace vcl
{ class Window
; }
35 class SfxStyleSheetBase
;
45 class SwTableAutoFormat
;
47 class SwTOXDescription
;
54 class SwChildWinWrapper
;
55 struct SfxChildWinInfo
;
58 struct SwInsertTableOptions
;
59 enum class SwBorderModes
;
60 enum class SwCharDlgMode
;
61 enum class SfxStyleFamily
;
63 namespace com
{namespace sun
{namespace star
{
68 class XColumnsSupplier
;
75 namespace container
{ class XNameAccess
; }
76 namespace container
{ class XNamed
; }
80 namespace sw
{ namespace mark
{ class IFieldmark
; } }
82 typedef void (*SwLabDlgMethod
) (css::uno::Reference
< css::frame::XModel
> const & xModel
, const SwLabItem
& rItem
);
84 typedef OUString (*GlossaryGetCurrGroup
)();
85 typedef void (*GlossarySetActGroup
)(const OUString
& rNewGroup
);
87 class AbstractGlossaryDlg
: public VclAbstractDialog
90 virtual ~AbstractGlossaryDlg() override
= default;
92 virtual OUString
GetCurrGrpName() const = 0;
93 virtual OUString
GetCurrShortName() const = 0;
96 class AbstractFieldInputDlg
: public VclAbstractTerminatedDialog
99 virtual ~AbstractFieldInputDlg() override
= default;
101 virtual void EndDialog(sal_Int32 nResult
) override
= 0;
102 virtual bool PrevButtonPressed() const = 0;
103 virtual bool NextButtonPressed() const = 0;
106 class AbstractInsFootNoteDlg
: public VclAbstractDialog
109 virtual ~AbstractInsFootNoteDlg() override
= default;
111 virtual OUString
GetFontName() = 0;
112 virtual bool IsEndNote() = 0;
113 virtual OUString
GetStr() = 0;
115 virtual void SetHelpId( const OString
& sHelpId
) = 0;
116 virtual void SetText( const OUString
& rStr
) = 0;
119 class AbstractInsTableDlg
: public VclAbstractDialog
122 virtual ~AbstractInsTableDlg() override
= default;
124 virtual void GetValues( OUString
& rName
, sal_uInt16
& rRow
, sal_uInt16
& rCol
,
125 SwInsertTableOptions
& rInsTableFlags
, OUString
& rTableAutoFormatName
,
126 std::unique_ptr
<SwTableAutoFormat
>& prTAFormat
) = 0;
129 class AbstractJavaEditDialog
: public VclAbstractDialog
132 virtual ~AbstractJavaEditDialog() override
= default;
134 virtual OUString
GetScriptText() const = 0;
135 virtual OUString
GetScriptType() const = 0;
136 virtual bool IsUrl() const = 0;
137 virtual bool IsNew() const = 0;
138 virtual bool IsUpdate() const = 0;
141 class AbstractMailMergeDlg
: public VclAbstractDialog
144 virtual ~AbstractMailMergeDlg() override
= default;
146 virtual DBManagerOptions
GetMergeType() = 0;
147 virtual const OUString
& GetSaveFilter() const = 0;
148 virtual const css::uno::Sequence
< css::uno::Any
> GetSelection() const = 0;
149 virtual css::uno::Reference
< css::sdbc::XResultSet
> GetResultSet() const = 0;
150 virtual bool IsSaveSingleDoc() const = 0;
151 virtual bool IsGenerateFromDataBase() const = 0;
152 virtual OUString
GetColumnName() const = 0;
153 virtual OUString
GetTargetURL() const = 0;
156 class AbstractMailMergeCreateFromDlg
: public VclAbstractDialog
159 virtual ~AbstractMailMergeCreateFromDlg() override
= default;
161 virtual bool IsThisDocument() const = 0;
164 class AbstractMailMergeFieldConnectionsDlg
: public VclAbstractDialog
167 virtual ~AbstractMailMergeFieldConnectionsDlg() override
= default;
169 virtual bool IsUseExistingConnections() const = 0;
172 class AbstractMultiTOXTabDialog
: public VclAbstractDialog
175 virtual ~AbstractMultiTOXTabDialog() override
= default;
177 virtual CurTOXType
GetCurrentTOXType() const = 0;
178 virtual SwTOXDescription
& GetTOXDescription(CurTOXType eTOXTypes
) = 0;
180 virtual const SfxItemSet
* GetOutputItemSet() const = 0;
183 class AbstractEditRegionDlg
: public VclAbstractDialog
186 virtual ~AbstractEditRegionDlg() override
= default;
188 virtual void SelectSection(const OUString
& rSectionName
) = 0;
191 class AbstractInsertSectionTabDialog
: public VclAbstractDialog
194 virtual ~AbstractInsertSectionTabDialog() override
= default;
196 virtual void SetSectionData(SwSectionData
const& rSect
) = 0;
199 class AbstractSwWordCountFloatDlg
: public VclAbstractDialog
202 virtual ~AbstractSwWordCountFloatDlg() override
= default;
204 virtual void UpdateCounts() = 0;
205 virtual void SetCounts(const SwDocStat
&rCurrCnt
, const SwDocStat
&rDocStat
) = 0;
206 virtual std::shared_ptr
<SfxDialogController
> GetController() = 0;
209 class AbstractSwInsertAbstractDlg
: public VclAbstractDialog
212 virtual ~AbstractSwInsertAbstractDlg() override
= default;
214 virtual sal_uInt8
GetLevel() const = 0;
215 virtual sal_uInt8
GetPara() const = 0;
218 class AbstractSwAsciiFilterDlg
: public VclAbstractDialog
221 virtual ~AbstractSwAsciiFilterDlg() override
= default;
223 virtual void FillOptions( SwAsciiOptions
& rOptions
) = 0;
227 class AbstractSwBreakDlg
: public VclAbstractDialog
230 virtual ~AbstractSwBreakDlg() override
= default;
232 virtual OUString
GetTemplateName() = 0;
233 virtual sal_uInt16
GetKind() = 0;
234 virtual ::boost::optional
<sal_uInt16
> GetPageNumber() = 0;
238 class AbstractSplitTableDialog
: public VclAbstractDialog
// add for
241 virtual ~AbstractSplitTableDialog() override
= default;
243 virtual SplitTable_HeadlineOption
GetSplitMode() = 0;
246 class AbstractSwConvertTableDlg
: public VclAbstractDialog
249 virtual ~AbstractSwConvertTableDlg() override
= default;
251 virtual void GetValues( sal_Unicode
& rDelim
,
252 SwInsertTableOptions
& rInsTableFlags
,
253 SwTableAutoFormat
const*& prTAFormat
) = 0;
256 class AbstractSwInsertDBColAutoPilot
: public VclAbstractDialog
259 virtual ~AbstractSwInsertDBColAutoPilot() override
= default;
261 virtual void DataToDoc( const css::uno::Sequence
< css::uno::Any
>& rSelection
,
262 css::uno::Reference
< css::sdbc::XDataSource
> rxSource
,
263 css::uno::Reference
< css::sdbc::XConnection
> xConnection
,
264 css::uno::Reference
< css::sdbc::XResultSet
> xResultSet
) = 0;
267 class AbstractDropDownFieldDialog
: public VclAbstractDialog
270 virtual ~AbstractDropDownFieldDialog() override
= default;
272 virtual bool PrevButtonPressed() const = 0;
273 virtual bool NextButtonPressed() const = 0;
276 class AbstractSwLabDlg
: public SfxAbstractTabDialog
279 virtual ~AbstractSwLabDlg() override
= default;
281 virtual const OUString
& GetBusinessCardStr() const = 0;
282 virtual Printer
*GetPrt() =0;
285 class AbstractSwSelGlossaryDlg
: public VclAbstractDialog
288 virtual ~AbstractSwSelGlossaryDlg() override
= default;
290 virtual void InsertGlos(const OUString
&rRegion
, const OUString
&rGlosName
) = 0; // inline
291 virtual sal_Int32
GetSelectedIdx() const = 0; // inline
292 virtual void SelectEntryPos(sal_Int32 nIdx
) = 0; // inline
295 class AbstractSwAutoFormatDlg
: public VclAbstractDialog
298 virtual ~AbstractSwAutoFormatDlg() override
= default;
300 virtual std::unique_ptr
<SwTableAutoFormat
> FillAutoFormatOfIndex() const = 0;
303 class AbstractSwFieldDlg
: public SfxAbstractTabDialog
306 virtual ~AbstractSwFieldDlg() override
= default;
308 virtual void Initialize(SfxChildWinInfo
*pInfo
) = 0;
309 virtual void ReInitDlg() = 0;
310 virtual void ActivateDatabasePage() = 0;
311 virtual void ShowReferencePage() = 0;
312 virtual std::shared_ptr
<SfxDialogController
> GetController() = 0;
315 class AbstractSwRenameXNamedDlg
: public VclAbstractDialog
318 virtual ~AbstractSwRenameXNamedDlg() override
= default;
320 virtual void SetForbiddenChars( const OUString
& rSet
) = 0;
321 virtual void SetAlternativeAccess(
322 css::uno::Reference
< css::container::XNameAccess
> & xSecond
,
323 css::uno::Reference
< css::container::XNameAccess
> & xThird
) = 0;
326 class AbstractSwModalRedlineAcceptDlg
: public VclAbstractDialog
329 virtual ~AbstractSwModalRedlineAcceptDlg() override
= default;
331 virtual void AcceptAll( bool bAccept
) = 0;
334 class AbstractMarkFloatDlg
: public VclAbstractDialog
337 virtual ~AbstractMarkFloatDlg() override
= default;
339 virtual void ReInitDlg(SwWrtShell
& rWrtShell
) = 0;
340 virtual std::shared_ptr
<SfxDialogController
> GetController() = 0;
343 #define RET_LOAD_DOC 100
344 #define RET_TARGET_CREATED 103
345 #define RET_REMOVE_TARGET 104
347 class SwMailMergeConfigItem
;
349 class AbstractMailMergeWizard
: public VclAbstractDialog
352 virtual ~AbstractMailMergeWizard() override
= default;
354 virtual OUString
GetReloadDocument() const = 0;
355 virtual void ShowPage( sal_uInt16 nLevel
) = 0;
356 virtual sal_uInt16
GetRestartPage() const = 0;
359 class SwAbstractDialogFactory
362 static SwAbstractDialogFactory
* Create();
364 virtual VclPtr
<SfxAbstractDialog
> CreateNumFormatDialog(weld::Widget
* pParent
, const SfxItemSet
& rAttr
) = 0;
365 virtual VclPtr
<SfxAbstractDialog
> CreateSwDropCapsDialog(weld::Window
* pParent
, const SfxItemSet
& rSet
) = 0;
366 virtual VclPtr
<SfxAbstractDialog
> CreateSwBackgroundDialog(weld::Window
* pParent
, const SfxItemSet
& rSet
) = 0;
368 virtual VclPtr
<AbstractSwWordCountFloatDlg
> CreateSwWordCountDialog(SfxBindings
* pBindings
,
369 SfxChildWindow
* pChild
, weld::Window
*pParent
, SfxChildWinInfo
* pInfo
) = 0;
371 virtual VclPtr
<AbstractSwInsertAbstractDlg
> CreateSwInsertAbstractDlg(weld::Window
* pParent
) = 0;
372 virtual VclPtr
<SfxAbstractDialog
> CreateSwAddressAbstractDlg(weld::Window
* pParent
, const SfxItemSet
& rSet
) = 0;
373 virtual VclPtr
<AbstractSwAsciiFilterDlg
> CreateSwAsciiFilterDlg(weld::Window
* pParent
, SwDocShell
& rDocSh
,
374 SvStream
* pStream
) = 0;
375 virtual VclPtr
<VclAbstractDialog
> CreateSwInsertBookmarkDlg(weld::Window
*pParent
, SwWrtShell
&rSh
, SfxRequest
& rReq
) = 0;
377 virtual VclPtr
<AbstractSwBreakDlg
> CreateSwBreakDlg(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
378 virtual VclPtr
<VclAbstractDialog
> CreateSwChangeDBDlg(SwView
& rVw
) = 0;
379 virtual VclPtr
<SfxAbstractTabDialog
> CreateSwCharDlg(weld::Window
* pParent
, SwView
& pVw
, const SfxItemSet
& rCoreSet
,
380 SwCharDlgMode nDialogMode
, const OUString
* pFormatStr
= nullptr) = 0;
381 virtual VclPtr
<AbstractSwConvertTableDlg
> CreateSwConvertTableDlg(SwView
& rView
, bool bToTable
) = 0;
382 virtual VclPtr
<VclAbstractDialog
> CreateSwCaptionDialog(weld::Window
*pParent
, SwView
&rV
) = 0;
384 virtual VclPtr
<AbstractSwInsertDBColAutoPilot
> CreateSwInsertDBColAutoPilot(SwView
& rView
,
385 css::uno::Reference
< css::sdbc::XDataSource
> rxSource
,
386 css::uno::Reference
<css::sdbcx::XColumnsSupplier
> xColSupp
,
387 const SwDBData
& rData
) = 0;
388 virtual VclPtr
<SfxAbstractTabDialog
> CreateSwFootNoteOptionDlg(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
390 virtual VclPtr
<AbstractDropDownFieldDialog
> CreateDropDownFieldDialog(weld::Widget
* pParent
, SwWrtShell
&rSh
,
391 SwField
* pField
, bool bPrevButton
, bool bNextButton
) = 0;
392 virtual VclPtr
<VclAbstractDialog
> CreateDropDownFormFieldDialog(weld::Widget
* pParent
, sw::mark::IFieldmark
* pDropDownField
) = 0;
393 virtual VclPtr
<SfxAbstractTabDialog
> CreateSwEnvDlg(weld::Window
* pParent
, const SfxItemSet
& rSet
, SwWrtShell
* pWrtSh
, Printer
* pPrt
, bool bInsert
) = 0;
395 virtual VclPtr
<AbstractSwLabDlg
> CreateSwLabDlg(weld::Window
* pParent
, const SfxItemSet
& rSet
,
396 SwDBManager
* pDBManager
, bool bLabel
) = 0;
398 virtual SwLabDlgMethod
GetSwLabDlgStaticMethod () =0;
400 virtual VclPtr
<SfxAbstractTabDialog
> CreateSwParaDlg(weld::Window
*pParent
,
402 const SfxItemSet
& rCoreSet
,
404 const OString
& sDefPage
= OString() ) = 0;
406 virtual VclPtr
<VclAbstractDialog
> CreateSwAutoMarkDialog(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
408 virtual VclPtr
<AbstractSwSelGlossaryDlg
> CreateSwSelGlossaryDlg(weld::Window
*pParent
, const OUString
&rShortName
) = 0;
410 virtual VclPtr
<VclAbstractDialog
> CreateSwSortingDialog(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
411 virtual VclPtr
<VclAbstractDialog
> CreateSwTableHeightDialog(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
412 virtual VclPtr
<VclAbstractDialog
> CreateSwColumnDialog(weld::Window
*pParent
, SwWrtShell
&rSh
) = 0;
413 virtual VclPtr
<AbstractSplitTableDialog
> CreateSplitTableDialog(weld::Window
* pParent
, SwWrtShell
&rSh
) = 0;
415 virtual VclPtr
<AbstractSwAutoFormatDlg
> CreateSwAutoFormatDlg(weld::Window
* pParent
, SwWrtShell
* pShell
,
416 bool bSetAutoFormat
= true,
417 const SwTableAutoFormat
* pSelFormat
= nullptr ) = 0;
418 virtual VclPtr
<SfxAbstractDialog
> CreateSwBorderDlg(weld::Window
* pParent
, SfxItemSet
& rSet
, SwBorderModes nType
) = 0;
419 virtual VclPtr
<SfxAbstractDialog
> CreateSwWrapDlg(weld::Window
* pParent
, SfxItemSet
& rSet
, SwWrtShell
* pSh
) = 0;
421 virtual VclPtr
<VclAbstractDialog
> CreateSwTableWidthDlg(weld::Window
*pParent
, SwTableFUNC
&rFnc
) = 0;
422 virtual VclPtr
<SfxAbstractTabDialog
> CreateSwTableTabDlg(weld::Window
* pParent
,
423 const SfxItemSet
* pItemSet
, SwWrtShell
* pSh
) = 0;
425 virtual VclPtr
<AbstractSwFieldDlg
> CreateSwFieldDlg(SfxBindings
* pB
, SwChildWinWrapper
* pCW
, weld::Window
*pParent
) = 0;
426 virtual VclPtr
<SfxAbstractDialog
> CreateSwFieldEditDlg ( SwView
& rVw
) = 0;
427 virtual VclPtr
<AbstractSwRenameXNamedDlg
> CreateSwRenameXNamedDlg(weld::Window
* pParent
,
428 css::uno::Reference
< css::container::XNamed
> & xNamed
,
429 css::uno::Reference
< css::container::XNameAccess
> & xNameAccess
) = 0;
430 virtual VclPtr
<AbstractSwModalRedlineAcceptDlg
> CreateSwModalRedlineAcceptDlg(weld::Window
*pParent
) = 0;
432 virtual VclPtr
<VclAbstractDialog
> CreateTableMergeDialog(weld::Window
* pParent
, bool& rWithPrev
) = 0;
433 virtual VclPtr
<SfxAbstractTabDialog
> CreateFrameTabDialog(const OUString
&rDialogType
,
434 SfxViewFrame
*pFrame
, weld::Window
*pParent
,
435 const SfxItemSet
& rCoreSet
,
436 bool bNewFrame
= true,
437 const OString
& sDefPage
= OString()) = 0;
439 /// Identifies optional Slot by which the creation of the Template (Style) dialog is triggered.
440 /// Currently used, if nRegion == SfxStyleFamily::Page in order to activate certain dialog pane
441 virtual VclPtr
<SfxAbstractApplyTabDialog
> CreateTemplateDialog(weld::Window
* pParent
,
442 SfxStyleSheetBase
& rBase
,
443 SfxStyleFamily nRegion
,
444 const OString
& sPage
,
445 SwWrtShell
* pActShell
,
447 virtual VclPtr
<AbstractGlossaryDlg
> CreateGlossaryDlg(SfxViewFrame
* pViewFrame
,
448 SwGlossaryHdl
* pGlosHdl
,
449 SwWrtShell
*pWrtShell
) = 0;
450 virtual VclPtr
<AbstractFieldInputDlg
> CreateFieldInputDlg(weld::Widget
*pParent
,
451 SwWrtShell
&rSh
, SwField
* pField
, bool bPrevButton
, bool bNextButton
) = 0;
452 virtual VclPtr
<AbstractInsFootNoteDlg
> CreateInsFootNoteDlg(weld::Window
* pParent
,
453 SwWrtShell
&rSh
, bool bEd
= false) = 0;
454 virtual VclPtr
<VclAbstractDialog
> CreateTitlePageDlg(weld::Window
* pParent
) = 0;
455 virtual VclPtr
<VclAbstractDialog
> CreateVclSwViewDialog(SwView
& rView
) = 0;
456 virtual VclPtr
<AbstractInsTableDlg
> CreateInsTableDlg(SwView
& rView
) = 0;
457 virtual VclPtr
<AbstractJavaEditDialog
> CreateJavaEditDialog(weld::Window
* pParent
,
458 SwWrtShell
* pWrtSh
) = 0;
459 virtual VclPtr
<AbstractMailMergeDlg
> CreateMailMergeDlg(
460 vcl::Window
* pParent
, SwWrtShell
& rSh
,
461 const OUString
& rSourceName
,
462 const OUString
& rTableName
,
463 sal_Int32 nCommandType
,
464 const css::uno::Reference
< css::sdbc::XConnection
>& xConnection
) = 0;
465 virtual VclPtr
<AbstractMailMergeCreateFromDlg
> CreateMailMergeCreateFromDlg(weld::Window
* pParent
) = 0;
466 virtual VclPtr
<AbstractMailMergeFieldConnectionsDlg
> CreateMailMergeFieldConnectionsDlg(weld::Window
* pParent
) = 0;
467 virtual VclPtr
<VclAbstractDialog
> CreateMultiTOXMarkDlg(weld::Window
* pParent
, SwTOXMgr
&rTOXMgr
) = 0;
468 virtual VclPtr
<SfxAbstractTabDialog
> CreateOutlineTabDialog(weld::Window
* pParent
,
469 const SfxItemSet
* pSwItemSet
,
471 virtual VclPtr
<SfxAbstractTabDialog
> CreateSvxNumBulletTabDialog(weld::Window
* pParent
,
472 const SfxItemSet
* pSwItemSet
,
474 virtual VclPtr
<AbstractMultiTOXTabDialog
> CreateMultiTOXTabDialog(
475 weld::Window
* pParent
, const SfxItemSet
& rSet
,
479 virtual VclPtr
<AbstractEditRegionDlg
> CreateEditRegionDlg(weld::Window
* pParent
, SwWrtShell
& rWrtSh
) = 0;
480 virtual VclPtr
<AbstractInsertSectionTabDialog
> CreateInsertSectionTabDialog(weld::Window
* pParent
,
481 const SfxItemSet
& rSet
, SwWrtShell
& rSh
) = 0;
482 virtual VclPtr
<AbstractMarkFloatDlg
> CreateIndexMarkFloatDlg(
483 SfxBindings
* pBindings
,
484 SfxChildWindow
* pChild
,
485 weld::Window
*pParent
,
486 SfxChildWinInfo
* pInfo
) = 0;
487 virtual VclPtr
<AbstractMarkFloatDlg
> CreateAuthMarkFloatDlg(
488 SfxBindings
* pBindings
,
489 SfxChildWindow
* pChild
,
490 weld::Window
*pParent
,
491 SfxChildWinInfo
* pInfo
) = 0;
492 virtual VclPtr
<VclAbstractDialog
> CreateIndexMarkModalDlg(
493 weld::Window
*pParent
, SwWrtShell
& rSh
, SwTOXMark
* pCurTOXMark
) = 0;
495 virtual VclPtr
<AbstractMailMergeWizard
> CreateMailMergeWizard(SwView
& rView
, std::shared_ptr
<SwMailMergeConfigItem
>& rConfigItem
) = 0;
497 virtual GlossaryGetCurrGroup
GetGlossaryCurrGroupFunc() = 0;
498 virtual GlossarySetActGroup
SetGlossaryActGroupFunc() = 0;
501 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
503 virtual void ExecuteMMResultSaveDialog(weld::Window
* pParent
) = 0;
504 virtual void ExecuteMMResultPrintDialog(weld::Window
* pParent
) = 0;
505 virtual void ExecuteMMResultEmailDialog(weld::Window
* pParent
) = 0;
508 ~SwAbstractDialogFactory() {}
513 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */