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 24 #ifndef _SVX_DOCRECOVERY_HXX 25 #define _SVX_DOCRECOVERY_HXX 26 27 #include <vcl/tabpage.hxx> 28 #ifndef _SV_TABDIALOG_HXX 29 #include <vcl/tabdlg.hxx> 30 #endif 31 #include <vcl/dialog.hxx> 32 #ifndef _SV_BUTTON_HXX 33 #include <vcl/button.hxx> 34 #endif 35 #include <vcl/fixed.hxx> 36 #include <svtools/svmedit2.hxx> 37 #include <svtools/svtreebx.hxx> 38 #include <svx/simptabl.hxx> 39 40 #include <cppuhelper/implbase1.hxx> 41 #include <cppuhelper/implbase2.hxx> 42 #include <com/sun/star/task/XStatusIndicatorFactory.hpp> 43 #include <com/sun/star/frame/XStatusListener.hpp> 44 #include <com/sun/star/frame/XDispatch.hpp> 45 #include <com/sun/star/lang/XComponent.hpp> 46 47 //=============================================== 48 // const 49 50 #define RECOVERY_CMDPART_PROTOCOL ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:") 51 52 #define RECOVERY_CMDPART_DO_PREPARE_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("/doPrepareEmergencySave" ) 53 #define RECOVERY_CMDPART_DO_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("/doEmergencySave" ) 54 #define RECOVERY_CMDPART_DO_RECOVERY ::rtl::OUString::createFromAscii("/doAutoRecovery" ) 55 #define RECOVERY_CMDPART_DO_CRASHREPORT ::rtl::OUString::createFromAscii("/doCrashReport" ) 56 #define RECOVERY_CMDPART_DO_ENTRY_BACKUP ::rtl::OUString::createFromAscii("/doEntryBackup" ) 57 #define RECOVERY_CMDPART_DO_ENTRY_CLEANUP ::rtl::OUString::createFromAscii("/doEntryCleanUp" ) 58 59 #define RECOVERY_CMD_DO_PREPARE_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doPrepareEmergencySave") 60 #define RECOVERY_CMD_DO_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEmergencySave" ) 61 #define RECOVERY_CMD_DO_RECOVERY ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doAutoRecovery" ) 62 #define RECOVERY_CMD_DO_CRASHREPORT ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doCrashReport" ) 63 #define RECOVERY_CMD_DO_ENTRY_BACKUP ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEntryBackup" ) 64 #define RECOVERY_CMD_DO_ENTRY_CLEANUP ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEntryCleanUp" ) 65 66 #define SERVICENAME_PROGRESSFACTORY ::rtl::OUString::createFromAscii("com.sun.star.task.StatusIndicatorFactory") 67 #define SERVICENAME_URLTRANSFORMER ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) 68 #define SERVICENAME_RECOVERYCORE ::rtl::OUString::createFromAscii("com.sun.star.frame.AutoRecovery" ) 69 #define SERVICENAME_FOLDERPICKER ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FolderPicker" ) 70 #define SERVICENAME_DESKTOP ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop" ) 71 72 #define PROP_PARENTWINDOW ::rtl::OUString::createFromAscii("Window" ) 73 #define PROP_STATUSINDICATOR ::rtl::OUString::createFromAscii("StatusIndicator" ) 74 #define PROP_DISPATCHASYNCHRON ::rtl::OUString::createFromAscii("DispatchAsynchron") 75 #define PROP_SAVEPATH ::rtl::OUString::createFromAscii("SavePath" ) 76 #define PROP_ENTRYID ::rtl::OUString::createFromAscii("EntryID" ) 77 #define PROP_ALLOWPARENTSHOW ::rtl::OUString::createFromAscii("AllowParentShow" ) 78 79 #define STATEPROP_ID ::rtl::OUString::createFromAscii("ID" ) 80 #define STATEPROP_STATE ::rtl::OUString::createFromAscii("DocumentState") 81 #define STATEPROP_ORGURL ::rtl::OUString::createFromAscii("OriginalURL" ) 82 #define STATEPROP_TEMPURL ::rtl::OUString::createFromAscii("TempURL" ) 83 #define STATEPROP_FACTORYURL ::rtl::OUString::createFromAscii("FactoryURL" ) 84 #define STATEPROP_TEMPLATEURL ::rtl::OUString::createFromAscii("TemplateURL" ) 85 #define STATEPROP_TITLE ::rtl::OUString::createFromAscii("Title" ) 86 #define STATEPROP_MODULE ::rtl::OUString::createFromAscii("Module" ) 87 88 #define RECOVERY_OPERATIONSTATE_START ::rtl::OUString::createFromAscii("start" ) 89 #define RECOVERY_OPERATIONSTATE_STOP ::rtl::OUString::createFromAscii("stop" ) 90 #define RECOVERY_OPERATIONSTATE_UPDATE ::rtl::OUString::createFromAscii("update") 91 92 #define DLG_RET_UNKNOWN -1 93 #define DLG_RET_OK 1 94 #define DLG_RET_CANCEL 0 95 #define DLG_RET_BACK 100 96 #define DLG_RET_OK_AUTOLUNCH 101 97 98 //=============================================== 99 // namespace 100 101 namespace svx{ 102 namespace DocRecovery{ 103 104 #ifdef css 105 # error "Who uses css? I need it as temp. namespace alias!" 106 #else 107 # define css ::com::sun::star 108 #endif 109 110 //=============================================== 111 enum EDocStates 112 { 113 /* TEMP STATES */ 114 115 /// default state, if a document was new created or loaded 116 E_UNKNOWN = 0, 117 /// modified against the original file 118 E_MODIFIED = 1, 119 /// an active document can be postponed to be saved later. 120 E_POSTPONED = 2, 121 /// was already handled during one AutoSave/Recovery session. 122 E_HANDLED = 4, 123 /** an action was started (saving/loading) ... Can be interesting later if the process may be was interrupted by an exception. */ 124 E_TRY_SAVE = 8, 125 E_TRY_LOAD_BACKUP = 16, 126 E_TRY_LOAD_ORIGINAL = 32, 127 128 /* FINAL STATES */ 129 130 /// the Auto/Emergency saved document isnt useable any longer 131 E_DAMAGED = 64, 132 /// the Auto/Emergency saved document isnt realy up-to-date (some changes can be missing) 133 E_INCOMPLETE = 128, 134 /// the Auto/Emergency saved document was processed successfully 135 E_SUCCEDED = 512 136 }; 137 138 //=============================================== 139 enum ERecoveryState 140 { 141 E_SUCCESSFULLY_RECOVERED, 142 E_ORIGINAL_DOCUMENT_RECOVERED, 143 E_RECOVERY_FAILED, 144 E_RECOVERY_IS_IN_PROGRESS, 145 E_NOT_RECOVERED_YET 146 }; 147 148 //=============================================== 149 struct TURLInfo 150 { 151 public: 152 153 /// unique ID, which is specified by the underlying autorecovery core! 154 sal_Int32 ID; 155 156 /// the full qualified document URL 157 ::rtl::OUString OrgURL; 158 159 /// the full qualified URL of the temp. file (if it's exists) 160 ::rtl::OUString TempURL; 161 162 /// a may be existing factory URL (e.g. for untitled documents) 163 ::rtl::OUString FactoryURL; 164 165 /// may be the document base on a template file !? 166 ::rtl::OUString TemplateURL; 167 168 /// the pure file name, without path, disc etcpp. 169 ::rtl::OUString DisplayName; 170 171 /// the application module, where this document was loaded 172 ::rtl::OUString Module; 173 174 /// state info as e.g. VALID, CORRUPTED, NON EXISTING ... 175 sal_Int32 DocState; 176 177 /// ui representation for DocState! 178 ERecoveryState RecoveryState; 179 180 /// standard icon 181 Image StandardImage; 182 183 /// high contrast icon 184 Image HCImage; 185 186 public: 187 TURLInfosvx::DocRecovery::TURLInfo188 TURLInfo() 189 : ID (-1 ) 190 , DocState (E_UNKNOWN ) 191 , RecoveryState(E_NOT_RECOVERED_YET) 192 {} 193 }; 194 195 //=============================================== 196 typedef ::std::vector< TURLInfo > TURLList; 197 198 //=============================================== 199 class IRecoveryUpdateListener 200 { 201 public: 202 203 // inform listener about changed items, which should be refreshed 204 virtual void updateItems() = 0; 205 206 // inform listener about starting of the asynchronous recovery operation 207 virtual void start() = 0; 208 209 // inform listener about ending of the asynchronous recovery operation 210 virtual void end() = 0; 211 212 // TODO 213 virtual void stepNext(TURLInfo* pItem) = 0; 214 }; 215 216 //=============================================== 217 class RecoveryCore : public ::cppu::WeakImplHelper1< css::frame::XStatusListener > 218 { 219 //------------------------------------------- 220 // types, const 221 public: 222 223 //------------------------------------------- 224 // member 225 private: 226 227 /// TODO 228 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; 229 230 /// TODO 231 css::uno::Reference< css::frame::XDispatch > m_xRealCore; 232 233 /// TODO 234 css::uno::Reference< css::task::XStatusIndicator > m_xProgress; 235 236 /// TODO 237 TURLList m_lURLs; 238 239 /// TODO 240 IRecoveryUpdateListener* m_pListener; 241 242 /** @short knows the reason, why we listen on our internal m_xRealCore 243 member. 244 245 @descr Because we listen for different operations 246 on the core dispatch implementation, we must know, 247 which URL we have to use for deregistration! 248 */ 249 sal_Bool m_bListenForSaving; 250 251 //------------------------------------------- 252 // native interface 253 public: 254 255 //--------------------------------------- 256 /** @short TODO */ 257 RecoveryCore(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , 258 sal_Bool bUsedForSaving); 259 260 //--------------------------------------- 261 /** @short TODO */ 262 virtual ~RecoveryCore(); 263 264 //--------------------------------------- 265 /** @short TODO */ 266 virtual css::uno::Reference< css::lang::XMultiServiceFactory > getSMGR(); 267 268 //--------------------------------------- 269 /** @short TODO */ 270 virtual TURLList* getURLListAccess(); 271 272 //--------------------------------------- 273 /** @short TODO */ 274 virtual sal_Bool existsBrokenTempEntries(); 275 virtual sal_Bool existsNonRecoveredEntries(); 276 static sal_Bool isBrokenTempEntry(const TURLInfo& rInfo); 277 virtual void saveBrokenTempEntries(const ::rtl::OUString& sSaveDir); 278 virtual void saveAllTempEntries(const ::rtl::OUString& sSaveDir); 279 virtual void forgetBrokenTempEntries(); 280 virtual void forgetAllRecoveryEntries(); 281 void forgetBrokenRecoveryEntries(); 282 283 //--------------------------------------- 284 /** @short TODO */ 285 virtual void setProgressHandler(const css::uno::Reference< css::task::XStatusIndicator >& xProgress); 286 287 //--------------------------------------- 288 /** @short TODO */ 289 virtual void setUpdateListener(IRecoveryUpdateListener* pListener); 290 291 //--------------------------------------- 292 /** @short TODO */ 293 virtual void doEmergencySavePrepare(); 294 virtual void doEmergencySave(); 295 virtual void doRecovery(); 296 297 //--------------------------------------- 298 /** @short TODO */ 299 static ERecoveryState mapDocState2RecoverState(sal_Int32 eDocState); 300 301 //------------------------------------------- 302 // uno interface 303 public: 304 305 // css.frame.XStatusListener 306 virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& aEvent) 307 throw(css::uno::RuntimeException); 308 309 // css.lang.XEventListener 310 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) 311 throw(css::uno::RuntimeException); 312 313 //------------------------------------------- 314 // helper 315 private: 316 317 //--------------------------------------- 318 /** @short starts listening on the internal EmergencySave/AutoRecovery core. 319 */ 320 void impl_startListening(); 321 322 //--------------------------------------- 323 /** @short stop listening on the internal EmergencySave/AutoRecovery core. 324 */ 325 void impl_stopListening(); 326 327 //--------------------------------------- 328 /** @short TODO */ 329 css::util::URL impl_getParsedURL(const ::rtl::OUString& sURL); 330 }; 331 332 //=============================================== 333 class PluginProgressWindow : public Window 334 { 335 private: 336 337 css::uno::Reference< css::lang::XComponent > m_xProgress; 338 339 public: 340 341 PluginProgressWindow( Window* pParent , 342 const css::uno::Reference< css::lang::XComponent >& xProgress); 343 ~PluginProgressWindow(); 344 }; 345 346 class PluginProgress : public ::cppu::WeakImplHelper2< css::task::XStatusIndicator , 347 css::lang::XComponent > 348 { 349 350 //------------------------------------------- 351 // member 352 private: 353 354 /** @short TODO */ 355 css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory; 356 357 css::uno::Reference< css::task::XStatusIndicator > m_xProgress; 358 359 PluginProgressWindow* m_pPlugProgressWindow; 360 361 //------------------------------------------- 362 // native interface 363 public: 364 365 //--------------------------------------- 366 /** @short TODO */ 367 PluginProgress( Window* pParent, 368 const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); 369 370 //--------------------------------------- 371 /** @short TODO */ 372 virtual ~PluginProgress(); 373 374 //--------------------------------------- 375 /** @short TODO */ 376 Window* getPlugWindow(); 377 378 //------------------------------------------- 379 // uno interface 380 public: 381 382 //--------------------------------------- 383 // XStatusIndicator 384 virtual void SAL_CALL start(const ::rtl::OUString& sText , 385 sal_Int32 nRange) 386 throw(css::uno::RuntimeException); 387 388 virtual void SAL_CALL end() 389 throw(css::uno::RuntimeException); 390 391 virtual void SAL_CALL setText(const ::rtl::OUString& sText) 392 throw(css::uno::RuntimeException); 393 394 virtual void SAL_CALL setValue(sal_Int32 nValue) 395 throw(css::uno::RuntimeException); 396 397 virtual void SAL_CALL reset() 398 throw(css::uno::RuntimeException); 399 400 //--------------------------------------- 401 // XComponent 402 virtual void SAL_CALL dispose() 403 throw(css::uno::RuntimeException); 404 405 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& xListener) 406 throw(css::uno::RuntimeException); 407 408 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener) 409 throw(css::uno::RuntimeException); 410 }; 411 412 //=============================================== 413 class IExtendedTabPage : public TabPage 414 { 415 //------------------------------------------- 416 // member 417 protected: 418 419 short m_nResult; 420 421 //------------------------------------------- 422 // interface 423 public: 424 IExtendedTabPage(Window * pParent,WinBits nStyle=0)425 IExtendedTabPage( Window* pParent, WinBits nStyle = 0 ) 426 : TabPage( pParent, nStyle ) 427 , m_nResult(DLG_RET_UNKNOWN) 428 {} 429 IExtendedTabPage(Window * pParent,const ResId & rResId)430 IExtendedTabPage( Window* pParent, const ResId& rResId ) 431 : TabPage( pParent, rResId ) 432 , m_nResult(DLG_RET_UNKNOWN) 433 {} 434 ~IExtendedTabPage()435 virtual ~IExtendedTabPage() 436 {} 437 438 virtual short execute() = 0; 439 virtual void setDefButton() = 0; 440 }; 441 442 typedef ::std::vector< IExtendedTabPage* > TTabPageList; 443 444 //=============================================== 445 class TabDialog4Recovery : public TabDialog 446 { 447 //------------------------------------------- 448 // member 449 private: 450 451 TTabPageList m_lTabPages; 452 TTabPageList::iterator m_pActualPage; 453 454 //------------------------------------------- 455 // interface 456 public: 457 458 TabDialog4Recovery(Window* pParent); 459 virtual ~TabDialog4Recovery(); 460 461 virtual void addTabPage(IExtendedTabPage* pPage); 462 virtual short Execute(); 463 }; 464 465 //=============================================== 466 class SaveDialog : public IExtendedTabPage 467 { 468 //------------------------------------------- 469 // member 470 private: 471 472 Window m_aTitleWin; 473 FixedText m_aTitleFT; 474 FixedLine m_aTitleFL; 475 FixedText m_aDescrFT; 476 FixedText m_aFileListFT; 477 ListBox m_aFileListLB; 478 FixedLine m_aBottomFL; 479 OKButton m_aOkBtn; 480 481 RecoveryCore* m_pCore; 482 483 //------------------------------------------- 484 // interface 485 public: 486 487 //--------------------------------------- 488 /** @short create all child controls of this dialog. 489 490 @descr The dialog isnt shown nor it starts any 491 action by itself! 492 493 @param pParent 494 can point to a parent window. 495 If its set to 0, the defmodal-dialog-parent 496 is used automaticly. 497 498 @param pCore 499 provides access to the recovery core service 500 and the current list of open documents, 501 which should be shown inside this dialog. 502 */ 503 SaveDialog(Window* pParent, 504 RecoveryCore* pCore ); 505 506 //--------------------------------------- 507 /** @short free all controls and used memory. */ 508 virtual ~SaveDialog(); 509 510 //--------------------------------------- 511 /** @short TODO*/ 512 virtual short execute(); 513 514 //--------------------------------------- 515 /** @short TODO*/ 516 virtual void setDefButton(); 517 518 DECL_LINK(OKButtonHdl, void*); 519 }; 520 521 //=============================================== 522 class SaveProgressDialog : public ModalDialog 523 , public IRecoveryUpdateListener 524 { 525 //------------------------------------------- 526 // member 527 private: 528 529 FixedText m_aHintFT; 530 FixedText m_aProgrFT; 531 String m_aProgrBaseTxt; 532 Window m_aProgrParent; 533 534 // @short TODO 535 RecoveryCore* m_pCore; 536 537 // @short TODO 538 css::uno::Reference< css::task::XStatusIndicator > m_xProgress; 539 540 //------------------------------------------- 541 // interface 542 public: 543 544 //--------------------------------------- 545 /** @short create all child controls of this dialog. 546 547 @descr The dialog isnt shown nor it starts any 548 action by itself! 549 550 @param pParent 551 can point to a parent window. 552 If its set to 0, the defmodal-dialog-parent 553 is used automaticly. 554 555 @param pCore 556 used to start emegrency save. 557 */ 558 SaveProgressDialog(Window* pParent, 559 RecoveryCore* pCore ); 560 561 //--------------------------------------- 562 /** @short free all controls and used memory. */ 563 virtual ~SaveProgressDialog(); 564 565 //--------------------------------------- 566 /** @short start the emergency save operation. */ 567 virtual short Execute(); 568 569 // IRecoveryUpdateListener 570 virtual void updateItems(); 571 virtual void stepNext(TURLInfo* pItem); 572 virtual void start(); 573 virtual void end(); 574 }; 575 576 //=============================================== 577 class RecovDocListEntry : public SvLBoxString 578 { 579 //------------------------------------------- 580 // interface 581 private: 582 583 //------------------------------------------- 584 // interface 585 public: 586 587 //--------------------------------------- 588 /** @short TODO */ 589 RecovDocListEntry( SvLBoxEntry* pEntry, 590 sal_uInt16 nFlags, 591 const String& sText ); 592 593 //--------------------------------------- 594 /** @short TODO */ 595 virtual void Paint(const Point& aPos , 596 SvLBox& aDevice, 597 sal_uInt16 nFlags , 598 SvLBoxEntry* pEntry ); 599 }; 600 601 //=============================================== 602 class RecovDocList : public SvxSimpleTable 603 { 604 //------------------------------------------- 605 // member 606 public: 607 608 Image m_aGreenCheckImg; 609 Image m_aYellowCheckImg; 610 Image m_aRedCrossImg; 611 Image m_aGreenCheckImgHC; 612 Image m_aYellowCheckImgHC; 613 Image m_aRedCrossImgHC; 614 615 String m_aSuccessRecovStr; 616 String m_aOrigDocRecovStr; 617 String m_aRecovFailedStr; 618 String m_aRecovInProgrStr; 619 String m_aNotRecovYetStr; 620 621 //------------------------------------------- 622 // interface 623 public: 624 625 //--------------------------------------- 626 /** @short TODO */ 627 RecovDocList( Window* pParent, 628 const ResId& rResId ); 629 630 //--------------------------------------- 631 /** @short TODO */ 632 virtual ~RecovDocList(); 633 634 //--------------------------------------- 635 /** @short TODO */ 636 virtual void InitEntry( SvLBoxEntry* pEntry , 637 const XubString& sText , 638 const Image& aImage1, 639 const Image& aImage2, 640 SvLBoxButtonKind eButtonKind); 641 }; 642 643 //=============================================== 644 class RecoveryDialog : public IExtendedTabPage 645 , public IRecoveryUpdateListener 646 { 647 //------------------------------------------- 648 // member 649 private: 650 Window m_aTitleWin; 651 FixedText m_aTitleFT; 652 FixedLine m_aTitleFL; 653 FixedText m_aDescrFT; 654 FixedText m_aProgressFT; 655 Window m_aProgrParent; 656 FixedText m_aFileListFT; 657 RecovDocList m_aFileListLB; 658 FixedLine m_aBottomFL; 659 PushButton m_aNextBtn; 660 CancelButton m_aCancelBtn; 661 String m_aNextStr; 662 String m_aTitleRecoveryInProgress; 663 String m_aTitleRecoveryReport; 664 String m_aRecoveryOnlyFinish; 665 String m_aRecoveryOnlyFinishDescr; 666 667 PushButton* m_pDefButton; 668 RecoveryCore* m_pCore; 669 css::uno::Reference< css::task::XStatusIndicator > m_xProgress; 670 enum EInternalRecoveryState 671 { 672 E_RECOVERY_PREPARED, // dialog started ... recovery prepared 673 E_RECOVERY_IN_PROGRESS, // recovery core still in progress 674 E_RECOVERY_CORE_DONE, // recovery core finished it's task 675 E_RECOVERY_DONE, // user clicked "next" button 676 E_RECOVERY_CANCELED, // user clicked "cancel" button 677 E_RECOVERY_CANCELED_BEFORE, // user clicked "cancel" button before recovery was started 678 E_RECOVERY_CANCELED_AFTERWARDS, // user clicked "cancel" button after reovery was finished 679 E_RECOVERY_HANDLED // the recovery wizard page was shown already ... and will be shown now again ... 680 }; 681 sal_Int32 m_eRecoveryState; 682 sal_Bool m_bWaitForUser; 683 sal_Bool m_bWaitForCore; 684 sal_Bool m_bUserDecideNext; 685 sal_Bool m_bWasRecoveryStarted; 686 sal_Bool m_bRecoveryOnly; 687 688 //------------------------------------------- 689 // member 690 public: 691 692 //--------------------------------------- 693 /** @short TODO */ 694 RecoveryDialog(Window* pParent, 695 RecoveryCore* pCore ); 696 697 //--------------------------------------- 698 /** @short TODO */ 699 virtual ~RecoveryDialog(); 700 701 //--------------------------------------- 702 // IRecoveryUpdateListener 703 virtual void updateItems(); 704 virtual void stepNext(TURLInfo* pItem); 705 virtual void start(); 706 virtual void end(); 707 708 //--------------------------------------- 709 /** @short TODO */ 710 virtual short execute(); 711 712 //--------------------------------------- 713 /** @short TODO*/ 714 virtual void setDefButton(); 715 716 //------------------------------------------- 717 // helper 718 private: 719 720 //--------------------------------------- 721 /** @short TODO */ 722 DECL_LINK(NextButtonHdl, void*); 723 DECL_LINK(CancelButtonHdl, void*); 724 725 //--------------------------------------- 726 /** @short TODO */ 727 void impl_refreshDocList(); 728 729 //--------------------------------------- 730 /** @short TODO */ 731 String impl_getStatusString( const TURLInfo& rInfo ) const; 732 }; 733 734 //=============================================== 735 class BrokenRecoveryDialog : public ModalDialog 736 { 737 //------------------------------------------- 738 // member 739 private: 740 FixedText m_aDescrFT; 741 FixedText m_aFileListFT; 742 ListBox m_aFileListLB; 743 FixedText m_aSaveDirFT; 744 Edit m_aSaveDirED; 745 PushButton m_aSaveDirBtn; 746 FixedLine m_aBottomFL; 747 OKButton m_aOkBtn; 748 CancelButton m_aCancelBtn; 749 750 ::rtl::OUString m_sSavePath; 751 RecoveryCore* m_pCore; 752 sal_Bool m_bBeforeRecovery; 753 sal_Bool m_bExecutionNeeded; 754 755 //------------------------------------------- 756 // interface 757 public: 758 759 //--------------------------------------- 760 /** @short TODO */ 761 BrokenRecoveryDialog(Window* pParent , 762 RecoveryCore* pCore , 763 sal_Bool bBeforeRecovery); 764 765 //--------------------------------------- 766 /** @short TODO */ 767 virtual ~BrokenRecoveryDialog(); 768 769 //--------------------------------------- 770 /** @short TODO */ 771 virtual sal_Bool isExecutionNeeded(); 772 773 //--------------------------------------- 774 /** @short TODO */ 775 virtual ::rtl::OUString getSaveDirURL(); 776 777 //------------------------------------------- 778 // helper 779 private: 780 781 //--------------------------------------- 782 /** @short TODO */ 783 void impl_refresh(); 784 785 //--------------------------------------- 786 /** @short TODO */ 787 DECL_LINK(SaveButtonHdl, void*); 788 789 //--------------------------------------- 790 /** @short TODO */ 791 DECL_LINK(OkButtonHdl, void*); 792 793 //--------------------------------------- 794 /** @short TODO */ 795 DECL_LINK(CancelButtonHdl, void*); 796 797 //--------------------------------------- 798 /** @short TODO */ 799 void impl_askForSavePath(); 800 }; 801 802 803 804 class ErrorRepWelcomeDialog : public IExtendedTabPage 805 { 806 private: 807 Window maTitleWin; 808 FixedText maTitleFT; 809 FixedLine maTitleFL; 810 FixedText maDescrFT; 811 812 FixedLine maBottomFL; 813 PushButton maPrevBtn; 814 OKButton maNextBtn; 815 CancelButton maCancelBtn; 816 817 DECL_LINK( PrevBtnHdl, void* ); 818 DECL_LINK( NextBtnHdl, void* ); 819 DECL_LINK( CancelBtnHdl, void* ); 820 public: 821 ErrorRepWelcomeDialog( Window* _pParent, sal_Bool _bAllowBack = sal_True ); 822 virtual ~ErrorRepWelcomeDialog(); 823 /** @short TODO*/ 824 virtual short execute(); 825 826 //--------------------------------------- 827 /** @short TODO*/ 828 virtual void setDefButton(); 829 }; 830 831 struct ErrorRepParams 832 { ErrorRepParamssvx::DocRecovery::ErrorRepParams833 ErrorRepParams() 834 #ifdef WNT 835 : miHTTPConnectionType( 0 ) 836 #else 837 : miHTTPConnectionType( 1 ) 838 #endif 839 , mbAllowContact( false ) 840 {} 841 842 String maHTTPProxyServer; 843 String maHTTPProxyPort; 844 int miHTTPConnectionType; 845 bool mbAllowContact; 846 String maReturnAddress; 847 String maSubject; 848 String maBody; 849 }; 850 851 class ErrorDescriptionEdit : public MultiLineEdit 852 { 853 private: 854 DECL_LINK( ModifyHdl, void* ); 855 856 public: 857 ErrorDescriptionEdit( Window* pParent, const ResId& rResId ); 858 virtual ~ErrorDescriptionEdit(); 859 }; 860 861 class ErrorRepSendDialog : public IExtendedTabPage 862 { 863 private: 864 Window maTitleWin; 865 FixedText maTitleFT; 866 FixedLine maTitleFL; 867 FixedText maDescrFT; 868 869 FixedText maDocTypeFT; 870 Edit maDocTypeED; 871 FixedText maUsingFT; 872 ErrorDescriptionEdit maUsingML; 873 PushButton maShowRepBtn; 874 PushButton maOptBtn; 875 CheckBox maContactCB; 876 FixedText maEMailAddrFT; 877 Edit maEMailAddrED; 878 879 FixedLine maBottomFL; 880 PushButton maPrevBtn; 881 OKButton maNextBtn; 882 CancelButton maCancelBtn; 883 884 ErrorRepParams maParams; 885 886 DECL_LINK( ShowRepBtnHdl, void* ); 887 DECL_LINK( OptBtnHdl, void* ); 888 DECL_LINK( ContactCBHdl, void* ); 889 DECL_LINK( PrevBtnHdl, void* ); 890 DECL_LINK( SendBtnHdl, void* ); 891 DECL_LINK( CancelBtnHdl, void* ); 892 893 void initControls(); 894 895 public: 896 ErrorRepSendDialog( Window* _pParent ); 897 virtual ~ErrorRepSendDialog(); 898 899 String GetDocType( void ) const; 900 String GetUsing( void ) const; 901 bool IsContactAllowed( void ) const; 902 String GetEMailAddress( void ) const; 903 904 bool ReadParams(); 905 bool SaveParams(); 906 bool SendReport(); 907 908 /** @short TODO*/ 909 virtual short execute(); 910 911 //--------------------------------------- 912 /** @short TODO*/ 913 virtual void setDefButton(); 914 }; 915 916 class ErrorRepOptionsDialog : public ModalDialog 917 { 918 private: 919 FixedLine maProxyFL; 920 RadioButton maSystemBtn; 921 RadioButton maDirectBtn; 922 RadioButton maManualBtn; 923 FixedText maProxyServerFT; 924 Edit maProxyServerEd; 925 FixedText maProxyPortFT; 926 Edit maProxyPortEd; 927 FixedText maDescriptionFT; 928 FixedLine maButtonsFL; 929 OKButton maOKBtn; 930 CancelButton maCancelBtn; 931 932 ErrorRepParams& mrParams; 933 934 DECL_LINK( CancelBtnHdl, void* ); 935 DECL_LINK( OKBtnHdl, void * ); 936 DECL_LINK( ManualBtnHdl, void * ); 937 938 public: 939 ErrorRepOptionsDialog( Window* _pParent, ErrorRepParams& rParams ); 940 virtual ~ErrorRepOptionsDialog(); 941 }; 942 943 class ErrorRepEdit : public ExtMultiLineEdit 944 { 945 public: 946 ErrorRepEdit( Window* pParent, const ResId& rResId ); 947 virtual ~ErrorRepEdit(); 948 }; 949 950 class ErrorRepPreviewDialog : public ModalDialog 951 { 952 private: 953 ErrorRepEdit maContentML; 954 OKButton maOKBtn; 955 956 long mnMinHeight; 957 958 public: 959 ErrorRepPreviewDialog( Window* _pParent ); 960 virtual ~ErrorRepPreviewDialog(); 961 962 virtual void Resize(); 963 }; 964 } // namespace DocRecovery 965 } // namespace svx 966 967 #undef css 968 969 #endif 970