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;
187 virtual size_t GetCount() 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_Int32 nRefreshDelaySeconds
) = 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_Int32
GetRefreshDelaySeconds() = 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;
298 virtual void Response(int nResponse
) = 0;
301 class AbstractScDPSubtotalDlg
: public VclAbstractDialog
304 virtual ~AbstractScDPSubtotalDlg() override
= default;
306 virtual PivotFunc
GetFuncMask() const = 0;
307 virtual void FillLabelData( ScDPLabelData
& rLabelData
) const = 0;
308 virtual void Response(int nResponse
) = 0;
311 class AbstractScDPNumGroupDlg
: public VclAbstractDialog
314 virtual ~AbstractScDPNumGroupDlg() override
= default;
316 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
319 class AbstractScDPDateGroupDlg
: public VclAbstractDialog
322 virtual ~AbstractScDPDateGroupDlg() override
= default;
324 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
325 virtual sal_Int32
GetDatePart() const = 0;
328 class AbstractScDPShowDetailDlg
: public VclAbstractDialog
331 virtual ~AbstractScDPShowDetailDlg() override
= default;
333 virtual OUString
GetDimensionName() const = 0;
336 class AbstractScNewScenarioDlg
: public VclAbstractDialog
339 virtual ~AbstractScNewScenarioDlg() override
= default;
342 virtual void SetScenarioData( const OUString
& rName
, const OUString
& rComment
,
343 const Color
& rColor
, ScScenarioFlags nFlags
) = 0;
345 virtual void GetScenarioData( OUString
& rName
, OUString
& rComment
,
346 Color
& rColor
, ScScenarioFlags
& rFlags
) const = 0;
349 class AbstractScShowTabDlg
: public VclAbstractDialog
352 virtual ~AbstractScShowTabDlg() override
= default;
354 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
355 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rFixedText
, const OUString
& nDlgHelpId
, const OUString
& nLbHelpId
) = 0;
356 virtual std::vector
<sal_Int32
> GetSelectedRows() const = 0;
357 virtual OUString
GetEntry(sal_Int32 nPos
) const = 0;
360 class AbstractScSortWarningDlg
: public VclAbstractDialog
363 virtual ~AbstractScSortWarningDlg() override
= default;
366 class AbstractScStringInputDlg
: public VclAbstractDialog
369 virtual ~AbstractScStringInputDlg() override
= default;
371 virtual OUString
GetInputString() const = 0;
374 class AbstractScTabBgColorDlg
: public VclAbstractDialog
377 virtual ~AbstractScTabBgColorDlg() override
= default;
379 virtual void GetSelectedColor( Color
& rColor
) const = 0;
382 class AbstractScImportOptionsDlg
: public VclAbstractDialog
385 virtual ~AbstractScImportOptionsDlg() override
= default;
387 virtual void GetImportOptions( ScImportOptions
& rOptions
) const = 0;
388 virtual void SaveImportOptions() const = 0;
391 class AbstractScTextImportOptionsDlg
: public VclAbstractDialog
394 virtual ~AbstractScTextImportOptionsDlg() override
= default;
396 virtual LanguageType
GetLanguageType() const = 0;
397 virtual bool IsDateConversionSet() const = 0;
398 virtual bool IsScientificConversionSet() const = 0;
399 virtual bool IsKeepAskingSet() const = 0;
402 class AbstractScGoToTabDlg
: public VclAbstractDialog
405 virtual ~AbstractScGoToTabDlg() override
= default;
407 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
408 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rEntryLabel
, const OUString
& rListLabel
,
409 const OUString
& rDlgHelpId
, const OUString
& rEnHelpId
, const OUString
& rLbHelpId
) = 0;
410 virtual OUString
GetSelectedEntry() const = 0;
413 class ScAbstractDialogFactory
416 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
418 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg(weld::Window
* pParent
,
419 const OUString
& aDatName
,
421 ScImportAsciiCall eCall
) = 0;
423 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg(weld::Window
* pParent
) = 0;
425 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(weld::Window
* pParent
,
426 ScAutoFormat
* pAutoFormat
,
427 const ScAutoFormatData
* pSelFormatData
,
428 ScViewData
& rViewData
) = 0;
429 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
433 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
435 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(weld::Window
* pParent
, ScDocument
& rDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
437 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
439 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
440 bool bEnableExternal
) = 0;
442 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
443 const std::vector
<OUString
>& rServices
) = 0;
445 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
448 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(weld::Window
* pParent
, ScTabViewShell
* pTabViewShell
) = 0;
450 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
451 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
452 ScDocument
& rDocument
,
455 FillDateCmd eFillDateCmd
,
456 const OUString
& aStartStr
,
459 SCSIZE nSelectHeight
,
461 sal_uInt16 nPossDir
) = 0;
463 virtual VclPtr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
465 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
466 bool bDisallowCellMove
) = 0;
468 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
469 const OUString
* pStrTitle
= nullptr) = 0;
471 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
472 SCTAB nTabCount
, bool bFromFile
) = 0;
474 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
475 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Widget
* pParent
) = 0;
477 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
478 const OUString
& sDialogName
,
479 tools::Long nCurrent
,
480 tools::Long nDefault
,
482 sal_uInt16 nDecimals
,
483 tools::Long nMaximum
,
484 tools::Long nMinimum
= 0 ) = 0;
486 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
487 const OUString
& rDefault
) = 0;
489 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
490 CreateNameFlags nFlags
) = 0;
492 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg(weld::Window
* pParent
, ScDocShell
* pShell
) = 0;
494 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(weld::Window
* pParent
,
495 const SfxItemSet
& rArgSet
,
496 sal_uInt16 nSourceTab
) = 0;
498 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg(weld::Widget
* pParent
,
499 const ScDPLabelDataVector
& rLabelVec
,
500 const ScDPLabelData
& rLabelData
,
501 const ScPivotFuncData
& rFuncData
) = 0;
503 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg(weld::Widget
* pParent
,
505 const ScDPLabelData
& rLabelData
,
506 const ScPivotFuncData
& rFuncData
,
507 const ScDPNameVec
& rDataFields
) = 0;
509 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg(weld::Window
* pParent
,
510 const ScDPNumGroupInfo
& rInfo
) = 0;
512 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg(weld::Window
* pParent
,
513 const ScDPNumGroupInfo
& rInfo
,
515 const Date
& rNullDate
) = 0;
517 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
519 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
521 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg(weld::Window
* pParent
, const OUString
& rName
,
522 bool bEdit
, bool bSheetProtected
) = 0;
523 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
525 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
526 const OUString
& rTitle
,
527 const OUString
& rEditTitle
,
528 const OUString
& rDefault
,
529 const OUString
& rHelpId
,
530 const OUString
& rEditHelpId
) = 0;
532 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
533 const OUString
& rTitle
, //Dialog Title
534 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
535 const Color
& rDefaultColor
) = 0; //Currently selected Color
537 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg(weld::Window
* pParent
, bool bAscii
,
538 const ScImportOptions
* pOptions
,
539 const OUString
* pStrTitle
,
540 bool bOnlyDbtoolsEncodings
,
541 bool bImport
= true ) = 0;
543 virtual VclPtr
<AbstractScGoToTabDlg
> CreateScGoToTabDlg(weld::Window
* pParent
) = 0;
545 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg(weld::Window
* pParent
,
546 const SfxItemSet
* pCellAttrs
) = 0;
548 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(weld::Window
* pParent
,
549 const SfxItemSet
& rCoreSet
,
550 const OUString
& rPageStyle
,
551 sal_uInt16 nResId
) = 0;
553 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg(weld::Window
* pParent
,
554 SfxStyleSheetBase
& rStyleBase
,
555 bool bPage
/*true : page, false: para*/) = 0;
557 virtual VclPtr
<SfxAbstractTabDialog
> CreateScDrawStyleDlg(weld::Window
* pParent
,
558 SfxStyleSheetBase
& rStyleBase
,
561 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg(weld::Window
* pParent
,
562 const SfxItemSet
& rArgSet
) = 0;
564 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(weld::Window
* pParent
,
565 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
, bool bDrawText
) = 0;
567 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(weld::Window
* pParent
,
568 const SfxItemSet
* pAttr
) = 0;
570 virtual std::shared_ptr
<ScAsyncTabController
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
573 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
576 ~ScAbstractDialogFactory() {}
579 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */