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 <tools/solar.h>
23 #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
24 #include <sfx2/tabdlg.hxx>
25 #include <tools/fldunit.hxx>
26 #include <vcl/abstdlg.hxx>
29 #include <i18nlangtag/lang.h>
30 #include <asciiopt.hxx>
33 class ScAutoFormatData
;
35 struct ScImportSourceDesc
;
38 class ScImportOptions
;
39 class SfxStyleSheetBase
;
40 class SfxAbstractTabDialog
;
42 struct ScDPNumGroupInfo
;
44 class ScConditionalFormat
;
45 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 OString
&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_uLong nRefresh
) = 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_uLong
GetRefresh() = 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 OString
& nDlgHelpId
, const OString
& 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 IsKeepAskingSet() const = 0;
400 class ScAbstractDialogFactory
403 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
405 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg(weld::Window
* pParent
,
406 const OUString
& aDatName
,
408 ScImportAsciiCall eCall
) = 0;
410 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg(weld::Window
* pParent
) = 0;
412 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(weld::Window
* pParent
,
413 ScAutoFormat
* pAutoFormat
,
414 const ScAutoFormatData
* pSelFormatData
,
415 ScViewData
& rViewData
) = 0;
416 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
420 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
422 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(weld::Window
* pParent
, ScDocument
& rDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
424 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
426 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
427 bool bEnableExternal
) = 0;
429 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
430 const std::vector
<OUString
>& rServices
) = 0;
432 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
435 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(weld::Window
* pParent
, ScTabViewShell
* pTabViewShell
) = 0;
437 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
438 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
439 ScDocument
& rDocument
,
442 FillDateCmd eFillDateCmd
,
443 const OUString
& aStartStr
,
446 SCSIZE nSelectHeight
,
448 sal_uInt16 nPossDir
) = 0;
450 virtual VclPtr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
452 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
453 bool bDisallowCellMove
) = 0;
455 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
456 const OUString
* pStrTitle
= nullptr) = 0;
458 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
459 SCTAB nTabCount
, bool bFromFile
) = 0;
461 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
462 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Widget
* pParent
) = 0;
464 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
465 const OString
& sDialogName
,
466 tools::Long nCurrent
,
467 tools::Long nDefault
,
469 sal_uInt16 nDecimals
,
470 tools::Long nMaximum
,
471 tools::Long nMinimum
= 0 ) = 0;
473 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
474 const OUString
& rDefault
) = 0;
476 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
477 CreateNameFlags nFlags
) = 0;
479 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg(weld::Window
* pParent
, ScDocShell
* pShell
) = 0;
481 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(weld::Window
* pParent
,
482 const SfxItemSet
& rArgSet
,
483 sal_uInt16 nSourceTab
) = 0;
485 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg(weld::Widget
* pParent
,
486 const ScDPLabelDataVector
& rLabelVec
,
487 const ScDPLabelData
& rLabelData
,
488 const ScPivotFuncData
& rFuncData
) = 0;
490 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg(weld::Widget
* pParent
,
492 const ScDPLabelData
& rLabelData
,
493 const ScPivotFuncData
& rFuncData
,
494 const ScDPNameVec
& rDataFields
) = 0;
496 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg(weld::Window
* pParent
,
497 const ScDPNumGroupInfo
& rInfo
) = 0;
499 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg(weld::Window
* pParent
,
500 const ScDPNumGroupInfo
& rInfo
,
502 const Date
& rNullDate
) = 0;
504 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
506 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
508 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg(weld::Window
* pParent
, const OUString
& rName
,
509 bool bEdit
, bool bSheetProtected
) = 0;
510 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
512 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
513 const OUString
& rTitle
,
514 const OUString
& rEditTitle
,
515 const OUString
& rDefault
,
516 const OString
& rHelpId
,
517 const OString
& rEditHelpId
) = 0;
519 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
520 const OUString
& rTitle
, //Dialog Title
521 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
522 const Color
& rDefaultColor
) = 0; //Currently selected Color
524 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg(weld::Window
* pParent
, bool bAscii
,
525 const ScImportOptions
* pOptions
,
526 const OUString
* pStrTitle
,
527 bool bOnlyDbtoolsEncodings
,
528 bool bImport
= true ) = 0;
530 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg(weld::Window
* pParent
,
531 const SfxItemSet
* pCellAttrs
) = 0;
533 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(weld::Window
* pParent
,
534 const SfxItemSet
& rCoreSet
,
535 const OUString
& rPageStyle
,
536 sal_uInt16 nResId
) = 0;
538 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg(weld::Window
* pParent
,
539 SfxStyleSheetBase
& rStyleBase
,
540 bool bPage
/*true : page, false: para*/) = 0;
542 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg(weld::Window
* pParent
,
543 const SfxItemSet
& rArgSet
) = 0;
545 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(weld::Window
* pParent
,
546 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
, bool bDrawText
) = 0;
548 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(weld::Window
* pParent
,
549 const SfxItemSet
* pAttr
) = 0;
551 virtual std::shared_ptr
<ScAsyncTabController
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
554 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
557 ~ScAbstractDialogFactory() {}
560 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */