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 .
22 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
23 #include <sfx2/tabdlg.hxx>
24 #include <tools/fldunit.hxx>
25 #include <vcl/abstdlg.hxx>
28 #include <i18nlangtag/lang.h>
29 #include <asciiopt.hxx>
32 class ScAutoFormatData
;
34 struct ScImportSourceDesc
;
37 class ScImportOptions
;
38 class SfxStyleSheetBase
;
39 class SfxAbstractTabDialog
;
41 struct ScDPNumGroupInfo
;
43 class ScConditionalFormat
;
44 class ScConditionalFormatList
;
47 enum class CreateNameFlags
;
48 enum class CellShiftDisabledFlags
;
50 namespace com::sun::star::sheet
{ struct DataPilotFieldReference
; }
52 class ScAsyncTabController
55 virtual ~ScAsyncTabController() = default;
56 virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext
&rCtx
) = 0;
57 virtual const SfxItemSet
* GetOutputItemSet() const = 0;
58 virtual void SetCurPageId( const OUString
&rName
) = 0;
61 class AbstractScImportAsciiDlg
: public VclAbstractDialog
64 virtual ~AbstractScImportAsciiDlg() override
= default;
66 virtual void GetOptions( ScAsciiOptions
& rOpt
) = 0;
67 virtual void SaveParameters() = 0;
70 class AbstractScAutoFormatDlg
: public VclAbstractDialog
73 virtual ~AbstractScAutoFormatDlg() override
= default;
75 virtual sal_uInt16
GetIndex() const = 0 ;
76 virtual OUString
GetCurrFormatName() = 0;
79 class AbstractScColRowLabelDlg
: public VclAbstractDialog
82 virtual ~AbstractScColRowLabelDlg() override
= default;
84 virtual bool IsCol() = 0;
85 virtual bool IsRow() = 0;
88 class AbstractScCondFormatManagerDlg
: public VclAbstractDialog
91 virtual ~AbstractScCondFormatManagerDlg() override
= default;
93 virtual std::unique_ptr
<ScConditionalFormatList
> GetConditionalFormatList() = 0;
95 virtual bool CondFormatsChanged() const = 0;
97 virtual void SetModified() = 0;
99 virtual ScConditionalFormat
* GetCondFormatSelected() = 0;
102 class AbstractScDataPilotDatabaseDlg
:public VclAbstractDialog
105 virtual ~AbstractScDataPilotDatabaseDlg() override
= default;
107 virtual void GetValues( ScImportSourceDesc
& rDesc
) = 0;
110 class AbstractScDataPilotSourceTypeDlg
: public VclAbstractDialog
113 virtual ~AbstractScDataPilotSourceTypeDlg() override
= default;
115 virtual bool IsDatabase() const = 0;
116 virtual bool IsExternal() const = 0;
117 virtual bool IsNamedRange() const = 0;
118 virtual OUString
GetSelectedNamedRange() const = 0;
119 virtual void AppendNamedRange(const OUString
& rName
) = 0;
122 class AbstractScDataPilotServiceDlg
: public VclAbstractDialog
125 virtual ~AbstractScDataPilotServiceDlg() override
= default;
127 virtual OUString
GetServiceName() const = 0;
128 virtual OUString
GetParSource() const = 0 ;
129 virtual OUString
GetParName() const = 0 ;
130 virtual OUString
GetParUser() const = 0;
131 virtual OUString
GetParPass() const = 0;
134 class AbstractScDeleteCellDlg
: public VclAbstractDialog
137 virtual ~AbstractScDeleteCellDlg() override
= default;
139 virtual DelCellCmd
GetDelCellCmd() const = 0;
143 class AbstractScDataFormDlg
: public VclAbstractDialog
146 virtual ~AbstractScDataFormDlg() override
= default;
149 class AbstractScDeleteContentsDlg
: public VclAbstractDialog
152 virtual ~AbstractScDeleteContentsDlg() override
= default;
154 virtual void DisableObjects() = 0 ;
155 virtual InsertDeleteFlags
GetDelContentsCmdBits() const = 0;
158 class AbstractScFillSeriesDlg
: public VclAbstractDialog
161 virtual ~AbstractScFillSeriesDlg() override
= default;
163 virtual FillDir
GetFillDir() const = 0;
164 virtual FillCmd
GetFillCmd() const = 0;
165 virtual FillDateCmd
GetFillDateCmd() const = 0;
166 virtual double GetStart() const = 0;
167 virtual double GetStep() const = 0;
168 virtual double GetMax() const = 0;
169 virtual OUString
GetStartStr() const = 0;
170 virtual void SetEdStartValEnabled(bool bFlag
) = 0;
173 class AbstractScGroupDlg
: public VclAbstractDialog
176 virtual ~AbstractScGroupDlg() override
= default;
178 virtual bool GetColsChecked() const = 0;
181 class AbstractScInsertCellDlg
: public VclAbstractDialog
184 virtual ~AbstractScInsertCellDlg() override
= default;
186 virtual InsCellCmd
GetInsCellCmd() const = 0;
189 class AbstractScInsertContentsDlg
: public VclAbstractDialog
192 virtual ~AbstractScInsertContentsDlg() override
= default;
194 virtual InsertDeleteFlags
GetInsContentsCmdBits() const = 0;
195 virtual ScPasteFunc
GetFormulaCmdBits() const = 0 ;
196 virtual bool IsSkipEmptyCells() const = 0;
197 virtual bool IsLink() const = 0;
198 virtual void SetFillMode( bool bSet
) = 0;
199 virtual void SetOtherDoc( bool bSet
) = 0;
200 virtual bool IsTranspose() const = 0;
201 virtual void SetChangeTrack( bool bSet
) = 0;
202 virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable
) = 0;
203 virtual InsCellCmd
GetMoveMode() = 0;
206 class AbstractScInsertTableDlg
: public VclAbstractDialog
209 virtual ~AbstractScInsertTableDlg() override
= default;
211 virtual bool GetTablesFromFile() = 0;
212 virtual bool GetTablesAsLink() = 0;
213 virtual const OUString
* GetFirstTable( sal_uInt16
* pN
= nullptr ) = 0;
214 virtual ScDocShell
* GetDocShellTables() = 0;
215 virtual bool IsTableBefore() = 0;
216 virtual sal_uInt16
GetTableCount() = 0;
217 virtual const OUString
* GetNextTable( sal_uInt16
* pN
) = 0;
221 class AbstractScSelEntryDlg
: public VclAbstractDialog
224 virtual ~AbstractScSelEntryDlg() override
= default;
226 virtual OUString
GetSelectedEntry() const = 0;
229 class AbstractScLinkedAreaDlg
: public VclAbstractDialog
232 virtual ~AbstractScLinkedAreaDlg() override
= default;
234 virtual void InitFromOldLink( const OUString
& rFile
, const OUString
& rFilter
,
235 const OUString
& rOptions
, const OUString
& rSource
,
236 sal_Int32 nRefreshDelaySeconds
) = 0;
237 virtual OUString
GetURL() = 0;
238 virtual OUString
GetFilter() = 0; // may be empty
239 virtual OUString
GetOptions() = 0; // filter options
240 virtual OUString
GetSource() = 0; // separated by ";"
241 virtual sal_Int32
GetRefreshDelaySeconds() = 0; // 0 if disabled
244 class AbstractScMetricInputDlg
: public VclAbstractDialog
247 virtual ~AbstractScMetricInputDlg() override
= default;
249 virtual int GetInputValue() const = 0;
252 class AbstractScMoveTableDlg
: public VclAbstractDialog
255 virtual ~AbstractScMoveTableDlg() override
= default;
257 virtual sal_uInt16
GetSelectedDocument () const = 0;
258 virtual sal_uInt16
GetSelectedTable () const = 0;
259 virtual bool GetCopyTable () const = 0;
260 virtual bool GetRenameTable () const = 0;
261 virtual void GetTabNameString( OUString
& rString
) const = 0;
262 virtual void SetForceCopyTable () = 0;
263 virtual void EnableRenameTable (bool bFlag
) = 0;
266 class AbstractScNameCreateDlg
: public VclAbstractDialog
// Manage Name Dialog
269 virtual ~AbstractScNameCreateDlg() override
= default;
271 virtual CreateNameFlags
GetFlags() const = 0;
274 class AbstractScNamePasteDlg
: public VclAbstractDialog
277 virtual ~AbstractScNamePasteDlg() override
= default;
279 virtual std::vector
<OUString
> GetSelectedNames() const = 0;
282 class AbstractScPivotFilterDlg
: public VclAbstractDialog
285 virtual ~AbstractScPivotFilterDlg() override
= default;
287 virtual const ScQueryItem
& GetOutputItem() = 0;
290 class AbstractScDPFunctionDlg
: public VclAbstractDialog
293 virtual ~AbstractScDPFunctionDlg() override
= default;
295 virtual PivotFunc
GetFuncMask() const = 0;
296 virtual css::sheet::DataPilotFieldReference
GetFieldRef() const = 0;
297 virtual void Response(int nResponse
) = 0;
300 class AbstractScDPSubtotalDlg
: public VclAbstractDialog
303 virtual ~AbstractScDPSubtotalDlg() override
= default;
305 virtual PivotFunc
GetFuncMask() const = 0;
306 virtual void FillLabelData( ScDPLabelData
& rLabelData
) const = 0;
307 virtual void Response(int nResponse
) = 0;
310 class AbstractScDPNumGroupDlg
: public VclAbstractDialog
313 virtual ~AbstractScDPNumGroupDlg() override
= default;
315 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
318 class AbstractScDPDateGroupDlg
: public VclAbstractDialog
321 virtual ~AbstractScDPDateGroupDlg() override
= default;
323 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
324 virtual sal_Int32
GetDatePart() const = 0;
327 class AbstractScDPShowDetailDlg
: public VclAbstractDialog
330 virtual ~AbstractScDPShowDetailDlg() override
= default;
332 virtual OUString
GetDimensionName() const = 0;
335 class AbstractScNewScenarioDlg
: public VclAbstractDialog
338 virtual ~AbstractScNewScenarioDlg() override
= default;
341 virtual void SetScenarioData( const OUString
& rName
, const OUString
& rComment
,
342 const Color
& rColor
, ScScenarioFlags nFlags
) = 0;
344 virtual void GetScenarioData( OUString
& rName
, OUString
& rComment
,
345 Color
& rColor
, ScScenarioFlags
& rFlags
) const = 0;
348 class AbstractScShowTabDlg
: public VclAbstractDialog
351 virtual ~AbstractScShowTabDlg() override
= default;
353 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
354 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rFixedText
, const OUString
& nDlgHelpId
, const OUString
& nLbHelpId
) = 0;
355 virtual std::vector
<sal_Int32
> GetSelectedRows() const = 0;
356 virtual OUString
GetEntry(sal_Int32 nPos
) const = 0;
359 class AbstractScSortWarningDlg
: public VclAbstractDialog
362 virtual ~AbstractScSortWarningDlg() override
= default;
365 class AbstractScStringInputDlg
: public VclAbstractDialog
368 virtual ~AbstractScStringInputDlg() override
= default;
370 virtual OUString
GetInputString() const = 0;
373 class AbstractScTabBgColorDlg
: public VclAbstractDialog
376 virtual ~AbstractScTabBgColorDlg() override
= default;
378 virtual void GetSelectedColor( Color
& rColor
) const = 0;
381 class AbstractScImportOptionsDlg
: public VclAbstractDialog
384 virtual ~AbstractScImportOptionsDlg() override
= default;
386 virtual void GetImportOptions( ScImportOptions
& rOptions
) const = 0;
387 virtual void SaveImportOptions() const = 0;
390 class AbstractScTextImportOptionsDlg
: public VclAbstractDialog
393 virtual ~AbstractScTextImportOptionsDlg() override
= default;
395 virtual LanguageType
GetLanguageType() const = 0;
396 virtual bool IsDateConversionSet() const = 0;
397 virtual bool IsScientificConversionSet() const = 0;
398 virtual bool IsKeepAskingSet() const = 0;
401 class AbstractScGoToTabDlg
: public VclAbstractDialog
404 virtual ~AbstractScGoToTabDlg() override
= default;
406 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
407 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rEntryLabel
, const OUString
& rListLabel
,
408 const OUString
& rDlgHelpId
, const OUString
& rEnHelpId
, const OUString
& rLbHelpId
) = 0;
409 virtual OUString
GetSelectedEntry() const = 0;
412 class ScAbstractDialogFactory
415 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
417 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg(weld::Window
* pParent
,
418 const OUString
& aDatName
,
420 ScImportAsciiCall eCall
) = 0;
422 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg(weld::Window
* pParent
) = 0;
424 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(weld::Window
* pParent
,
425 ScAutoFormat
* pAutoFormat
,
426 const ScAutoFormatData
* pSelFormatData
,
427 ScViewData
& rViewData
) = 0;
428 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
432 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
434 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(weld::Window
* pParent
, ScDocument
& rDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
436 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
438 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
439 bool bEnableExternal
) = 0;
441 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
442 const std::vector
<OUString
>& rServices
) = 0;
444 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
447 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(weld::Window
* pParent
, ScTabViewShell
* pTabViewShell
) = 0;
449 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
450 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
451 ScDocument
& rDocument
,
454 FillDateCmd eFillDateCmd
,
455 const OUString
& aStartStr
,
458 SCSIZE nSelectHeight
,
460 sal_uInt16 nPossDir
) = 0;
462 virtual VclPtr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
464 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
465 bool bDisallowCellMove
) = 0;
467 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
468 const OUString
* pStrTitle
= nullptr) = 0;
470 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
471 SCTAB nTabCount
, bool bFromFile
) = 0;
473 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
474 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Widget
* pParent
) = 0;
476 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
477 const OUString
& sDialogName
,
478 tools::Long nCurrent
,
479 tools::Long nDefault
,
481 sal_uInt16 nDecimals
,
482 tools::Long nMaximum
,
483 tools::Long nMinimum
= 0 ) = 0;
485 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
486 const OUString
& rDefault
) = 0;
488 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
489 CreateNameFlags nFlags
) = 0;
491 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg(weld::Window
* pParent
, ScDocShell
* pShell
) = 0;
493 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(weld::Window
* pParent
,
494 const SfxItemSet
& rArgSet
,
495 sal_uInt16 nSourceTab
) = 0;
497 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg(weld::Widget
* pParent
,
498 const ScDPLabelDataVector
& rLabelVec
,
499 const ScDPLabelData
& rLabelData
,
500 const ScPivotFuncData
& rFuncData
) = 0;
502 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg(weld::Widget
* pParent
,
504 const ScDPLabelData
& rLabelData
,
505 const ScPivotFuncData
& rFuncData
,
506 const ScDPNameVec
& rDataFields
) = 0;
508 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg(weld::Window
* pParent
,
509 const ScDPNumGroupInfo
& rInfo
) = 0;
511 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg(weld::Window
* pParent
,
512 const ScDPNumGroupInfo
& rInfo
,
514 const Date
& rNullDate
) = 0;
516 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
518 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
520 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg(weld::Window
* pParent
, const OUString
& rName
,
521 bool bEdit
, bool bSheetProtected
) = 0;
522 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
524 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
525 const OUString
& rTitle
,
526 const OUString
& rEditTitle
,
527 const OUString
& rDefault
,
528 const OUString
& rHelpId
,
529 const OUString
& rEditHelpId
) = 0;
531 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
532 const OUString
& rTitle
, //Dialog Title
533 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
534 const Color
& rDefaultColor
) = 0; //Currently selected Color
536 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg(weld::Window
* pParent
, bool bAscii
,
537 const ScImportOptions
* pOptions
,
538 const OUString
* pStrTitle
,
539 bool bOnlyDbtoolsEncodings
,
540 bool bImport
= true ) = 0;
542 virtual VclPtr
<AbstractScGoToTabDlg
> CreateScGoToTabDlg(weld::Window
* pParent
) = 0;
544 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg(weld::Window
* pParent
,
545 const SfxItemSet
* pCellAttrs
) = 0;
547 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(weld::Window
* pParent
,
548 const SfxItemSet
& rCoreSet
,
549 const OUString
& rPageStyle
,
550 sal_uInt16 nResId
) = 0;
552 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg(weld::Window
* pParent
,
553 SfxStyleSheetBase
& rStyleBase
,
554 bool bPage
/*true : page, false: para*/) = 0;
556 virtual VclPtr
<SfxAbstractTabDialog
> CreateScDrawStyleDlg(weld::Window
* pParent
,
557 SfxStyleSheetBase
& rStyleBase
,
560 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg(weld::Window
* pParent
,
561 const SfxItemSet
& rArgSet
) = 0;
563 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(weld::Window
* pParent
,
564 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
, bool bDrawText
) = 0;
566 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(weld::Window
* pParent
,
567 const SfxItemSet
* pAttr
) = 0;
569 virtual std::shared_ptr
<ScAsyncTabController
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
572 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
575 ~ScAbstractDialogFactory() {}
578 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */