Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / scabstdlg.hxx
blob707e2cda6569ead5c6a6968d9c09a5cf9b776fc4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 #include "sc.hrc"
28 #include "global.hxx"
29 #include "pivot.hxx"
30 #include <i18nlangtag/lang.h>
31 #include <asciiopt.hxx>
33 #include <tabvwsh.hxx>
35 class ScAsciiOptions;
36 class ScAutoFormat;
37 class ScAutoFormatData;
38 class ScDocument;
39 struct ScImportSourceDesc;
40 class ScViewData;
41 class ScQueryItem;
42 class ScImportOptions;
43 class SfxStyleSheetBase;
44 class ScDPObject;
45 struct ScPivotFuncData;
46 struct ScDPNumGroupInfo;
47 class ScSortWarningDlg;
48 class ScTabViewShell;
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;
56 } } } }
58 class AbstractScImportAsciiDlg : public VclAbstractDialog
60 protected:
61 virtual ~AbstractScImportAsciiDlg() override = default;
62 public:
63 virtual void GetOptions( ScAsciiOptions& rOpt ) = 0;
64 virtual void SaveParameters() = 0;
67 class AbstractScAutoFormatDlg : public VclAbstractDialog
69 protected:
70 virtual ~AbstractScAutoFormatDlg() override = default;
71 public:
72 virtual sal_uInt16 GetIndex() const = 0 ;
73 virtual OUString GetCurrFormatName() = 0;
76 class AbstractScColRowLabelDlg : public VclAbstractDialog
78 protected:
79 virtual ~AbstractScColRowLabelDlg() override = default;
80 public:
81 virtual bool IsCol() = 0;
82 virtual bool IsRow() = 0;
85 class AbstractScCondFormatManagerDlg : public VclAbstractDialog
87 protected:
88 virtual ~AbstractScCondFormatManagerDlg() override = default;
89 public:
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
101 protected:
102 virtual ~AbstractScDataPilotDatabaseDlg() override = default;
103 public:
104 virtual void GetValues( ScImportSourceDesc& rDesc ) = 0;
107 class AbstractScDataPilotSourceTypeDlg : public VclAbstractDialog
109 protected:
110 virtual ~AbstractScDataPilotSourceTypeDlg() override = default;
111 public:
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
121 protected:
122 virtual ~AbstractScDataPilotServiceDlg() override = default;
123 public:
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
133 protected:
134 virtual ~AbstractScDeleteCellDlg() override = default;
135 public:
136 virtual DelCellCmd GetDelCellCmd() const = 0;
139 //for dataform
140 class AbstractScDataFormDlg : public VclAbstractDialog
142 protected:
143 virtual ~AbstractScDataFormDlg() override = default;
146 class AbstractScDeleteContentsDlg: public VclAbstractDialog
148 protected:
149 virtual ~AbstractScDeleteContentsDlg() override = default;
150 public:
151 virtual void DisableObjects() = 0 ;
152 virtual InsertDeleteFlags GetDelContentsCmdBits() const = 0;
155 class AbstractScFillSeriesDlg: public VclAbstractDialog
157 protected:
158 virtual ~AbstractScFillSeriesDlg() override = default;
159 public:
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
172 protected:
173 virtual ~AbstractScGroupDlg() override = default;
174 public:
175 virtual bool GetColsChecked() const = 0;
178 class AbstractScInsertCellDlg : public VclAbstractDialog
180 protected:
181 virtual ~AbstractScInsertCellDlg() override = default;
182 public:
183 virtual InsCellCmd GetInsCellCmd() const = 0;
186 class AbstractScInsertContentsDlg : public VclAbstractDialog
188 protected:
189 virtual ~AbstractScInsertContentsDlg() override = default;
190 public:
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
205 protected:
206 virtual ~AbstractScInsertTableDlg() override = default;
207 public:
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
220 protected:
221 virtual ~AbstractScSelEntryDlg() override = default;
222 public:
223 virtual OUString GetSelectedEntry() const = 0;
226 class AbstractScLinkedAreaDlg : public VclAbstractDialog
228 protected:
229 virtual ~AbstractScLinkedAreaDlg() override = default;
230 public:
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
243 protected:
244 virtual ~AbstractScMetricInputDlg() override = default;
245 public:
246 virtual int GetInputValue() const = 0;
249 class AbstractScMoveTableDlg : public VclAbstractDialog
251 protected:
252 virtual ~AbstractScMoveTableDlg() override = default;
253 public:
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
265 protected:
266 virtual ~AbstractScNameCreateDlg() override = default;
267 public:
268 virtual CreateNameFlags GetFlags() const = 0;
271 class AbstractScNamePasteDlg : public VclAbstractDialog
273 protected:
274 virtual ~AbstractScNamePasteDlg() override = default;
275 public:
276 virtual std::vector<OUString> GetSelectedNames() const = 0;
279 class AbstractScPivotFilterDlg : public VclAbstractDialog
281 protected:
282 virtual ~AbstractScPivotFilterDlg() override = default;
283 public:
284 virtual const ScQueryItem& GetOutputItem() = 0;
287 class AbstractScDPFunctionDlg : public VclAbstractDialog
289 protected:
290 virtual ~AbstractScDPFunctionDlg() override = default;
291 public:
292 virtual PivotFunc GetFuncMask() const = 0;
293 virtual css::sheet::DataPilotFieldReference GetFieldRef() const = 0;
296 class AbstractScDPSubtotalDlg : public VclAbstractDialog
298 protected:
299 virtual ~AbstractScDPSubtotalDlg() override = default;
300 public:
301 virtual PivotFunc GetFuncMask() const = 0;
302 virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0;
305 class AbstractScDPNumGroupDlg : public VclAbstractDialog
307 protected:
308 virtual ~AbstractScDPNumGroupDlg() override = default;
309 public:
310 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
313 class AbstractScDPDateGroupDlg : public VclAbstractDialog
315 protected:
316 virtual ~AbstractScDPDateGroupDlg() override = default;
317 public:
318 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
319 virtual sal_Int32 GetDatePart() const = 0;
322 class AbstractScDPShowDetailDlg : public VclAbstractDialog
324 protected:
325 virtual ~AbstractScDPShowDetailDlg() override = default;
326 public:
327 virtual OUString GetDimensionName() const = 0;
330 class AbstractScNewScenarioDlg : public VclAbstractDialog
332 protected:
333 virtual ~AbstractScNewScenarioDlg() override = default;
334 public:
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
345 protected:
346 virtual ~AbstractScShowTabDlg() override = default;
347 public:
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
356 protected:
357 virtual ~AbstractScSortWarningDlg() override = default;
360 class AbstractScStringInputDlg : public VclAbstractDialog
362 protected:
363 virtual ~AbstractScStringInputDlg() override = default;
364 public:
365 virtual OUString GetInputString() const = 0;
368 class AbstractScTabBgColorDlg : public VclAbstractDialog
370 protected:
371 virtual ~AbstractScTabBgColorDlg() override = default;
372 public:
373 virtual void GetSelectedColor( Color& rColor ) const = 0;
376 class AbstractScImportOptionsDlg : public VclAbstractDialog
378 protected:
379 virtual ~AbstractScImportOptionsDlg() override = default;
380 public:
381 virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
382 virtual void SaveImportOptions() const = 0;
385 class AbstractScTextImportOptionsDlg : public VclAbstractDialog
387 protected:
388 virtual ~AbstractScTextImportOptionsDlg() override = default;
389 public:
390 virtual LanguageType GetLanguageType() const = 0;
391 virtual bool IsDateConversionSet() const = 0;
394 class ScAbstractDialogFactory
396 public:
397 SC_DLLPUBLIC static ScAbstractDialogFactory* Create();
399 virtual VclPtr<AbstractScImportAsciiDlg> CreateScImportAsciiDlg( const OUString& aDatName,
400 SvStream* pInStream,
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,
410 bool bCol,
411 bool bRow) = 0;
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 ;
427 //for dataform
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,
434 FillDir eFillDir,
435 FillCmd eFillCmd,
436 FillDateCmd eFillDateCmd,
437 const OUString& aStartStr,
438 double fStep,
439 double fMax,
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,
458 long nCurrent,
459 long nDefault,
460 FieldUnit eFUnit,
461 sal_uInt16 nDecimals,
462 long nMaximum,
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,
482 ScDPObject& rDPObj,
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,
492 sal_Int32 nDatePart,
493 const Date& rNullDate ) = 0;
495 virtual VclPtr<AbstractScDPShowDetailDlg> CreateScDPShowDetailDlg(weld::Window* pParent,
496 ScDPObject& rDPObj,
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,
531 sal_uInt16 nRscId,
532 int nId) = 0;
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;
545 // for tabpage
546 virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
548 protected:
549 ~ScAbstractDialogFactory() {}
551 #endif
553 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */