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 <sfx2/sfxdlg.hxx>
25 #include <vcl/syswin.hxx>
26 #include <vcl/field.hxx>
30 #include <i18nlangtag/lang.h>
31 #include <asciiopt.hxx>
33 #include <tabvwsh.hxx>
37 class ScAutoFormatData
;
39 struct ScImportSourceDesc
;
42 class ScImportOptions
;
43 class SfxStyleSheetBase
;
45 struct ScPivotFuncData
;
46 struct ScDPNumGroupInfo
;
47 class ScSortWarningDlg
;
49 class ScConditionalFormat
;
50 class ScConditionalFormatList
;
51 enum class CreateNameFlags
;
52 enum class CellShiftDisabledFlags
;
54 namespace com
{ namespace sun
{ namespace star
{ namespace sheet
{
55 struct DataPilotFieldReference
;
58 class AbstractScImportAsciiDlg
: public VclAbstractDialog
61 virtual ~AbstractScImportAsciiDlg() override
= default;
63 virtual void GetOptions( ScAsciiOptions
& rOpt
) = 0;
64 virtual void SaveParameters() = 0;
67 class AbstractScAutoFormatDlg
: public VclAbstractDialog
70 virtual ~AbstractScAutoFormatDlg() override
= default;
72 virtual sal_uInt16
GetIndex() const = 0 ;
73 virtual OUString
GetCurrFormatName() = 0;
76 class AbstractScColRowLabelDlg
: public VclAbstractDialog
79 virtual ~AbstractScColRowLabelDlg() override
= default;
81 virtual bool IsCol() = 0;
82 virtual bool IsRow() = 0;
85 class AbstractScCondFormatManagerDlg
: public VclAbstractDialog
88 virtual ~AbstractScCondFormatManagerDlg() override
= default;
90 virtual ScConditionalFormatList
* GetConditionalFormatList() = 0;
92 virtual bool CondFormatsChanged() const = 0;
94 virtual void SetModified() = 0;
96 virtual ScConditionalFormat
* GetCondFormatSelected() = 0;
99 class AbstractScDataPilotDatabaseDlg
:public VclAbstractDialog
102 virtual ~AbstractScDataPilotDatabaseDlg() override
= default;
104 virtual void GetValues( ScImportSourceDesc
& rDesc
) = 0;
107 class AbstractScDataPilotSourceTypeDlg
: public VclAbstractDialog
110 virtual ~AbstractScDataPilotSourceTypeDlg() override
= default;
112 virtual bool IsDatabase() const = 0;
113 virtual bool IsExternal() const = 0;
114 virtual bool IsNamedRange() const = 0;
115 virtual OUString
GetSelectedNamedRange() const = 0;
116 virtual void AppendNamedRange(const OUString
& rName
) = 0;
119 class AbstractScDataPilotServiceDlg
: public VclAbstractDialog
122 virtual ~AbstractScDataPilotServiceDlg() override
= default;
124 virtual OUString
GetServiceName() const = 0;
125 virtual OUString
GetParSource() const = 0 ;
126 virtual OUString
GetParName() const = 0 ;
127 virtual OUString
GetParUser() const = 0;
128 virtual OUString
GetParPass() const = 0;
131 class AbstractScDeleteCellDlg
: public VclAbstractDialog
134 virtual ~AbstractScDeleteCellDlg() override
= default;
136 virtual DelCellCmd
GetDelCellCmd() const = 0;
140 class AbstractScDataFormDlg
: public VclAbstractDialog
143 virtual ~AbstractScDataFormDlg() override
= default;
146 class AbstractScDeleteContentsDlg
: public VclAbstractDialog
149 virtual ~AbstractScDeleteContentsDlg() override
= default;
151 virtual void DisableObjects() = 0 ;
152 virtual InsertDeleteFlags
GetDelContentsCmdBits() const = 0;
155 class AbstractScFillSeriesDlg
: public VclAbstractDialog
158 virtual ~AbstractScFillSeriesDlg() override
= default;
160 virtual FillDir
GetFillDir() const = 0;
161 virtual FillCmd
GetFillCmd() const = 0;
162 virtual FillDateCmd
GetFillDateCmd() const = 0;
163 virtual double GetStart() const = 0;
164 virtual double GetStep() const = 0;
165 virtual double GetMax() const = 0;
166 virtual OUString
GetStartStr() const = 0;
167 virtual void SetEdStartValEnabled(bool bFlag
) = 0;
170 class AbstractScGroupDlg
: public VclAbstractDialog
173 virtual ~AbstractScGroupDlg() override
= default;
175 virtual bool GetColsChecked() const = 0;
178 class AbstractScInsertCellDlg
: public VclAbstractDialog
181 virtual ~AbstractScInsertCellDlg() override
= default;
183 virtual InsCellCmd
GetInsCellCmd() const = 0;
186 class AbstractScInsertContentsDlg
: public VclAbstractDialog
189 virtual ~AbstractScInsertContentsDlg() override
= default;
191 virtual InsertDeleteFlags
GetInsContentsCmdBits() const = 0;
192 virtual ScPasteFunc
GetFormulaCmdBits() const = 0 ;
193 virtual bool IsSkipEmptyCells() const = 0;
194 virtual bool IsLink() const = 0;
195 virtual void SetFillMode( bool bSet
) = 0;
196 virtual void SetOtherDoc( bool bSet
) = 0;
197 virtual bool IsTranspose() const = 0;
198 virtual void SetChangeTrack( bool bSet
) = 0;
199 virtual void SetCellShiftDisabled( CellShiftDisabledFlags nDisable
) = 0;
200 virtual InsCellCmd
GetMoveMode() = 0;
203 class AbstractScInsertTableDlg
: public VclAbstractDialog
206 virtual ~AbstractScInsertTableDlg() override
= default;
208 virtual bool GetTablesFromFile() = 0;
209 virtual bool GetTablesAsLink() = 0;
210 virtual const OUString
* GetFirstTable( sal_uInt16
* pN
= nullptr ) = 0;
211 virtual ScDocShell
* GetDocShellTables() = 0;
212 virtual bool IsTableBefore() = 0;
213 virtual sal_uInt16
GetTableCount() = 0;
214 virtual const OUString
* GetNextTable( sal_uInt16
* pN
) = 0;
218 class AbstractScSelEntryDlg
: public VclAbstractDialog
221 virtual ~AbstractScSelEntryDlg() override
= default;
223 virtual OUString
GetSelectedEntry() const = 0;
226 class AbstractScLinkedAreaDlg
: public VclAbstractDialog
229 virtual ~AbstractScLinkedAreaDlg() override
= default;
231 virtual void InitFromOldLink( const OUString
& rFile
, const OUString
& rFilter
,
232 const OUString
& rOptions
, const OUString
& rSource
,
233 sal_uLong nRefresh
) = 0;
234 virtual OUString
GetURL() = 0;
235 virtual OUString
GetFilter() = 0; // may be empty
236 virtual OUString
GetOptions() = 0; // filter options
237 virtual OUString
GetSource() = 0; // separated by ";"
238 virtual sal_uLong
GetRefresh() = 0; // 0 if disabled
241 class AbstractScMetricInputDlg
: public VclAbstractDialog
244 virtual ~AbstractScMetricInputDlg() override
= default;
246 virtual int GetInputValue() const = 0;
249 class AbstractScMoveTableDlg
: public VclAbstractDialog
252 virtual ~AbstractScMoveTableDlg() override
= default;
254 virtual sal_uInt16
GetSelectedDocument () const = 0;
255 virtual sal_uInt16
GetSelectedTable () const = 0;
256 virtual bool GetCopyTable () const = 0;
257 virtual bool GetRenameTable () const = 0;
258 virtual void GetTabNameString( OUString
& rString
) const = 0;
259 virtual void SetForceCopyTable () = 0;
260 virtual void EnableRenameTable (bool bFlag
) = 0;
263 class AbstractScNameCreateDlg
: public VclAbstractDialog
// Manage Name Dialog
266 virtual ~AbstractScNameCreateDlg() override
= default;
268 virtual CreateNameFlags
GetFlags() const = 0;
271 class AbstractScNamePasteDlg
: public VclAbstractDialog
274 virtual ~AbstractScNamePasteDlg() override
= default;
276 virtual std::vector
<OUString
> GetSelectedNames() const = 0;
279 class AbstractScPivotFilterDlg
: public VclAbstractDialog
282 virtual ~AbstractScPivotFilterDlg() override
= default;
284 virtual const ScQueryItem
& GetOutputItem() = 0;
287 class AbstractScDPFunctionDlg
: public VclAbstractDialog
290 virtual ~AbstractScDPFunctionDlg() override
= default;
292 virtual PivotFunc
GetFuncMask() const = 0;
293 virtual css::sheet::DataPilotFieldReference
GetFieldRef() const = 0;
296 class AbstractScDPSubtotalDlg
: public VclAbstractDialog
299 virtual ~AbstractScDPSubtotalDlg() override
= default;
301 virtual PivotFunc
GetFuncMask() const = 0;
302 virtual void FillLabelData( ScDPLabelData
& rLabelData
) const = 0;
305 class AbstractScDPNumGroupDlg
: public VclAbstractDialog
308 virtual ~AbstractScDPNumGroupDlg() override
= default;
310 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
313 class AbstractScDPDateGroupDlg
: public VclAbstractDialog
316 virtual ~AbstractScDPDateGroupDlg() override
= default;
318 virtual ScDPNumGroupInfo
GetGroupInfo() const = 0;
319 virtual sal_Int32
GetDatePart() const = 0;
322 class AbstractScDPShowDetailDlg
: public VclAbstractDialog
325 virtual ~AbstractScDPShowDetailDlg() override
= default;
327 virtual OUString
GetDimensionName() const = 0;
330 class AbstractScNewScenarioDlg
: public VclAbstractDialog
333 virtual ~AbstractScNewScenarioDlg() override
= default;
336 virtual void SetScenarioData( const OUString
& rName
, const OUString
& rComment
,
337 const Color
& rColor
, ScScenarioFlags nFlags
) = 0;
339 virtual void GetScenarioData( OUString
& rName
, OUString
& rComment
,
340 Color
& rColor
, ScScenarioFlags
& rFlags
) const = 0;
343 class AbstractScShowTabDlg
: public VclAbstractDialog
346 virtual ~AbstractScShowTabDlg() override
= default;
348 virtual void Insert( const OUString
& rString
, bool bSelected
) = 0;
349 virtual void SetDescription(const OUString
& rTitle
, const OUString
& rFixedText
, const OString
& nDlgHelpId
, const OString
& nLbHelpId
) = 0;
350 virtual std::vector
<sal_Int32
> GetSelectedRows() const = 0;
351 virtual OUString
GetEntry(sal_Int32 nPos
) const = 0;
354 class AbstractScSortWarningDlg
: public VclAbstractDialog
357 virtual ~AbstractScSortWarningDlg() override
= default;
360 class AbstractScStringInputDlg
: public VclAbstractDialog
363 virtual ~AbstractScStringInputDlg() override
= default;
365 virtual OUString
GetInputString() const = 0;
368 class AbstractScTabBgColorDlg
: public VclAbstractDialog
371 virtual ~AbstractScTabBgColorDlg() override
= default;
373 virtual void GetSelectedColor( Color
& rColor
) const = 0;
376 class AbstractScImportOptionsDlg
: public VclAbstractDialog
379 virtual ~AbstractScImportOptionsDlg() override
= default;
381 virtual void GetImportOptions( ScImportOptions
& rOptions
) const = 0;
382 virtual void SaveImportOptions() const = 0;
385 class AbstractScTextImportOptionsDlg
: public VclAbstractDialog
388 virtual ~AbstractScTextImportOptionsDlg() override
= default;
390 virtual LanguageType
GetLanguageType() const = 0;
391 virtual bool IsDateConversionSet() const = 0;
394 class ScAbstractDialogFactory
397 SC_DLLPUBLIC
static ScAbstractDialogFactory
* Create();
399 virtual VclPtr
<AbstractScImportAsciiDlg
> CreateScImportAsciiDlg( const OUString
& aDatName
,
401 ScImportAsciiCall eCall
) = 0;
403 virtual VclPtr
<AbstractScTextImportOptionsDlg
> CreateScTextImportOptionsDlg() = 0;
405 virtual VclPtr
<AbstractScAutoFormatDlg
> CreateScAutoFormatDlg(vcl::Window
* pParent
,
406 ScAutoFormat
* pAutoFormat
,
407 const ScAutoFormatData
* pSelFormatData
,
408 ScViewData
*pViewData
) = 0;
409 virtual VclPtr
<AbstractScColRowLabelDlg
> CreateScColRowLabelDlg (weld::Window
* pParent
,
413 virtual VclPtr
<AbstractScSortWarningDlg
> CreateScSortWarningDlg(weld::Window
* pParent
, const OUString
& rExtendText
, const OUString
& rCurrentText
) = 0;
415 virtual VclPtr
<AbstractScCondFormatManagerDlg
> CreateScCondFormatMgrDlg(vcl::Window
* pParent
, ScDocument
* pDoc
, const ScConditionalFormatList
* pFormatList
) = 0;
417 virtual VclPtr
<AbstractScDataPilotDatabaseDlg
> CreateScDataPilotDatabaseDlg(weld::Window
* pParent
) = 0;
419 virtual VclPtr
<AbstractScDataPilotSourceTypeDlg
> CreateScDataPilotSourceTypeDlg(weld::Window
* pParent
,
420 bool bEnableExternal
) = 0;
422 virtual VclPtr
<AbstractScDataPilotServiceDlg
> CreateScDataPilotServiceDlg(weld::Window
* pParent
,
423 const std::vector
<OUString
>& rServices
) = 0;
425 virtual VclPtr
<AbstractScDeleteCellDlg
> CreateScDeleteCellDlg(weld::Window
* pParent
, bool bDisallowCellMove
) = 0 ;
428 virtual VclPtr
<AbstractScDataFormDlg
> CreateScDataFormDlg(vcl::Window
* pParent
,
429 ScTabViewShell
* pTabViewShell
) = 0;
431 virtual VclPtr
<AbstractScDeleteContentsDlg
> CreateScDeleteContentsDlg(weld::Window
* pParent
) = 0;
432 virtual VclPtr
<AbstractScFillSeriesDlg
> CreateScFillSeriesDlg(weld::Window
* pParent
,
433 ScDocument
& rDocument
,
436 FillDateCmd eFillDateCmd
,
437 const OUString
& aStartStr
,
440 sal_uInt16 nPossDir
) = 0;
442 virtual VclPtr
<AbstractScGroupDlg
> CreateAbstractScGroupDlg(weld::Window
* pParent
, bool bUnGroup
= false) = 0;
444 virtual VclPtr
<AbstractScInsertCellDlg
> CreateScInsertCellDlg(weld::Window
* pParent
,
445 bool bDisallowCellMove
) = 0;
447 virtual VclPtr
<AbstractScInsertContentsDlg
> CreateScInsertContentsDlg(weld::Window
* pParent
,
448 const OUString
* pStrTitle
= nullptr) = 0;
450 virtual VclPtr
<AbstractScInsertTableDlg
> CreateScInsertTableDlg(weld::Window
* pParent
, ScViewData
& rViewData
,
451 SCTAB nTabCount
, bool bFromFile
) = 0;
453 virtual VclPtr
<AbstractScSelEntryDlg
> CreateScSelEntryDlg(weld::Window
* pParent
, const std::vector
<OUString
> &rEntryList
) = 0;
454 virtual VclPtr
<AbstractScLinkedAreaDlg
> CreateScLinkedAreaDlg(weld::Window
* pParent
) = 0;
456 virtual VclPtr
<AbstractScMetricInputDlg
> CreateScMetricInputDlg(weld::Window
* pParent
,
457 const OString
& sDialogName
,
461 sal_uInt16 nDecimals
,
463 long nMinimum
= 0 ) = 0;
465 virtual VclPtr
<AbstractScMoveTableDlg
> CreateScMoveTableDlg(weld::Window
* pParent
,
466 const OUString
& rDefault
) = 0;
468 virtual VclPtr
<AbstractScNameCreateDlg
> CreateScNameCreateDlg(weld::Window
* pParent
,
469 CreateNameFlags nFlags
) = 0;
471 virtual VclPtr
<AbstractScNamePasteDlg
> CreateScNamePasteDlg ( vcl::Window
* pParent
, ScDocShell
* pShell
) = 0;
473 virtual VclPtr
<AbstractScPivotFilterDlg
> CreateScPivotFilterDlg(vcl::Window
* pParent
,
474 const SfxItemSet
& rArgSet
, sal_uInt16 nSourceTab
) = 0;
476 virtual VclPtr
<AbstractScDPFunctionDlg
> CreateScDPFunctionDlg( vcl::Window
* pParent
,
477 const ScDPLabelDataVector
& rLabelVec
,
478 const ScDPLabelData
& rLabelData
,
479 const ScPivotFuncData
& rFuncData
) = 0;
481 virtual VclPtr
<AbstractScDPSubtotalDlg
> CreateScDPSubtotalDlg( vcl::Window
* pParent
,
483 const ScDPLabelData
& rLabelData
,
484 const ScPivotFuncData
& rFuncData
,
485 const ScDPNameVec
& rDataFields
) = 0;
487 virtual VclPtr
<AbstractScDPNumGroupDlg
> CreateScDPNumGroupDlg( vcl::Window
* pParent
,
488 const ScDPNumGroupInfo
& rInfo
) = 0;
490 virtual VclPtr
<AbstractScDPDateGroupDlg
> CreateScDPDateGroupDlg( vcl::Window
* pParent
,
491 const ScDPNumGroupInfo
& rInfo
,
493 const Date
& rNullDate
) = 0;
495 virtual VclPtr
<AbstractScDPShowDetailDlg
> CreateScDPShowDetailDlg(weld::Window
* pParent
,
497 css::sheet::DataPilotFieldOrientation nOrient
) = 0;
499 virtual VclPtr
<AbstractScNewScenarioDlg
> CreateScNewScenarioDlg ( vcl::Window
* pParent
, const OUString
& rName
,
500 bool bEdit
, bool bSheetProtected
) = 0;
501 virtual VclPtr
<AbstractScShowTabDlg
> CreateScShowTabDlg(weld::Window
* pParent
) = 0;
503 virtual VclPtr
<AbstractScStringInputDlg
> CreateScStringInputDlg(weld::Window
* pParent
,
504 const OUString
& rTitle
,
505 const OUString
& rEditTitle
,
506 const OUString
& rDefault
,
507 const OString
& rHelpId
,
508 const OString
& rEditHelpId
) = 0;
510 virtual VclPtr
<AbstractScTabBgColorDlg
> CreateScTabBgColorDlg(weld::Window
* pParent
,
511 const OUString
& rTitle
, //Dialog Title
512 const OUString
& rTabBgColorNoColorText
, //Label for no tab color
513 const Color
& rDefaultColor
) = 0; //Currently selected Color
515 virtual VclPtr
<AbstractScImportOptionsDlg
> CreateScImportOptionsDlg ( bool bAscii
,
516 const ScImportOptions
* pOptions
,
517 const OUString
* pStrTitle
,
518 bool bOnlyDbtoolsEncodings
,
519 bool bImport
= true ) = 0;
521 virtual VclPtr
<SfxAbstractTabDialog
> CreateScAttrDlg( vcl::Window
* pParent
,
522 const SfxItemSet
* pCellAttrs
) = 0;
524 virtual VclPtr
<SfxAbstractTabDialog
> CreateScHFEditDlg(vcl::Window
* pParent
,
525 const SfxItemSet
& rCoreSet
,
526 const OUString
& rPageStyle
,
527 sal_uInt16 nResId
) = 0;
529 virtual VclPtr
<SfxAbstractTabDialog
> CreateScStyleDlg( vcl::Window
* pParent
,
530 SfxStyleSheetBase
& rStyleBase
,
534 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSubTotalDlg( vcl::Window
* pParent
,
535 const SfxItemSet
* pArgSet
) = 0;
537 virtual VclPtr
<SfxAbstractTabDialog
> CreateScCharDlg(vcl::Window
* pParent
,
538 const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
) = 0;
540 virtual VclPtr
<SfxAbstractTabDialog
> CreateScParagraphDlg(vcl::Window
* pParent
,
541 const SfxItemSet
* pAttr
) = 0;
543 virtual VclPtr
<SfxAbstractTabDialog
> CreateScSortDlg(weld::Window
* pParent
, const SfxItemSet
* pArgSet
) = 0;
546 virtual CreateTabPage
GetTabPageCreatorFunc( sal_uInt16 nId
) = 0;
549 ~ScAbstractDialogFactory() {}
553 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */