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 .
20 #ifndef INCLUDED_SC_INC_SCABSTDLG_HXX
21 #define INCLUDED_SC_INC_SCABSTDLG_HXX
23 #include <tools/solar.h>
24 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
25 #include <sfx2/tabdlg.hxx>
26 #include <tools/fldunit.hxx>
27 #include <vcl/abstdlg.hxx>
30 #include <i18nlangtag/lang.h>
31 #include <asciiopt.hxx>
34 class ScAutoFormatData
;
36 struct ScImportSourceDesc
;
39 class ScImportOptions
;
40 class SfxStyleSheetBase
;
41 class SfxAbstractTabDialog
;
43 struct ScDPNumGroupInfo
;
45 class ScConditionalFormat
;
46 class ScConditionalFormatList
;
48 enum class CreateNameFlags
;
49 enum class CellShiftDisabledFlags
;
51 namespace com
{ namespace sun
{ namespace star
{ namespace sheet
{
52 struct DataPilotFieldReference
;
55 class ScAsyncTabController
58 virtual ~ScAsyncTabController() = default;
59 virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext
&rCtx
) = 0;
60 virtual const SfxItemSet
* GetOutputItemSet() const = 0;
61 virtual void SetCurPageId( const OString
&rName
) = 0;
64 class AbstractScImportAsciiDlg
: public VclAbstractDialog
67 virtual ~AbstractScImportAsciiDlg() override
= default;
69 virtual void GetOptions( ScAsciiOptions
& rOpt
) = 0;
70 virtual void SaveParameters() = 0;
73 class AbstractScAutoFormatDlg
: public VclAbstractDialog
76 virtual ~AbstractScAutoFormatDlg() override
= default;
78 virtual sal_uInt16
GetIndex() const = 0 ;
79 virtual OUString
GetCurrFormatName() = 0;
82 class AbstractScColRowLabelDlg
: public VclAbstractDialog
85 virtual ~AbstractScColRowLabelDlg() override
= default;
87 virtual bool IsCol() = 0;
88 virtual bool IsRow() = 0;
91 class AbstractScCondFormatManagerDlg
: public VclAbstractDialog
94 virtual ~AbstractScCondFormatManagerDlg() override
= default;
96 virtual std::unique_ptr
<ScConditionalFormatList
> GetConditionalFormatList() = 0;
98 virtual bool CondFormatsChanged() const = 0;
100 virtual void SetModified() = 0;
102 virtual ScConditionalFormat
* GetCondFormatSelected() = 0;
105 class AbstractScDataPilotDatabaseDlg
:public VclAbstractDialog
108 virtual ~AbstractScDataPilotDatabaseDlg() override
= default;
110 virtual void GetValues( ScImportSourceDesc
& rDesc
) = 0;
113 class AbstractScDataPilotSourceTypeDlg
: public VclAbstractDialog
116 virtual ~AbstractScDataPilotSourceTypeDlg() override
= default;
118 virtual bool IsDatabase() const = 0;
119 virtual bool IsExternal() const = 0;
120 virtual bool IsNamedRange() const = 0;
121 virtual OUString
GetSelectedNamedRange() const = 0;
122 virtual void AppendNamedRange(const OUString
& rName
) = 0;
125 class AbstractScDataPilotServiceDlg
: public VclAbstractDialog
128 virtual ~AbstractScDataPilotServiceDlg() override
= default;
130 virtual OUString
GetServiceName() const = 0;
131 virtual OUString
GetParSource() const = 0 ;
132 virtual OUString
GetParName() const = 0 ;
133 virtual OUString
GetParUser() const = 0;
134 virtual OUString
GetParPass() const = 0;
137 class AbstractScDeleteCellDlg
: public VclAbstractDialog
140 virtual ~AbstractScDeleteCellDlg() override
= default;
142 virtual DelCellCmd
GetDelCellCmd() const = 0;
146 class AbstractScDataFormDlg
: public VclAbstractDialog
149 virtual ~AbstractScDataFormDlg() override
= default;
152 class AbstractScDeleteContentsDlg
: public VclAbstractDialog
155 virtual ~AbstractScDeleteContentsDlg() override
= default;
157 virtual void DisableObjects() = 0 ;
158 virtual InsertDeleteFlags
GetDelContentsCmdBits() const = 0;
161 class AbstractScFillSeriesDlg
: public VclAbstractDialog
164 virtual ~AbstractScFillSeriesDlg() override
= default;
166 virtual FillDir
GetFillDir() const = 0;
167 virtual FillCmd
GetFillCmd() const = 0;
168 virtual FillDateCmd
GetFillDateCmd() const = 0;
169 virtual double GetStart() const = 0;
170 virtual double GetStep() const = 0;
171 virtual double GetMax() const = 0;
172 virtual OUString
GetStartStr() const = 0;
173 virtual void SetEdStartValEnabled(bool bFlag
) = 0;
176 class AbstractScGroupDlg
179 virtual ~AbstractScGroupDlg() = default;
181 virtual bool GetColsChecked() const = 0;
182 virtual std::shared_ptr
<weld::DialogController
> getDialogController() = 0;
185 class AbstractScInsertCellDlg
: public VclAbstractDialog
188 virtual ~AbstractScInsertCellDlg() override
= default;
190 virtual InsCellCmd
GetInsCellCmd() const = 0;
193 class AbstractScInsertContentsDlg
: public VclAbstractDialog
196 virtual ~AbstractScInsertContentsDlg() override
= default;
198 virtual InsertDeleteFlags
GetInsContentsCmdBits() const = 0;
199 virtual ScPasteFunc
GetFormulaCmdBits() const = 0 ;
200 virtual bool IsSkipEmptyCells() const = 0;
201 virtual bool IsLink() const = 0;
202 virtual void SetFillMode( bool bSet
) = 0;
203 virtual void SetOtherDoc( bool bSet
) = 0;
204 virtual bool IsTranspose() const = 0;
205 virtual void SetChangeTrack( bool bSet
) = 0;
206 virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable
) = 0;
207 virtual InsCellCmd
GetMoveMode() = 0;
210 class AbstractScInsertTableDlg
: public VclAbstractDialog
213 virtual ~AbstractScInsertTableDlg() override
= default;
215 virtual bool GetTablesFromFile() = 0;
216 virtual bool GetTablesAsLink() = 0;
217 virtual const OUString
* GetFirstTable( sal_uInt16
* pN
= nullptr ) = 0;
218 virtual ScDocShell
* GetDocShellTables() = 0;
219 virtual bool IsTableBefore() = 0;
220 virtual sal_uInt16
GetTableCount() = 0;
221 virtual const OUString
* GetNextTable( sal_uInt16
* pN
) = 0;
225 class AbstractScSelEntryDlg
: public VclAbstractDialog
228 virtual ~AbstractScSelEntryDlg() override
= default;
230 virtual OUString
GetSelectedEntry() const = 0;
233 class AbstractScLinkedAreaDlg
: public VclAbstractDialog
236 virtual ~AbstractScLinkedAreaDlg() override
= default;
238 virtual void InitFromOldLink( const OUString
& rFile
, const OUString
& rFilter
,
239 const OUString
& rOptions
, const OUString
& rSource
,
240 sal_uLong nRefresh
) = 0;
241 virtual OUString
GetURL() = 0;
242 virtual OUString
GetFilter() = 0; // may be empty
243 virtual OUString
GetOptions() = 0; // filter options
244 virtual OUString
GetSource() = 0; // separated by ";"
245 virtual sal_uLong
GetRefresh() = 0; // 0 if disabled
248 class AbstractScMetricInputDlg
: public VclAbstractDialog
251 virtual ~AbstractScMetricInputDlg() override
= default;
253 virtual int GetInputValue() const = 0;
256 class AbstractScMoveTableDlg
: public VclAbstractDialog
259 virtual ~AbstractScMoveTableDlg() override
= default;
261 virtual sal_uInt16
GetSelectedDocument () const = 0;
262 virtual sal_uInt16
GetSelectedTable () const = 0;
263 virtual bool GetCopyTable () const = 0;
264 virtual bool GetRenameTable () const = 0;
265 virtual void GetTabNameString( OUString
& rString
) const = 0;
266 virtual void SetForceCopyTable () = 0;
267 virtual void EnableRenameTable (bool bFlag
) = 0;
270 class AbstractScNameCreateDlg
: public VclAbstractDialog
// Manage Name Dialog
273 virtual ~AbstractScNameCreateDlg() override
= default;
275 virtual CreateNameFlags
GetFlags() const = 0;
278 class AbstractScNamePasteDlg
: public VclAbstractDialog
281 virtual ~AbstractScNamePasteDlg() override
= default;
283 virtual std::vector
<OUString
> GetSelectedNames() const = 0;
286 class AbstractScPivotFilterDlg
: public VclAbstractDialog
289 virtual ~AbstractScPivotFilterDlg() override
= default;
291 virtual const ScQueryItem
& GetOutputItem() = 0;
294 class AbstractScDPFunctionDlg
: public VclAbstractDialog
297 virtual ~AbstractScDPFunctionDlg() override
= default;
299 virtual PivotFunc
GetFuncMask() const = 0;
300 virtual css::sheet::DataPilotFieldReference
GetFieldRef() const = 0;
303 class AbstractScDPSubtotalDlg
: public VclAbstractDialog
306 virtual ~AbstractScDPSubtotalDlg() override
= default;
308 virtual PivotFunc
GetFuncMask() const = 0;
309 virtual void FillLabelData( ScDPLabelData
& rLabelData
) const = 0;
312 class AbstractScDPNumGroupDlg
: public VclAbstractDialog
315 virtual ~AbstractScDPNumGroupDlg() override
= default;
317 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
320 class AbstractScDPDateGroupDlg
: public VclAbstractDialog
323 virtual ~AbstractScDPDateGroupDlg() override
= default;
325 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
326 virtual sal_Int32
GetDatePart() const = 0;
329 class AbstractScDPShowDetailDlg
: public VclAbstractDialog
332 virtual ~AbstractScDPShowDetailDlg() override
= default;
334 virtual OUString
GetDimensionName() const = 0;
337 class AbstractScNewScenarioDlg
: public VclAbstractDialog
340 virtual ~AbstractScNewScenarioDlg() override
= default;
343 virtual void SetScenarioData( const OUString
& rName
, const OUString
& rComment
,
344 const Color
& rColor
, ScScenarioFlags nFlags
) = 0;
346 virtual void GetScenarioData( OUString
& rName
, OUString
& rComment
,
347 Color
& rColor
, ScScenarioFlags
& rFlags
) const = 0;
350 class AbstractScShowTabDlg
: public VclAbstractDialog
353 virtual ~AbstractScShowTabDlg() override
= default;
355 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
356 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rFixedText
, const OString
& nDlgHelpId
, const OString
& nLbHelpId
) = 0;
357 virtual std::vector
<sal_Int32
> GetSelectedRows() const = 0;
358 virtual OUString
GetEntry(sal_Int32 nPos
) const = 0;
361 class AbstractScSortWarningDlg
: public VclAbstractDialog
364 virtual ~AbstractScSortWarningDlg() override
= default;
367 class AbstractScStringInputDlg
: public VclAbstractDialog
370 virtual ~AbstractScStringInputDlg() override
= default;
372 virtual OUString
GetInputString() const = 0;
375 class AbstractScTabBgColorDlg
: public VclAbstractDialog
378 virtual ~AbstractScTabBgColorDlg() override
= default;
380 virtual void GetSelectedColor( Color
& rColor
) const = 0;
383 class AbstractScImportOptionsDlg
: public VclAbstractDialog
386 virtual ~AbstractScImportOptionsDlg() override
= default;
388 virtual void GetImportOptions( ScImportOptions
& rOptions
) const = 0;
389 virtual void SaveImportOptions() const = 0;
392 class AbstractScTextImportOptionsDlg
: public VclAbstractDialog
395 virtual ~AbstractScTextImportOptionsDlg() override
= default;
397 virtual LanguageType
GetLanguageType() const = 0;
398 virtual bool IsDateConversionSet() const = 0;
401 class ScAbstractDialogFactory
404 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
406 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg(weld::Window
* pParent
,
407 const OUString
& aDatName
,
409 ScImportAsciiCall eCall
) = 0;
411 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg(weld::Window
* pParent
) = 0;
413 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(weld::Window
* pParent
,
414 ScAutoFormat
* pAutoFormat
,
415 const ScAutoFormatData
* pSelFormatData
,
416 ScViewData
*pViewData
) = 0;
417 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
421 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
423 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(weld::Window
* pParent
, ScDocument
* pDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
425 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
427 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
428 bool bEnableExternal
) = 0;
430 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
431 const std::vector
<OUString
>& rServices
) = 0;
433 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
436 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(weld::Window
* pParent
, ScTabViewShell
* pTabViewShell
) = 0;
438 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
439 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
440 ScDocument
& rDocument
,
443 FillDateCmd eFillDateCmd
,
444 const OUString
& aStartStr
,
447 sal_uInt16 nPossDir
) = 0;
449 virtual std::shared_ptr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
451 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
452 bool bDisallowCellMove
) = 0;
454 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
455 const OUString
* pStrTitle
= nullptr) = 0;
457 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
458 SCTAB nTabCount
, bool bFromFile
) = 0;
460 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
461 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Window
* pParent
) = 0;
463 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
464 const OString
& sDialogName
,
468 sal_uInt16 nDecimals
,
470 long nMinimum
= 0 ) = 0;
472 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
473 const OUString
& rDefault
) = 0;
475 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
476 CreateNameFlags nFlags
) = 0;
478 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg(weld::Window
* pParent
, ScDocShell
* pShell
) = 0;
480 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(weld::Window
* pParent
,
481 const SfxItemSet
& rArgSet
,
482 sal_uInt16 nSourceTab
) = 0;
484 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg(weld::Widget
* pParent
,
485 const ScDPLabelDataVector
& rLabelVec
,
486 const ScDPLabelData
& rLabelData
,
487 const ScPivotFuncData
& rFuncData
) = 0;
489 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg(weld::Widget
* pParent
,
491 const ScDPLabelData
& rLabelData
,
492 const ScPivotFuncData
& rFuncData
,
493 const ScDPNameVec
& rDataFields
) = 0;
495 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg(weld::Window
* pParent
,
496 const ScDPNumGroupInfo
& rInfo
) = 0;
498 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg(weld::Window
* pParent
,
499 const ScDPNumGroupInfo
& rInfo
,
501 const Date
& rNullDate
) = 0;
503 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
505 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
507 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg(weld::Window
* pParent
, const OUString
& rName
,
508 bool bEdit
, bool bSheetProtected
) = 0;
509 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
511 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
512 const OUString
& rTitle
,
513 const OUString
& rEditTitle
,
514 const OUString
& rDefault
,
515 const OString
& rHelpId
,
516 const OString
& rEditHelpId
) = 0;
518 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
519 const OUString
& rTitle
, //Dialog Title
520 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
521 const Color
& rDefaultColor
) = 0; //Currently selected Color
523 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg(weld::Window
* pParent
, bool bAscii
,
524 const ScImportOptions
* pOptions
,
525 const OUString
* pStrTitle
,
526 bool bOnlyDbtoolsEncodings
,
527 bool bImport
= true ) = 0;
529 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg(weld::Window
* pParent
,
530 const SfxItemSet
* pCellAttrs
) = 0;
532 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(weld::Window
* pParent
,
533 const SfxItemSet
& rCoreSet
,
534 const OUString
& rPageStyle
,
535 sal_uInt16 nResId
) = 0;
537 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg(weld::Window
* pParent
,
538 SfxStyleSheetBase
& rStyleBase
,
539 bool bPage
/*true : page, false: para*/) = 0;
541 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg(weld::Window
* pParent
,
542 const SfxItemSet
* pArgSet
) = 0;
544 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(weld::Window
* pParent
,
545 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
) = 0;
547 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(weld::Window
* pParent
,
548 const SfxItemSet
* pAttr
) = 0;
550 virtual std::shared_ptr
<ScAsyncTabController
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
553 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
556 ~ScAbstractDialogFactory() {}
560 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */