xref: /aoo4110/main/sc/inc/scabstdlg.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SC_ABSTDLG_HXX
24 #define _SC_ABSTDLG_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <tools/solar.h>
29 #include <tools/string.hxx>
30 #include <sfx2/sfxdlg.hxx>
31 #include <vcl/syswin.hxx>
32 #include <com/sun/star/uno/Sequence.hxx>
33 #include <vcl/field.hxx>
34 #include "sc.hrc"
35 #include "global.hxx"
36 #include "pivot.hxx"
37 #include "i18npool/lang.h"
38 
39 class ScAsciiOptions;
40 class ScAutoFormat;
41 class ScAutoFormatData;
42 class ScDocument;
43 struct ScImportSourceDesc;
44 class ScViewData;
45 class ScRangeName;
46 class ScQueryItem;
47 class ScImportOptions;
48 class SfxStyleSheetBase;
49 class ScDPObject;
50 struct ScPivotFuncData;
51 struct ScDPNumGroupInfo;
52 //<!--Added by PengYunQuan for Validity Cell Range Picker
53 class ScTabViewShell;
54 //-->Added by PengYunQuan for Validity Cell Range Picker
55 
56 namespace com { namespace sun { namespace star { namespace sheet {
57     struct DataPilotFieldReference;
58 } } } }
59 
60 class AbstractScImportAsciiDlg : public VclAbstractDialog  //add for ScImportAsciiDlg
61 {
62 public:
63     virtual void                        GetOptions( ScAsciiOptions& rOpt ) = 0;
64     virtual void                        SetTextToColumnsMode() = 0;
65     virtual void                        SaveParameters() = 0;
66 };
67 
68 
69 class AbstractScAutoFormatDlg : public VclAbstractDialog  //add for ScAutoFormatDlg
70 {
71 public:
72 	virtual sal_uInt16 GetIndex() const = 0 ;
73 	virtual String GetCurrFormatName() = 0;
74 };
75 
76 class AbstractScColRowLabelDlg : public VclAbstractDialog  //add for ScColRowLabelDlg
77 {
78 public:
79 	virtual sal_Bool IsCol() = 0;
80 	virtual sal_Bool IsRow() = 0;
81 };
82 
83 class AbstractScDataPilotDatabaseDlg  :public VclAbstractDialog  //add for ScDataPilotDatabaseDlg
84 {
85 public:
86 	virtual void	GetValues( ScImportSourceDesc& rDesc ) = 0;
87 };
88 
89 class AbstractScDataPilotSourceTypeDlg  : public VclAbstractDialog  //add for ScDataPilotSourceTypeDlg
90 {
91 public:
92 	virtual sal_Bool	IsDatabase() const = 0;
93 	virtual sal_Bool	IsExternal() const = 0;
94 };
95 
96 class AbstractScDataPilotServiceDlg : public VclAbstractDialog  //add for ScDataPilotServiceDlg
97 {
98 public:
99 	virtual String	GetServiceName() const = 0;
100 	virtual String	GetParSource() const = 0 ;
101 	virtual String	GetParName() const = 0 ;
102 	virtual String	GetParUser() const = 0;
103 	virtual String	GetParPass() const = 0;
104 };
105 
106 class AbstractScDeleteCellDlg : public VclAbstractDialog  //add for ScDeleteCellDlg
107 {
108 public:
109 	virtual DelCellCmd GetDelCellCmd() const = 0;
110 };
111 
112 class AbstractScDeleteContentsDlg: public VclAbstractDialog  //add for ScDeleteContentsDlg
113 {
114 public:
115 	virtual void	DisableObjects() = 0 ;
116 	virtual sal_uInt16	GetDelContentsCmdBits() const = 0;
117 };
118 
119 class AbstractScFillSeriesDlg: public VclAbstractDialog  //add for ScFillSeriesDlg
120 {
121 public:
122 	virtual FillDir		GetFillDir() const = 0;
123 	virtual FillCmd		GetFillCmd() const = 0;
124 	virtual FillDateCmd	GetFillDateCmd() const = 0;
125 	virtual double		GetStart() const = 0;
126 	virtual double		GetStep() const	= 0;
127 	virtual double		GetMax() const = 0;
128 	virtual String		GetStartStr() const = 0;
129 	virtual void		SetEdStartValEnabled(sal_Bool bFlag=sal_False) = 0;
130 };
131 
132 class AbstractScGroupDlg :  public VclAbstractDialog  //add for ScGroupDlg
133 {
134 public:
135 	virtual sal_Bool GetColsChecked() const = 0;
136 };
137 
138 class AbstractScInsertCellDlg : public VclAbstractDialog  //add for ScInsertCellDlg
139 {
140 public:
141 	virtual InsCellCmd GetInsCellCmd() const = 0;
142 };
143 
144 class AbstractScInsertContentsDlg : public VclAbstractDialog  //add for ScInsertContentsDlg
145 {
146 public:
147 	virtual sal_uInt16		GetInsContentsCmdBits() const = 0;
148 	virtual sal_uInt16		GetFormulaCmdBits() const = 0 ;
149 	virtual sal_Bool		IsSkipEmptyCells() const = 0;
150 	virtual sal_Bool 		IsLink() const = 0;
151 	virtual void	SetFillMode( sal_Bool bSet ) = 0;
152 	virtual void	SetOtherDoc( sal_Bool bSet ) = 0;
153 	virtual sal_Bool 		IsTranspose() const = 0;
154 	virtual void	SetChangeTrack( sal_Bool bSet ) = 0;
155 	virtual void	SetCellShiftDisabled( int nDisable ) = 0;
156 	virtual InsCellCmd	GetMoveMode() = 0;
157 };
158 
159 class AbstractScInsertTableDlg : public VclAbstractDialog  //add for ScInsertTableDlg
160 {
161 public:
162 	virtual sal_Bool			GetTablesFromFile()	= 0;
163 	virtual sal_Bool			GetTablesAsLink()	= 0;
164 	virtual const String*	GetFirstTable( sal_uInt16* pN = NULL ) = 0;
165 	virtual ScDocShell*		GetDocShellTables()	= 0;
166 	virtual sal_Bool			IsTableBefore() = 0;
167 	virtual sal_uInt16			GetTableCount() = 0;
168 	virtual const String*	GetNextTable( sal_uInt16* pN = NULL ) = 0;
169 
170 };
171 
172 class AbstractScSelEntryDlg : public VclAbstractDialog  //add for ScSelEntryDlg
173 {
174 public:
175 	virtual String GetSelectEntry() const = 0;
176 };
177 
178 class AbstractScLinkedAreaDlg : public VclAbstractDialog2  //add for ScLinkedAreaDlg
179 {
180 public:
181 	virtual void			InitFromOldLink( const String& rFile, const String& rFilter,
182 										const String& rOptions, const String& rSource,
183 										sal_uLong nRefresh ) = 0;
184 	virtual String			GetURL() = 0;
185 	virtual String			GetFilter() = 0;		// may be empty
186 	virtual String			GetOptions() = 0;		// filter options
187 	virtual String			GetSource() = 0;		// separated by ";"
188 	virtual sal_uLong			GetRefresh() = 0;		// 0 if disabled
189 };
190 
191 class AbstractScMetricInputDlg : public VclAbstractDialog  //add for ScMetricInputDlg
192 {
193 public:
194 	virtual long GetInputValue( FieldUnit eUnit = FUNIT_TWIP ) const = 0;
195 };
196 
197 class AbstractScMoveTableDlg : public VclAbstractDialog  //add for ScMoveTableDlg
198 {
199 public:
200 	virtual sal_uInt16	GetSelectedDocument		() const = 0;
201 	virtual sal_uInt16	GetSelectedTable		() const = 0;
202 	virtual sal_Bool	GetCopyTable			() const = 0;
203 	virtual void	SetCopyTable			(sal_Bool bFlag=sal_True) = 0;
204 	virtual void	EnableCopyTable			(sal_Bool bFlag=sal_True) = 0;
205 };
206 
207 class AbstractScNameCreateDlg : public VclAbstractDialog  //add for ScNameCreateDlg
208 {
209 public:
210 	virtual sal_uInt16			GetFlags() const = 0;
211 };
212 
213 class AbstractScNamePasteDlg : public VclAbstractDialog  //add for ScNamePasteDlg
214 {
215 public:
216 	virtual String			GetSelectedName() const = 0;
217 };
218 
219 class AbstractScPivotFilterDlg : public VclAbstractDialog  //add for ScPivotFilterDlg
220 {
221 public:
222 	virtual const ScQueryItem&	GetOutputItem() = 0;
223 };
224 
225 class AbstractScDPFunctionDlg : public VclAbstractDialog  //add for ScDPFunctionDlg
226 {
227 public:
228     virtual sal_uInt16  GetFuncMask() const = 0;
229     virtual ::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const = 0;
230 };
231 
232 class AbstractScDPSubtotalDlg : public VclAbstractDialog  //add for ScDPSubtotalDlg
233 {
234 public:
235     virtual sal_uInt16  GetFuncMask() const = 0;
236     virtual void    FillLabelData( ScDPLabelData& rLabelData ) const = 0;
237 };
238 
239 class AbstractScDPNumGroupDlg : public VclAbstractDialog
240 {
241 public:
242     virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
243 };
244 
245 class AbstractScDPDateGroupDlg : public VclAbstractDialog
246 {
247 public:
248     virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
249     virtual sal_Int32 GetDatePart() const = 0;
250 };
251 
252 class AbstractScDPShowDetailDlg : public VclAbstractDialog  //add for ScDPShowDetailDlg
253 {
254 public:
255     virtual String  GetDimensionName() const = 0;
256 };
257 
258 class AbstractScNewScenarioDlg : public VclAbstractDialog  //add for ScNewScenarioDlg
259 {
260 public:
261 
262 	virtual void SetScenarioData( const String& rName, const String& rComment,
263 							const Color& rColor, sal_uInt16 nFlags ) = 0;
264 
265 	virtual void GetScenarioData( String& rName, String& rComment,
266 							Color& rColor, sal_uInt16& rFlags ) const = 0;
267 };
268 
269 class AbstractScShowTabDlg : public VclAbstractDialog  //add for ScShowTabDlg
270 {
271 public:
272     virtual void    Insert( const String& rString, sal_Bool bSelected ) = 0;
273 	virtual sal_uInt16	GetSelectEntryCount() const = 0;
274 	virtual void SetDescription(const String& rTitle, const String& rFixedText, const rtl::OString& nDlgHelpId, const rtl::OString& nLbHelpId ) = 0;
275 	virtual String	GetSelectEntry(sal_uInt16 nPos) const = 0;
276     virtual sal_uInt16  GetSelectEntryPos(sal_uInt16 nPos) const = 0;
277 };
278 
279 class AbstractScStringInputDlg :  public VclAbstractDialog  //add for ScStringInputDlg
280 {
281 public:
282 	virtual void GetInputString( String& rString ) const = 0;
283 };
284 
285 class AbstractScTabBgColorDlg : public VclAbstractDialog  //add for ScTabBgColorDlg
286 {
287 public:
288     virtual void GetSelectedColor( Color& rColor ) const = 0;
289 };
290 
291 class AbstractScImportOptionsDlg : public VclAbstractDialog  //add for ScImportOptionsDlg
292 {
293 public:
294 	virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
295 };
296 
297 class AbstractScTextImportOptionsDlg : public VclAbstractDialog //add for ScLangChooserDlg
298 {
299 public:
300     virtual LanguageType GetLanguageType() const = 0;
301     virtual bool IsDateConversionSet() const = 0;
302 };
303 
304 //-------Scabstract fractory ---------------------------
305 class ScAbstractDialogFactory
306 {
307 public:
308 	static ScAbstractDialogFactory* 	Create();
309 
310 	virtual 	AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg
311 																	SvStream* pInStream, int nId,
312 																	sal_Unicode cSep = '\t') = 0;
313 
314     virtual     AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ) = 0;
315 
316 	virtual		AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window*					pParent, //add for ScAutoFormatDlg
317 																ScAutoFormat*				pAutoFormat,
318 																const ScAutoFormatData*    pSelFormatData,
319 																ScDocument*                pDoc,
320 																int nId) = 0;
321 	virtual AbstractScColRowLabelDlg * CreateScColRowLabelDlg (Window* pParent, //add for ScColRowLabelDlg
322 																int nId,
323 																sal_Bool bCol = sal_False,
324 																sal_Bool bRow = sal_False) = 0;
325 
326 	virtual VclAbstractDialog * CreateScColOrRowDlg( Window*			pParent, //add for ScColOrRowDlg
327 													const String&	rStrTitle,
328 													const String&	rStrLabel,
329 													int nId,
330 													sal_Bool				bColDefault = sal_True ) = 0;
331     virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0;  //add for ScSortWarningDlg
332 	virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ) = 0; //add for ScDataPilotDatabaseDlg
333 
334 	virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) = 0; //add for ScDataPilotSourceTypeDlg
335 
336 	virtual AbstractScDataPilotServiceDlg * CreateScDataPilotServiceDlg( Window* pParent, //add for ScDataPilotServiceDlg
337 																		const com::sun::star::uno::Sequence<rtl::OUString>& rServices,
338 																		int nId ) = 0;
339 
340 	virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, sal_Bool bDisallowCellMove = sal_False ) = 0 ; //add for ScDeleteCellDlg
341 
342 	virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg
343 																 sal_uInt16  nCheckDefaults = 0 ) = 0;
344 	virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( Window*		pParent, //add for ScFillSeriesDlg
345 															ScDocument&	rDocument,
346 															FillDir		eFillDir,
347 															FillCmd		eFillCmd,
348 															FillDateCmd	eFillDateCmd,
349 															String			aStartStr,
350 															double			fStep,
351 															double			fMax,
352 															sal_uInt16			nPossDir,
353 															int nId) = 0;
354 
355 	virtual AbstractScGroupDlg * CreateAbstractScGroupDlg( Window* pParent, //add for ScGroupDlg
356 															sal_uInt16	nResId,
357 															int nId,
358 															sal_Bool	bUnGroup = sal_False,
359 															sal_Bool	bRows    = sal_True  ) = 0;
360 
361 	virtual AbstractScInsertCellDlg * CreateScInsertCellDlg( Window* pParent, //add for ScInsertCellDlg
362 																int nId,
363 															sal_Bool bDisallowCellMove = sal_False ) = 0;
364 
365 	virtual AbstractScInsertContentsDlg * CreateScInsertContentsDlg( Window*		pParent, //add for ScInsertContentsDlg
366 																	int nId,
367 																	sal_uInt16  		nCheckDefaults = 0,
368 																	const String*	pStrTitle = NULL ) = 0;
369 
370 	virtual AbstractScInsertTableDlg * CreateScInsertTableDlg ( Window* pParent, ScViewData& rViewData,  //add for ScInsertTableDlg
371                                                                 SCTAB nTabCount, bool bFromFile, int nId) = 0;
372 
373 	virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
374 															sal_uInt16	nResId,
375 														const String& aTitle,
376 														const String& aLbTitle,
377 																List& 	aEntryList,
378 															int nId ) = 0;
379 	virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg (  Window* pParent, int nId) = 0; //add for ScLinkedAreaDlg
380 
381 	virtual AbstractScMetricInputDlg * CreateScMetricInputDlg (  Window*		pParent, //add for ScMetricInputDlg
382 																sal_uInt16		nResId,		// Ableitung fuer jeden Dialog!
383 																long			nCurrent,
384 																long			nDefault,
385 																int nId ,
386 																FieldUnit		eFUnit	  = FUNIT_MM,
387 																sal_uInt16		nDecimals = 2,
388 																long			nMaximum  = 1000,
389 																long			nMinimum  = 0,
390 																long			nFirst	  = 1,
391 																long          nLast     = 100 ) = 0;
392 
393 	virtual AbstractScMoveTableDlg * CreateScMoveTableDlg(  Window* pParent, int nId ) = 0; //add for ScMoveTableDlg
394 
395 	virtual AbstractScNameCreateDlg * CreateScNameCreateDlg ( Window * pParent, sal_uInt16 nFlags, int nId ) = 0; //add for ScNameCreateDlg
396 
397 	virtual AbstractScNamePasteDlg * CreateScNamePasteDlg ( Window * pParent, const ScRangeName* pList, //add for ScNamePasteDlg
398 															int nId , sal_Bool bInsList=sal_True ) = 0;
399 
400 	virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, //add for ScPivotFilterDlg
401 																const SfxItemSet&	rArgSet, sal_uInt16 nSourceTab , int nId ) = 0;
402 
403     virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, int nId,
404                                                                 const ScDPLabelDataVector& rLabelVec,
405                                                                 const ScDPLabelData& rLabelData,
406                                                                 const ScPivotFuncData& rFuncData ) = 0;
407 
408     virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, int nId,
409                                                                 ScDPObject& rDPObj,
410                                                                 const ScDPLabelData& rLabelData,
411                                                                 const ScPivotFuncData& rFuncData,
412                                                                 const ScDPNameVec& rDataFields,
413                                                                 bool bEnableLayout ) = 0;
414 
415     virtual AbstractScDPNumGroupDlg * CreateScDPNumGroupDlg( Window* pParent,
416                                                                 int nId,
417                                                                 const ScDPNumGroupInfo& rInfo ) = 0;
418 
419     virtual AbstractScDPDateGroupDlg * CreateScDPDateGroupDlg( Window* pParent,
420                                                                 int nId,
421                                                                 const ScDPNumGroupInfo& rInfo,
422                                                                 sal_Int32 nDatePart,
423                                                                 const Date& rNullDate ) = 0;
424 
425     virtual AbstractScDPShowDetailDlg * CreateScDPShowDetailDlg( Window* pParent, int nId,
426                                                                 ScDPObject& rDPObj,
427                                                                 sal_uInt16 nOrient ) = 0;
428 
429 	virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const String& rName, //add for ScNewScenarioDlg
430 																int nId,
431 																sal_Bool bEdit = sal_False, sal_Bool bSheetProtected = sal_False ) = 0;
432 	virtual AbstractScShowTabDlg * CreateScShowTabDlg ( Window* pParent, int nId ) = 0; //add for ScShowTabDlg
433 
434 	virtual AbstractScStringInputDlg * CreateScStringInputDlg (  Window* pParent, //add for ScStringInputDlg
435 																const String& rTitle,
436 																const String& rEditTitle,
437 																const String& rDefault,
438 																const rtl::OString& sHelpId, const rtl::OString& sEditHelpId,
439 																int nId ) = 0;
440 
441     virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg (  Window* pParent, //add for ScTabBgColorDlg
442                                                                 const String& rTitle, //Dialog Title
443                                                                 const String& rTabBgColorNoColorText, //Label for no tab color
444                                                                 const Color& rDefaultColor, //Currently selected Color
445                                                                 const rtl::OString& ,
446                                                                 int nId ) = 0;
447 
448 	virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* 				pParent, //add for ScImportOptionsDlg
449 																	int nId,
450 																	sal_Bool                    bAscii = sal_True,
451 																	const ScImportOptions*	pOptions = NULL,
452 																	const String*			pStrTitle = NULL,
453 																	sal_Bool                    bMultiByte = sal_False,
454 																	sal_Bool                    bOnlyDbtoolsEncodings = sal_False,
455 																	sal_Bool                    bImport = sal_True ) = 0;
456 
457 	virtual SfxAbstractTabDialog * CreateScAttrDlg( SfxViewFrame*	 pFrame, //add for ScAttrDlg
458 													Window*			 pParent,
459 													const SfxItemSet* pCellAttrs,
460 													int nId) = 0;
461 
462 	virtual SfxAbstractTabDialog * CreateScHFEditDlg( SfxViewFrame*		pFrame, //add for ScHFEditDlg
463 													Window*			pParent,
464 													const SfxItemSet&	rCoreSet,
465 													const String&		rPageStyle,
466 													int nId,
467 													sal_uInt16				nResId = RID_SCDLG_HFEDIT ) = 0;
468 
469 	virtual SfxAbstractTabDialog * CreateScStyleDlg( Window*				pParent,//add for ScStyleDlg
470 													SfxStyleSheetBase&	rStyleBase,
471 													sal_uInt16				nRscId,
472 													int nId) = 0;
473 
474 	virtual SfxAbstractTabDialog * CreateScSubTotalDlg( Window*				pParent, //add for ScSubTotalDlg
475 														const SfxItemSet*	pArgSet,
476 														int nId) = 0;
477 
478 	virtual SfxAbstractTabDialog * CreateScCharDlg( Window* pParent, const SfxItemSet* pAttr,//add for ScCharDlg
479 													const SfxObjectShell* pDocShell, int nId ) = 0;
480 
481 	virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,//add for ScParagraphDlg
482 															int nId ) = 0;
483 
484 	//<!--Modified by PengYunQuan for Validity Cell Range Picker
485 	//virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg
486 	//												const SfxItemSet* pArgSet,int nId  ) = 0;
487 
488 	virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg
489 														const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh  ) = 0;
490 	//-->Modified by PengYunQuan for Validity Cell Range Picker
491 	virtual SfxAbstractTabDialog * CreateScSortDlg( Window*			 pParent, //add for ScSortDlg
492 													const SfxItemSet* pArgSet,int nId ) = 0;
493 	// for tabpage
494 	virtual CreateTabPage				GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
495 	virtual GetTabPageRanges			GetTabPageRangesFunc( sal_uInt16 nId ) = 0;
496 };
497 #endif
498 
499