tdf#48459 sw inline heading: don't apply inside frames or over 120 chars
[LibreOffice.git] / sc / inc / scabstdlg.hxx
blob245869363f2eb3a84c3ff61578288771e538ad94
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 <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
23 #include <sfx2/tabdlg.hxx>
24 #include <tools/fldunit.hxx>
25 #include <vcl/abstdlg.hxx>
26 #include "global.hxx"
27 #include "pivot.hxx"
28 #include <i18nlangtag/lang.h>
29 #include <asciiopt.hxx>
31 class ScAutoFormat;
32 class ScAutoFormatData;
33 class ScDocument;
34 struct ScImportSourceDesc;
35 class ScViewData;
36 class ScQueryItem;
37 class ScImportOptions;
38 class SfxStyleSheetBase;
39 class SfxAbstractTabDialog;
40 class ScDPObject;
41 struct ScDPNumGroupInfo;
42 class ScTabViewShell;
43 class ScConditionalFormat;
44 class ScConditionalFormatList;
45 class Date;
46 class SdrView;
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 OUString &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;
187 virtual size_t GetCount() const = 0;
190 class AbstractScInsertContentsDlg : public VclAbstractDialog
192 protected:
193 virtual ~AbstractScInsertContentsDlg() override = default;
194 public:
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
209 protected:
210 virtual ~AbstractScInsertTableDlg() override = default;
211 public:
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
224 protected:
225 virtual ~AbstractScSelEntryDlg() override = default;
226 public:
227 virtual OUString GetSelectedEntry() const = 0;
230 class AbstractScLinkedAreaDlg : public VclAbstractDialog
232 protected:
233 virtual ~AbstractScLinkedAreaDlg() override = default;
234 public:
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
247 protected:
248 virtual ~AbstractScMetricInputDlg() override = default;
249 public:
250 virtual int GetInputValue() const = 0;
253 class AbstractScMoveTableDlg : public VclAbstractDialog
255 protected:
256 virtual ~AbstractScMoveTableDlg() override = default;
257 public:
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
269 protected:
270 virtual ~AbstractScNameCreateDlg() override = default;
271 public:
272 virtual CreateNameFlags GetFlags() const = 0;
275 class AbstractScNamePasteDlg : public VclAbstractDialog
277 protected:
278 virtual ~AbstractScNamePasteDlg() override = default;
279 public:
280 virtual std::vector<OUString> GetSelectedNames() const = 0;
283 class AbstractScPivotFilterDlg : public VclAbstractDialog
285 protected:
286 virtual ~AbstractScPivotFilterDlg() override = default;
287 public:
288 virtual const ScQueryItem& GetOutputItem() = 0;
291 class AbstractScDPFunctionDlg : public VclAbstractDialog
293 protected:
294 virtual ~AbstractScDPFunctionDlg() override = default;
295 public:
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
303 protected:
304 virtual ~AbstractScDPSubtotalDlg() override = default;
305 public:
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
313 protected:
314 virtual ~AbstractScDPNumGroupDlg() override = default;
315 public:
316 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
319 class AbstractScDPDateGroupDlg : public VclAbstractDialog
321 protected:
322 virtual ~AbstractScDPDateGroupDlg() override = default;
323 public:
324 virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
325 virtual sal_Int32 GetDatePart() const = 0;
328 class AbstractScDPShowDetailDlg : public VclAbstractDialog
330 protected:
331 virtual ~AbstractScDPShowDetailDlg() override = default;
332 public:
333 virtual OUString GetDimensionName() const = 0;
336 class AbstractScNewScenarioDlg : public VclAbstractDialog
338 protected:
339 virtual ~AbstractScNewScenarioDlg() override = default;
340 public:
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
351 protected:
352 virtual ~AbstractScShowTabDlg() override = default;
353 public:
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
362 protected:
363 virtual ~AbstractScSortWarningDlg() override = default;
366 class AbstractScStringInputDlg : public VclAbstractDialog
368 protected:
369 virtual ~AbstractScStringInputDlg() override = default;
370 public:
371 virtual OUString GetInputString() const = 0;
374 class AbstractScTabBgColorDlg : public VclAbstractDialog
376 protected:
377 virtual ~AbstractScTabBgColorDlg() override = default;
378 public:
379 virtual void GetSelectedColor( Color& rColor ) const = 0;
382 class AbstractScImportOptionsDlg : public VclAbstractDialog
384 protected:
385 virtual ~AbstractScImportOptionsDlg() override = default;
386 public:
387 virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
388 virtual void SaveImportOptions() const = 0;
391 class AbstractScTextImportOptionsDlg : public VclAbstractDialog
393 protected:
394 virtual ~AbstractScTextImportOptionsDlg() override = default;
395 public:
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
404 protected:
405 virtual ~AbstractScGoToTabDlg() override = default;
406 public:
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
415 public:
416 SC_DLLPUBLIC static ScAbstractDialogFactory* Create();
418 virtual VclPtr<AbstractScImportAsciiDlg> CreateScImportAsciiDlg(weld::Window* pParent,
419 const OUString& aDatName,
420 SvStream* pInStream,
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,
430 bool bCol,
431 bool bRow) = 0;
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 ;
447 //for dataform
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,
453 FillDir eFillDir,
454 FillCmd eFillCmd,
455 FillDateCmd eFillDateCmd,
456 const OUString& aStartStr,
457 double fStep,
458 double fMax,
459 SCSIZE nSelectHeight,
460 SCSIZE nSelectWidth,
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,
481 FieldUnit eFUnit,
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,
504 ScDPObject& rDPObj,
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,
514 sal_Int32 nDatePart,
515 const Date& rNullDate ) = 0;
517 virtual VclPtr<AbstractScDPShowDetailDlg> CreateScDPShowDetailDlg(weld::Window* pParent,
518 ScDPObject& rDPObj,
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,
559 SdrView* pView) = 0;
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;
572 // for tabpage
573 virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
575 protected:
576 ~ScAbstractDialogFactory() {}
579 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */