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::sun::star::sheet
{ struct DataPilotFieldReference
; }
53 class ScAsyncTabController
56 virtual ~ScAsyncTabController() = default;
57 virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext
&rCtx
) = 0;
58 virtual const SfxItemSet
* GetOutputItemSet() const = 0;
59 virtual void SetCurPageId( const OString
&rName
) = 0;
62 class AbstractScImportAsciiDlg
: public VclAbstractDialog
65 virtual ~AbstractScImportAsciiDlg() override
= default;
67 virtual void GetOptions( ScAsciiOptions
& rOpt
) = 0;
68 virtual void SaveParameters() = 0;
71 class AbstractScAutoFormatDlg
: public VclAbstractDialog
74 virtual ~AbstractScAutoFormatDlg() override
= default;
76 virtual sal_uInt16
GetIndex() const = 0 ;
77 virtual OUString
GetCurrFormatName() = 0;
80 class AbstractScColRowLabelDlg
: public VclAbstractDialog
83 virtual ~AbstractScColRowLabelDlg() override
= default;
85 virtual bool IsCol() = 0;
86 virtual bool IsRow() = 0;
89 class AbstractScCondFormatManagerDlg
: public VclAbstractDialog
92 virtual ~AbstractScCondFormatManagerDlg() override
= default;
94 virtual std::unique_ptr
<ScConditionalFormatList
> GetConditionalFormatList() = 0;
96 virtual bool CondFormatsChanged() const = 0;
98 virtual void SetModified() = 0;
100 virtual ScConditionalFormat
* GetCondFormatSelected() = 0;
103 class AbstractScDataPilotDatabaseDlg
:public VclAbstractDialog
106 virtual ~AbstractScDataPilotDatabaseDlg() override
= default;
108 virtual void GetValues( ScImportSourceDesc
& rDesc
) = 0;
111 class AbstractScDataPilotSourceTypeDlg
: public VclAbstractDialog
114 virtual ~AbstractScDataPilotSourceTypeDlg() override
= default;
116 virtual bool IsDatabase() const = 0;
117 virtual bool IsExternal() const = 0;
118 virtual bool IsNamedRange() const = 0;
119 virtual OUString
GetSelectedNamedRange() const = 0;
120 virtual void AppendNamedRange(const OUString
& rName
) = 0;
123 class AbstractScDataPilotServiceDlg
: public VclAbstractDialog
126 virtual ~AbstractScDataPilotServiceDlg() override
= default;
128 virtual OUString
GetServiceName() const = 0;
129 virtual OUString
GetParSource() const = 0 ;
130 virtual OUString
GetParName() const = 0 ;
131 virtual OUString
GetParUser() const = 0;
132 virtual OUString
GetParPass() const = 0;
135 class AbstractScDeleteCellDlg
: public VclAbstractDialog
138 virtual ~AbstractScDeleteCellDlg() override
= default;
140 virtual DelCellCmd
GetDelCellCmd() const = 0;
144 class AbstractScDataFormDlg
: public VclAbstractDialog
147 virtual ~AbstractScDataFormDlg() override
= default;
150 class AbstractScDeleteContentsDlg
: public VclAbstractDialog
153 virtual ~AbstractScDeleteContentsDlg() override
= default;
155 virtual void DisableObjects() = 0 ;
156 virtual InsertDeleteFlags
GetDelContentsCmdBits() const = 0;
159 class AbstractScFillSeriesDlg
: public VclAbstractDialog
162 virtual ~AbstractScFillSeriesDlg() override
= default;
164 virtual FillDir
GetFillDir() const = 0;
165 virtual FillCmd
GetFillCmd() const = 0;
166 virtual FillDateCmd
GetFillDateCmd() const = 0;
167 virtual double GetStart() const = 0;
168 virtual double GetStep() const = 0;
169 virtual double GetMax() const = 0;
170 virtual OUString
GetStartStr() const = 0;
171 virtual void SetEdStartValEnabled(bool bFlag
) = 0;
174 class AbstractScGroupDlg
: public VclAbstractDialog
177 virtual ~AbstractScGroupDlg() override
= default;
179 virtual bool GetColsChecked() const = 0;
182 class AbstractScInsertCellDlg
: public VclAbstractDialog
185 virtual ~AbstractScInsertCellDlg() override
= default;
187 virtual InsCellCmd
GetInsCellCmd() const = 0;
190 class AbstractScInsertContentsDlg
: public VclAbstractDialog
193 virtual ~AbstractScInsertContentsDlg() override
= default;
195 virtual InsertDeleteFlags
GetInsContentsCmdBits() const = 0;
196 virtual ScPasteFunc
GetFormulaCmdBits() const = 0 ;
197 virtual bool IsSkipEmptyCells() const = 0;
198 virtual bool IsLink() const = 0;
199 virtual void SetFillMode( bool bSet
) = 0;
200 virtual void SetOtherDoc( bool bSet
) = 0;
201 virtual bool IsTranspose() const = 0;
202 virtual void SetChangeTrack( bool bSet
) = 0;
203 virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable
) = 0;
204 virtual InsCellCmd
GetMoveMode() = 0;
207 class AbstractScInsertTableDlg
: public VclAbstractDialog
210 virtual ~AbstractScInsertTableDlg() override
= default;
212 virtual bool GetTablesFromFile() = 0;
213 virtual bool GetTablesAsLink() = 0;
214 virtual const OUString
* GetFirstTable( sal_uInt16
* pN
= nullptr ) = 0;
215 virtual ScDocShell
* GetDocShellTables() = 0;
216 virtual bool IsTableBefore() = 0;
217 virtual sal_uInt16
GetTableCount() = 0;
218 virtual const OUString
* GetNextTable( sal_uInt16
* pN
) = 0;
222 class AbstractScSelEntryDlg
: public VclAbstractDialog
225 virtual ~AbstractScSelEntryDlg() override
= default;
227 virtual OUString
GetSelectedEntry() const = 0;
230 class AbstractScLinkedAreaDlg
: public VclAbstractDialog
233 virtual ~AbstractScLinkedAreaDlg() override
= default;
235 virtual void InitFromOldLink( const OUString
& rFile
, const OUString
& rFilter
,
236 const OUString
& rOptions
, const OUString
& rSource
,
237 sal_uLong nRefresh
) = 0;
238 virtual OUString
GetURL() = 0;
239 virtual OUString
GetFilter() = 0; // may be empty
240 virtual OUString
GetOptions() = 0; // filter options
241 virtual OUString
GetSource() = 0; // separated by ";"
242 virtual sal_uLong
GetRefresh() = 0; // 0 if disabled
245 class AbstractScMetricInputDlg
: public VclAbstractDialog
248 virtual ~AbstractScMetricInputDlg() override
= default;
250 virtual int GetInputValue() const = 0;
253 class AbstractScMoveTableDlg
: public VclAbstractDialog
256 virtual ~AbstractScMoveTableDlg() override
= default;
258 virtual sal_uInt16
GetSelectedDocument () const = 0;
259 virtual sal_uInt16
GetSelectedTable () const = 0;
260 virtual bool GetCopyTable () const = 0;
261 virtual bool GetRenameTable () const = 0;
262 virtual void GetTabNameString( OUString
& rString
) const = 0;
263 virtual void SetForceCopyTable () = 0;
264 virtual void EnableRenameTable (bool bFlag
) = 0;
267 class AbstractScNameCreateDlg
: public VclAbstractDialog
// Manage Name Dialog
270 virtual ~AbstractScNameCreateDlg() override
= default;
272 virtual CreateNameFlags
GetFlags() const = 0;
275 class AbstractScNamePasteDlg
: public VclAbstractDialog
278 virtual ~AbstractScNamePasteDlg() override
= default;
280 virtual std::vector
<OUString
> GetSelectedNames() const = 0;
283 class AbstractScPivotFilterDlg
: public VclAbstractDialog
286 virtual ~AbstractScPivotFilterDlg() override
= default;
288 virtual const ScQueryItem
& GetOutputItem() = 0;
291 class AbstractScDPFunctionDlg
: public VclAbstractDialog
294 virtual ~AbstractScDPFunctionDlg() override
= default;
296 virtual PivotFunc
GetFuncMask() const = 0;
297 virtual css::sheet::DataPilotFieldReference
GetFieldRef() const = 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;
309 class AbstractScDPNumGroupDlg
: public VclAbstractDialog
312 virtual ~AbstractScDPNumGroupDlg() override
= default;
314 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
317 class AbstractScDPDateGroupDlg
: public VclAbstractDialog
320 virtual ~AbstractScDPDateGroupDlg() override
= default;
322 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
323 virtual sal_Int32
GetDatePart() const = 0;
326 class AbstractScDPShowDetailDlg
: public VclAbstractDialog
329 virtual ~AbstractScDPShowDetailDlg() override
= default;
331 virtual OUString
GetDimensionName() const = 0;
334 class AbstractScNewScenarioDlg
: public VclAbstractDialog
337 virtual ~AbstractScNewScenarioDlg() override
= default;
340 virtual void SetScenarioData( const OUString
& rName
, const OUString
& rComment
,
341 const Color
& rColor
, ScScenarioFlags nFlags
) = 0;
343 virtual void GetScenarioData( OUString
& rName
, OUString
& rComment
,
344 Color
& rColor
, ScScenarioFlags
& rFlags
) const = 0;
347 class AbstractScShowTabDlg
: public VclAbstractDialog
350 virtual ~AbstractScShowTabDlg() override
= default;
352 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
353 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rFixedText
, const OString
& nDlgHelpId
, const OString
& nLbHelpId
) = 0;
354 virtual std::vector
<sal_Int32
> GetSelectedRows() const = 0;
355 virtual OUString
GetEntry(sal_Int32 nPos
) const = 0;
358 class AbstractScSortWarningDlg
: public VclAbstractDialog
361 virtual ~AbstractScSortWarningDlg() override
= default;
364 class AbstractScStringInputDlg
: public VclAbstractDialog
367 virtual ~AbstractScStringInputDlg() override
= default;
369 virtual OUString
GetInputString() const = 0;
372 class AbstractScTabBgColorDlg
: public VclAbstractDialog
375 virtual ~AbstractScTabBgColorDlg() override
= default;
377 virtual void GetSelectedColor( Color
& rColor
) const = 0;
380 class AbstractScImportOptionsDlg
: public VclAbstractDialog
383 virtual ~AbstractScImportOptionsDlg() override
= default;
385 virtual void GetImportOptions( ScImportOptions
& rOptions
) const = 0;
386 virtual void SaveImportOptions() const = 0;
389 class AbstractScTextImportOptionsDlg
: public VclAbstractDialog
392 virtual ~AbstractScTextImportOptionsDlg() override
= default;
394 virtual LanguageType
GetLanguageType() const = 0;
395 virtual bool IsDateConversionSet() const = 0;
398 class ScAbstractDialogFactory
401 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
403 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg(weld::Window
* pParent
,
404 const OUString
& aDatName
,
406 ScImportAsciiCall eCall
) = 0;
408 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg(weld::Window
* pParent
) = 0;
410 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(weld::Window
* pParent
,
411 ScAutoFormat
* pAutoFormat
,
412 const ScAutoFormatData
* pSelFormatData
,
413 ScViewData
*pViewData
) = 0;
414 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
418 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
420 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(weld::Window
* pParent
, ScDocument
& rDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
422 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
424 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
425 bool bEnableExternal
) = 0;
427 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
428 const std::vector
<OUString
>& rServices
) = 0;
430 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
433 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(weld::Window
* pParent
, ScTabViewShell
* pTabViewShell
) = 0;
435 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
436 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
437 ScDocument
& rDocument
,
440 FillDateCmd eFillDateCmd
,
441 const OUString
& aStartStr
,
444 SCSIZE nSelectHeight
,
446 sal_uInt16 nPossDir
) = 0;
448 virtual VclPtr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
450 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
451 bool bDisallowCellMove
) = 0;
453 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
454 const OUString
* pStrTitle
= nullptr) = 0;
456 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
457 SCTAB nTabCount
, bool bFromFile
) = 0;
459 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
460 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Window
* pParent
) = 0;
462 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
463 const OString
& sDialogName
,
464 tools::Long nCurrent
,
465 tools::Long nDefault
,
467 sal_uInt16 nDecimals
,
468 tools::Long nMaximum
,
469 tools::Long nMinimum
= 0 ) = 0;
471 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
472 const OUString
& rDefault
) = 0;
474 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
475 CreateNameFlags nFlags
) = 0;
477 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg(weld::Window
* pParent
, ScDocShell
* pShell
) = 0;
479 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(weld::Window
* pParent
,
480 const SfxItemSet
& rArgSet
,
481 sal_uInt16 nSourceTab
) = 0;
483 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg(weld::Widget
* pParent
,
484 const ScDPLabelDataVector
& rLabelVec
,
485 const ScDPLabelData
& rLabelData
,
486 const ScPivotFuncData
& rFuncData
) = 0;
488 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg(weld::Widget
* pParent
,
490 const ScDPLabelData
& rLabelData
,
491 const ScPivotFuncData
& rFuncData
,
492 const ScDPNameVec
& rDataFields
) = 0;
494 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg(weld::Window
* pParent
,
495 const ScDPNumGroupInfo
& rInfo
) = 0;
497 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg(weld::Window
* pParent
,
498 const ScDPNumGroupInfo
& rInfo
,
500 const Date
& rNullDate
) = 0;
502 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
504 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
506 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg(weld::Window
* pParent
, const OUString
& rName
,
507 bool bEdit
, bool bSheetProtected
) = 0;
508 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
510 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
511 const OUString
& rTitle
,
512 const OUString
& rEditTitle
,
513 const OUString
& rDefault
,
514 const OString
& rHelpId
,
515 const OString
& rEditHelpId
) = 0;
517 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
518 const OUString
& rTitle
, //Dialog Title
519 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
520 const Color
& rDefaultColor
) = 0; //Currently selected Color
522 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg(weld::Window
* pParent
, bool bAscii
,
523 const ScImportOptions
* pOptions
,
524 const OUString
* pStrTitle
,
525 bool bOnlyDbtoolsEncodings
,
526 bool bImport
= true ) = 0;
528 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg(weld::Window
* pParent
,
529 const SfxItemSet
* pCellAttrs
) = 0;
531 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(weld::Window
* pParent
,
532 const SfxItemSet
& rCoreSet
,
533 const OUString
& rPageStyle
,
534 sal_uInt16 nResId
) = 0;
536 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg(weld::Window
* pParent
,
537 SfxStyleSheetBase
& rStyleBase
,
538 bool bPage
/*true : page, false: para*/) = 0;
540 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg(weld::Window
* pParent
,
541 const SfxItemSet
* pArgSet
) = 0;
543 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(weld::Window
* pParent
,
544 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
, bool bDrawText
) = 0;
546 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(weld::Window
* pParent
,
547 const SfxItemSet
* pAttr
) = 0;
549 virtual std::shared_ptr
<ScAsyncTabController
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
552 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
555 ~ScAbstractDialogFactory() {}
559 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */