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