LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / inc / scabstdlg.hxx
blob88ef7ca06017092d8d7664b2e44fec6c697a3594
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 #pragma once
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>
27 #include "global.hxx"
28 #include "pivot.hxx"
29 #include <i18nlangtag/lang.h>
30 #include <asciiopt.hxx>
32 class ScAutoFormat;
33 class ScAutoFormatData;
34 class ScDocument;
35 struct ScImportSourceDesc;
36 class ScViewData;
37 class ScQueryItem;
38 class ScImportOptions;
39 class SfxStyleSheetBase;
40 class SfxAbstractTabDialog;
41 class ScDPObject;
42 struct ScDPNumGroupInfo;
43 class ScTabViewShell;
44 class ScConditionalFormat;
45 class ScConditionalFormatList;
46 class Date;
47 enum class CreateNameFlags;
48 enum class CellShiftDisabledFlags;
50 namespace com::sun::star::sheet { struct DataPilotFieldReference; }
52 class ScAsyncTabController
54 public:
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
63 protected:
64 virtual ~AbstractScImportAsciiDlg() override = default;
65 public:
66 virtual void GetOptions( ScAsciiOptions& rOpt ) = 0;
67 virtual void SaveParameters() = 0;
70 class AbstractScAutoFormatDlg : public VclAbstractDialog
72 protected:
73 virtual ~AbstractScAutoFormatDlg() override = default;
74 public:
75 virtual sal_uInt16 GetIndex() const = 0 ;
76 virtual OUString GetCurrFormatName() = 0;
79 class AbstractScColRowLabelDlg : public VclAbstractDialog
81 protected:
82 virtual ~AbstractScColRowLabelDlg() override = default;
83 public:
84 virtual bool IsCol() = 0;
85 virtual bool IsRow() = 0;
88 class AbstractScCondFormatManagerDlg : public VclAbstractDialog
90 protected:
91 virtual ~AbstractScCondFormatManagerDlg() override = default;
92 public:
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
104 protected:
105 virtual ~AbstractScDataPilotDatabaseDlg() override = default;
106 public:
107 virtual void GetValues( ScImportSourceDesc& rDesc ) = 0;
110 class AbstractScDataPilotSourceTypeDlg : public VclAbstractDialog
112 protected:
113 virtual ~AbstractScDataPilotSourceTypeDlg() override = default;
114 public:
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
124 protected:
125 virtual ~AbstractScDataPilotServiceDlg() override = default;
126 public:
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
136 protected:
137 virtual ~AbstractScDeleteCellDlg() override = default;
138 public:
139 virtual DelCellCmd GetDelCellCmd() const = 0;
142 //for dataform
143 class AbstractScDataFormDlg : public VclAbstractDialog
145 protected:
146 virtual ~AbstractScDataFormDlg() override = default;
149 class AbstractScDeleteContentsDlg: public VclAbstractDialog
151 protected:
152 virtual ~AbstractScDeleteContentsDlg() override = default;
153 public:
154 virtual void DisableObjects() = 0 ;
155 virtual InsertDeleteFlags GetDelContentsCmdBits() const = 0;
158 class AbstractScFillSeriesDlg: public VclAbstractDialog
160 protected:
161 virtual ~AbstractScFillSeriesDlg() override = default;
162 public:
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
175 protected:
176 virtual ~AbstractScGroupDlg() override = default;
177 public:
178 virtual bool GetColsChecked() const = 0;
181 class AbstractScInsertCellDlg : public VclAbstractDialog
183 protected:
184 virtual ~AbstractScInsertCellDlg() override = default;
185 public:
186 virtual InsCellCmd GetInsCellCmd() const = 0;
189 class AbstractScInsertContentsDlg : public VclAbstractDialog
191 protected:
192 virtual ~AbstractScInsertContentsDlg() override = default;
193 public:
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
208 protected:
209 virtual ~AbstractScInsertTableDlg() override = default;
210 public:
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
223 protected:
224 virtual ~AbstractScSelEntryDlg() override = default;
225 public:
226 virtual OUString GetSelectedEntry() const = 0;
229 class AbstractScLinkedAreaDlg : public VclAbstractDialog
231 protected:
232 virtual ~AbstractScLinkedAreaDlg() override = default;
233 public:
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
246 protected:
247 virtual ~AbstractScMetricInputDlg() override = default;
248 public:
249 virtual int GetInputValue() const = 0;
252 class AbstractScMoveTableDlg : public VclAbstractDialog
254 protected:
255 virtual ~AbstractScMoveTableDlg() override = default;
256 public:
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
268 protected:
269 virtual ~AbstractScNameCreateDlg() override = default;
270 public:
271 virtual CreateNameFlags GetFlags() const = 0;
274 class AbstractScNamePasteDlg : public VclAbstractDialog
276 protected:
277 virtual ~AbstractScNamePasteDlg() override = default;
278 public:
279 virtual std::vector<OUString> GetSelectedNames() const = 0;
282 class AbstractScPivotFilterDlg : public VclAbstractDialog
284 protected:
285 virtual ~AbstractScPivotFilterDlg() override = default;
286 public:
287 virtual const ScQueryItem& GetOutputItem() = 0;
290 class AbstractScDPFunctionDlg : public VclAbstractDialog
292 protected:
293 virtual ~AbstractScDPFunctionDlg() override = default;
294 public:
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
302 protected:
303 virtual ~AbstractScDPSubtotalDlg() override = default;
304 public:
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
312 protected:
313 virtual ~AbstractScDPNumGroupDlg() override = default;
314 public:
315 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
318 class AbstractScDPDateGroupDlg : public VclAbstractDialog
320 protected:
321 virtual ~AbstractScDPDateGroupDlg() override = default;
322 public:
323 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
324 virtual sal_Int32 GetDatePart() const = 0;
327 class AbstractScDPShowDetailDlg : public VclAbstractDialog
329 protected:
330 virtual ~AbstractScDPShowDetailDlg() override = default;
331 public:
332 virtual OUString GetDimensionName() const = 0;
335 class AbstractScNewScenarioDlg : public VclAbstractDialog
337 protected:
338 virtual ~AbstractScNewScenarioDlg() override = default;
339 public:
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
350 protected:
351 virtual ~AbstractScShowTabDlg() override = default;
352 public:
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
361 protected:
362 virtual ~AbstractScSortWarningDlg() override = default;
365 class AbstractScStringInputDlg : public VclAbstractDialog
367 protected:
368 virtual ~AbstractScStringInputDlg() override = default;
369 public:
370 virtual OUString GetInputString() const = 0;
373 class AbstractScTabBgColorDlg : public VclAbstractDialog
375 protected:
376 virtual ~AbstractScTabBgColorDlg() override = default;
377 public:
378 virtual void GetSelectedColor( Color& rColor ) const = 0;
381 class AbstractScImportOptionsDlg : public VclAbstractDialog
383 protected:
384 virtual ~AbstractScImportOptionsDlg() override = default;
385 public:
386 virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
387 virtual void SaveImportOptions() const = 0;
390 class AbstractScTextImportOptionsDlg : public VclAbstractDialog
392 protected:
393 virtual ~AbstractScTextImportOptionsDlg() override = default;
394 public:
395 virtual LanguageType GetLanguageType() const = 0;
396 virtual bool IsDateConversionSet() const = 0;
397 virtual bool IsKeepAskingSet() const = 0;
400 class ScAbstractDialogFactory
402 public:
403 SC_DLLPUBLIC static ScAbstractDialogFactory* Create();
405 virtual VclPtr<AbstractScImportAsciiDlg> CreateScImportAsciiDlg(weld::Window* pParent,
406 const OUString& aDatName,
407 SvStream* pInStream,
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,
417 bool bCol,
418 bool bRow) = 0;
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 ;
434 //for dataform
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,
440 FillDir eFillDir,
441 FillCmd eFillCmd,
442 FillDateCmd eFillDateCmd,
443 const OUString& aStartStr,
444 double fStep,
445 double fMax,
446 SCSIZE nSelectHeight,
447 SCSIZE nSelectWidth,
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,
468 FieldUnit eFUnit,
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,
491 ScDPObject& rDPObj,
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,
501 sal_Int32 nDatePart,
502 const Date& rNullDate ) = 0;
504 virtual VclPtr<AbstractScDPShowDetailDlg> CreateScDPShowDetailDlg(weld::Window* pParent,
505 ScDPObject& rDPObj,
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;
553 // for tabpage
554 virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
556 protected:
557 ~ScAbstractDialogFactory() {}
560 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */