Update ooo320-m1
[ooovba.git] / svx / source / inc / docrecovery.hxx
blob9d0b624f7ef224d48b1ce8f897e71b89dfdc3723
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docrecovery.hxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_DOCRECOVERY_HXX
32 #define _SVX_DOCRECOVERY_HXX
34 #include <vcl/tabpage.hxx>
35 #ifndef _SV_TABDIALOG_HXX
36 #include <vcl/tabdlg.hxx>
37 #endif
38 #include <vcl/dialog.hxx>
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
41 #endif
42 #include <vcl/fixed.hxx>
43 #include <svtools/svmedit2.hxx>
44 #include <svtools/svtreebx.hxx>
45 #include <svx/simptabl.hxx>
47 #include <cppuhelper/implbase1.hxx>
48 #include <cppuhelper/implbase2.hxx>
49 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
50 #include <com/sun/star/frame/XStatusListener.hpp>
51 #include <com/sun/star/frame/XDispatch.hpp>
52 #include <com/sun/star/lang/XComponent.hpp>
54 //===============================================
55 // const
57 #define RECOVERY_CMDPART_PROTOCOL ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:")
59 #define RECOVERY_CMDPART_DO_PREPARE_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("/doPrepareEmergencySave" )
60 #define RECOVERY_CMDPART_DO_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("/doEmergencySave" )
61 #define RECOVERY_CMDPART_DO_RECOVERY ::rtl::OUString::createFromAscii("/doAutoRecovery" )
62 #define RECOVERY_CMDPART_DO_CRASHREPORT ::rtl::OUString::createFromAscii("/doCrashReport" )
63 #define RECOVERY_CMDPART_DO_ENTRY_BACKUP ::rtl::OUString::createFromAscii("/doEntryBackup" )
64 #define RECOVERY_CMDPART_DO_ENTRY_CLEANUP ::rtl::OUString::createFromAscii("/doEntryCleanUp" )
66 #define RECOVERY_CMD_DO_PREPARE_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doPrepareEmergencySave")
67 #define RECOVERY_CMD_DO_EMERGENCY_SAVE ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEmergencySave" )
68 #define RECOVERY_CMD_DO_RECOVERY ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doAutoRecovery" )
69 #define RECOVERY_CMD_DO_CRASHREPORT ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doCrashReport" )
70 #define RECOVERY_CMD_DO_ENTRY_BACKUP ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEntryBackup" )
71 #define RECOVERY_CMD_DO_ENTRY_CLEANUP ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEntryCleanUp" )
73 #define SERVICENAME_PROGRESSFACTORY ::rtl::OUString::createFromAscii("com.sun.star.task.StatusIndicatorFactory")
74 #define SERVICENAME_URLTRANSFORMER ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )
75 #define SERVICENAME_RECOVERYCORE ::rtl::OUString::createFromAscii("com.sun.star.frame.AutoRecovery" )
76 #define SERVICENAME_FOLDERPICKER ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FolderPicker" )
77 #define SERVICENAME_DESKTOP ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop" )
79 #define PROP_PARENTWINDOW ::rtl::OUString::createFromAscii("Window" )
80 #define PROP_STATUSINDICATOR ::rtl::OUString::createFromAscii("StatusIndicator" )
81 #define PROP_DISPATCHASYNCHRON ::rtl::OUString::createFromAscii("DispatchAsynchron")
82 #define PROP_SAVEPATH ::rtl::OUString::createFromAscii("SavePath" )
83 #define PROP_ENTRYID ::rtl::OUString::createFromAscii("EntryID" )
84 #define PROP_ALLOWPARENTSHOW ::rtl::OUString::createFromAscii("AllowParentShow" )
86 #define STATEPROP_ID ::rtl::OUString::createFromAscii("ID" )
87 #define STATEPROP_STATE ::rtl::OUString::createFromAscii("DocumentState")
88 #define STATEPROP_ORGURL ::rtl::OUString::createFromAscii("OriginalURL" )
89 #define STATEPROP_TEMPURL ::rtl::OUString::createFromAscii("TempURL" )
90 #define STATEPROP_FACTORYURL ::rtl::OUString::createFromAscii("FactoryURL" )
91 #define STATEPROP_TEMPLATEURL ::rtl::OUString::createFromAscii("TemplateURL" )
92 #define STATEPROP_TITLE ::rtl::OUString::createFromAscii("Title" )
93 #define STATEPROP_MODULE ::rtl::OUString::createFromAscii("Module" )
95 #define RECOVERY_OPERATIONSTATE_START ::rtl::OUString::createFromAscii("start" )
96 #define RECOVERY_OPERATIONSTATE_STOP ::rtl::OUString::createFromAscii("stop" )
97 #define RECOVERY_OPERATIONSTATE_UPDATE ::rtl::OUString::createFromAscii("update")
99 #define DLG_RET_UNKNOWN -1
100 #define DLG_RET_OK 1
101 #define DLG_RET_CANCEL 0
102 #define DLG_RET_BACK 100
103 #define DLG_RET_OK_AUTOLUNCH 101
105 //===============================================
106 // namespace
108 namespace svx{
109 namespace DocRecovery{
111 #ifdef css
112 # error "Who uses css? I need it as temp. namespace alias!"
113 #else
114 # define css ::com::sun::star
115 #endif
117 //===============================================
118 enum EDocStates
120 /* TEMP STATES */
122 /// default state, if a document was new created or loaded
123 E_UNKNOWN = 0,
124 /// modified against the original file
125 E_MODIFIED = 1,
126 /// an active document can be postponed to be saved later.
127 E_POSTPONED = 2,
128 /// was already handled during one AutoSave/Recovery session.
129 E_HANDLED = 4,
130 /** an action was started (saving/loading) ... Can be interesting later if the process may be was interrupted by an exception. */
131 E_TRY_SAVE = 8,
132 E_TRY_LOAD_BACKUP = 16,
133 E_TRY_LOAD_ORIGINAL = 32,
135 /* FINAL STATES */
137 /// the Auto/Emergency saved document isnt useable any longer
138 E_DAMAGED = 64,
139 /// the Auto/Emergency saved document isnt realy up-to-date (some changes can be missing)
140 E_INCOMPLETE = 128,
141 /// the Auto/Emergency saved document was processed successfully
142 E_SUCCEDED = 512
145 //===============================================
146 enum ERecoveryState
148 E_SUCCESSFULLY_RECOVERED,
149 E_ORIGINAL_DOCUMENT_RECOVERED,
150 E_RECOVERY_FAILED,
151 E_RECOVERY_IS_IN_PROGRESS,
152 E_NOT_RECOVERED_YET
155 //===============================================
156 struct TURLInfo
158 public:
160 /// unique ID, which is specified by the underlying autorecovery core!
161 sal_Int32 ID;
163 /// the full qualified document URL
164 ::rtl::OUString OrgURL;
166 /// the full qualified URL of the temp. file (if it's exists)
167 ::rtl::OUString TempURL;
169 /// a may be existing factory URL (e.g. for untitled documents)
170 ::rtl::OUString FactoryURL;
172 /// may be the document base on a template file !?
173 ::rtl::OUString TemplateURL;
175 /// the pure file name, without path, disc etcpp.
176 ::rtl::OUString DisplayName;
178 /// the application module, where this document was loaded
179 ::rtl::OUString Module;
181 /// state info as e.g. VALID, CORRUPTED, NON EXISTING ...
182 sal_Int32 DocState;
184 /// ui representation for DocState!
185 ERecoveryState RecoveryState;
187 /// standard icon
188 Image StandardImage;
190 /// high contrast icon
191 Image HCImage;
193 public:
195 TURLInfo()
196 : ID (-1 )
197 , DocState (E_UNKNOWN )
198 , RecoveryState(E_NOT_RECOVERED_YET)
202 //===============================================
203 typedef ::std::vector< TURLInfo > TURLList;
205 //===============================================
206 class IRecoveryUpdateListener
208 public:
210 // inform listener about changed items, which should be refreshed
211 virtual void updateItems() = 0;
213 // inform listener about starting of the asynchronous recovery operation
214 virtual void start() = 0;
216 // inform listener about ending of the asynchronous recovery operation
217 virtual void end() = 0;
219 // TODO
220 virtual void stepNext(TURLInfo* pItem) = 0;
223 //===============================================
224 class RecoveryCore : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
226 //-------------------------------------------
227 // types, const
228 public:
230 //-------------------------------------------
231 // member
232 private:
234 /// TODO
235 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
237 /// TODO
238 css::uno::Reference< css::frame::XDispatch > m_xRealCore;
240 /// TODO
241 css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
243 /// TODO
244 TURLList m_lURLs;
246 /// TODO
247 IRecoveryUpdateListener* m_pListener;
249 /** @short knows the reason, why we listen on our internal m_xRealCore
250 member.
252 @descr Because we listen for different operations
253 on the core dispatch implementation, we must know,
254 which URL we have to use for deregistration!
256 sal_Bool m_bListenForSaving;
258 //-------------------------------------------
259 // native interface
260 public:
262 //---------------------------------------
263 /** @short TODO */
264 RecoveryCore(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
265 sal_Bool bUsedForSaving);
267 //---------------------------------------
268 /** @short TODO */
269 virtual ~RecoveryCore();
271 //---------------------------------------
272 /** @short TODO */
273 virtual css::uno::Reference< css::lang::XMultiServiceFactory > getSMGR();
275 //---------------------------------------
276 /** @short TODO */
277 virtual TURLList* getURLListAccess();
279 //---------------------------------------
280 /** @short TODO */
281 virtual sal_Bool existsBrokenTempEntries();
282 virtual sal_Bool existsNonRecoveredEntries();
283 static sal_Bool isBrokenTempEntry(const TURLInfo& rInfo);
284 virtual void saveBrokenTempEntries(const ::rtl::OUString& sSaveDir);
285 virtual void saveAllTempEntries(const ::rtl::OUString& sSaveDir);
286 virtual void forgetBrokenTempEntries();
287 virtual void forgetAllRecoveryEntries();
288 void forgetBrokenRecoveryEntries();
290 //---------------------------------------
291 /** @short TODO */
292 virtual void setProgressHandler(const css::uno::Reference< css::task::XStatusIndicator >& xProgress);
294 //---------------------------------------
295 /** @short TODO */
296 virtual void setUpdateListener(IRecoveryUpdateListener* pListener);
298 //---------------------------------------
299 /** @short TODO */
300 virtual void doEmergencySavePrepare();
301 virtual void doEmergencySave();
302 virtual void doRecovery();
304 //---------------------------------------
305 /** @short TODO */
306 static ERecoveryState mapDocState2RecoverState(sal_Int32 eDocState);
308 //-------------------------------------------
309 // uno interface
310 public:
312 // css.frame.XStatusListener
313 virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& aEvent)
314 throw(css::uno::RuntimeException);
316 // css.lang.XEventListener
317 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
318 throw(css::uno::RuntimeException);
320 //-------------------------------------------
321 // helper
322 private:
324 //---------------------------------------
325 /** @short starts listening on the internal EmergencySave/AutoRecovery core.
327 void impl_startListening();
329 //---------------------------------------
330 /** @short stop listening on the internal EmergencySave/AutoRecovery core.
332 void impl_stopListening();
334 //---------------------------------------
335 /** @short TODO */
336 css::util::URL impl_getParsedURL(const ::rtl::OUString& sURL);
339 //===============================================
340 class PluginProgressWindow : public Window
342 private:
344 css::uno::Reference< css::lang::XComponent > m_xProgress;
346 public:
348 PluginProgressWindow( Window* pParent ,
349 const css::uno::Reference< css::lang::XComponent >& xProgress);
350 ~PluginProgressWindow();
353 class PluginProgress : public ::cppu::WeakImplHelper2< css::task::XStatusIndicator ,
354 css::lang::XComponent >
357 //-------------------------------------------
358 // member
359 private:
361 /** @short TODO */
362 css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
364 css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
366 PluginProgressWindow* m_pPlugProgressWindow;
368 //-------------------------------------------
369 // native interface
370 public:
372 //---------------------------------------
373 /** @short TODO */
374 PluginProgress( Window* pParent,
375 const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR );
377 //---------------------------------------
378 /** @short TODO */
379 virtual ~PluginProgress();
381 //---------------------------------------
382 /** @short TODO */
383 Window* getPlugWindow();
385 //-------------------------------------------
386 // uno interface
387 public:
389 //---------------------------------------
390 // XStatusIndicator
391 virtual void SAL_CALL start(const ::rtl::OUString& sText ,
392 sal_Int32 nRange)
393 throw(css::uno::RuntimeException);
395 virtual void SAL_CALL end()
396 throw(css::uno::RuntimeException);
398 virtual void SAL_CALL setText(const ::rtl::OUString& sText)
399 throw(css::uno::RuntimeException);
401 virtual void SAL_CALL setValue(sal_Int32 nValue)
402 throw(css::uno::RuntimeException);
404 virtual void SAL_CALL reset()
405 throw(css::uno::RuntimeException);
407 //---------------------------------------
408 // XComponent
409 virtual void SAL_CALL dispose()
410 throw(css::uno::RuntimeException);
412 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& xListener)
413 throw(css::uno::RuntimeException);
415 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener)
416 throw(css::uno::RuntimeException);
419 //===============================================
420 class IExtendedTabPage : public TabPage
422 //-------------------------------------------
423 // member
424 protected:
426 short m_nResult;
428 //-------------------------------------------
429 // interface
430 public:
432 IExtendedTabPage( Window* pParent, WinBits nStyle = 0 )
433 : TabPage( pParent, nStyle )
434 , m_nResult(DLG_RET_UNKNOWN)
437 IExtendedTabPage( Window* pParent, const ResId& rResId )
438 : TabPage( pParent, rResId )
439 , m_nResult(DLG_RET_UNKNOWN)
442 virtual ~IExtendedTabPage()
445 virtual short execute() = 0;
446 virtual void setDefButton() = 0;
449 typedef ::std::vector< IExtendedTabPage* > TTabPageList;
451 //===============================================
452 class TabDialog4Recovery : public TabDialog
454 //-------------------------------------------
455 // member
456 private:
458 TTabPageList m_lTabPages;
459 TTabPageList::iterator m_pActualPage;
461 //-------------------------------------------
462 // interface
463 public:
465 TabDialog4Recovery(Window* pParent);
466 virtual ~TabDialog4Recovery();
468 virtual void addTabPage(IExtendedTabPage* pPage);
469 virtual short Execute();
472 //===============================================
473 class SaveDialog : public IExtendedTabPage
475 //-------------------------------------------
476 // member
477 private:
479 Window m_aTitleWin;
480 FixedText m_aTitleFT;
481 FixedLine m_aTitleFL;
482 FixedText m_aDescrFT;
483 FixedText m_aFileListFT;
484 ListBox m_aFileListLB;
485 FixedLine m_aBottomFL;
486 OKButton m_aOkBtn;
488 RecoveryCore* m_pCore;
490 //-------------------------------------------
491 // interface
492 public:
494 //---------------------------------------
495 /** @short create all child controls of this dialog.
497 @descr The dialog isnt shown nor it starts any
498 action by itself!
500 @param pParent
501 can point to a parent window.
502 If its set to 0, the defmodal-dialog-parent
503 is used automaticly.
505 @param pCore
506 provides access to the recovery core service
507 and the current list of open documents,
508 which should be shown inside this dialog.
510 SaveDialog(Window* pParent,
511 RecoveryCore* pCore );
513 //---------------------------------------
514 /** @short free all controls and used memory. */
515 virtual ~SaveDialog();
517 //---------------------------------------
518 /** @short TODO*/
519 virtual short execute();
521 //---------------------------------------
522 /** @short TODO*/
523 virtual void setDefButton();
525 DECL_LINK(OKButtonHdl, void*);
528 //===============================================
529 class SaveProgressDialog : public ModalDialog
530 , public IRecoveryUpdateListener
532 //-------------------------------------------
533 // member
534 private:
536 FixedText m_aHintFT;
537 FixedText m_aProgrFT;
538 String m_aProgrBaseTxt;
539 Window m_aProgrParent;
541 // @short TODO
542 RecoveryCore* m_pCore;
544 // @short TODO
545 css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
547 //-------------------------------------------
548 // interface
549 public:
551 //---------------------------------------
552 /** @short create all child controls of this dialog.
554 @descr The dialog isnt shown nor it starts any
555 action by itself!
557 @param pParent
558 can point to a parent window.
559 If its set to 0, the defmodal-dialog-parent
560 is used automaticly.
562 @param pCore
563 used to start emegrency save.
565 SaveProgressDialog(Window* pParent,
566 RecoveryCore* pCore );
568 //---------------------------------------
569 /** @short free all controls and used memory. */
570 virtual ~SaveProgressDialog();
572 //---------------------------------------
573 /** @short start the emergency save operation. */
574 virtual short Execute();
576 // IRecoveryUpdateListener
577 virtual void updateItems();
578 virtual void stepNext(TURLInfo* pItem);
579 virtual void start();
580 virtual void end();
583 //===============================================
584 class RecovDocListEntry : public SvLBoxString
586 //-------------------------------------------
587 // interface
588 private:
590 //-------------------------------------------
591 // interface
592 public:
594 //---------------------------------------
595 /** @short TODO */
596 RecovDocListEntry( SvLBoxEntry* pEntry,
597 USHORT nFlags,
598 const String& sText );
600 //---------------------------------------
601 /** @short TODO */
602 virtual void Paint(const Point& aPos ,
603 SvLBox& aDevice,
604 USHORT nFlags ,
605 SvLBoxEntry* pEntry );
608 //===============================================
609 class RecovDocList : public SvxSimpleTable
611 //-------------------------------------------
612 // member
613 public:
615 Image m_aGreenCheckImg;
616 Image m_aYellowCheckImg;
617 Image m_aRedCrossImg;
618 Image m_aGreenCheckImgHC;
619 Image m_aYellowCheckImgHC;
620 Image m_aRedCrossImgHC;
622 String m_aSuccessRecovStr;
623 String m_aOrigDocRecovStr;
624 String m_aRecovFailedStr;
625 String m_aRecovInProgrStr;
626 String m_aNotRecovYetStr;
628 //-------------------------------------------
629 // interface
630 public:
632 //---------------------------------------
633 /** @short TODO */
634 RecovDocList( Window* pParent,
635 const ResId& rResId );
637 //---------------------------------------
638 /** @short TODO */
639 virtual ~RecovDocList();
641 //---------------------------------------
642 /** @short TODO */
643 virtual void InitEntry( SvLBoxEntry* pEntry ,
644 const XubString& sText ,
645 const Image& aImage1,
646 const Image& aImage2,
647 SvLBoxButtonKind eButtonKind);
650 //===============================================
651 class RecoveryDialog : public IExtendedTabPage
652 , public IRecoveryUpdateListener
654 //-------------------------------------------
655 // member
656 private:
657 Window m_aTitleWin;
658 FixedText m_aTitleFT;
659 FixedLine m_aTitleFL;
660 FixedText m_aDescrFT;
661 FixedText m_aProgressFT;
662 Window m_aProgrParent;
663 FixedText m_aFileListFT;
664 RecovDocList m_aFileListLB;
665 FixedLine m_aBottomFL;
666 PushButton m_aNextBtn;
667 CancelButton m_aCancelBtn;
668 String m_aNextStr;
669 String m_aTitleRecoveryInProgress;
670 String m_aTitleRecoveryReport;
671 String m_aRecoveryOnlyFinish;
672 String m_aRecoveryOnlyFinishDescr;
674 PushButton* m_pDefButton;
675 RecoveryCore* m_pCore;
676 css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
677 enum EInternalRecoveryState
679 E_RECOVERY_PREPARED, // dialog started ... recovery prepared
680 E_RECOVERY_IN_PROGRESS, // recovery core still in progress
681 E_RECOVERY_CORE_DONE, // recovery core finished it's task
682 E_RECOVERY_DONE, // user clicked "next" button
683 E_RECOVERY_CANCELED, // user clicked "cancel" button
684 E_RECOVERY_CANCELED_BEFORE, // user clicked "cancel" button before recovery was started
685 E_RECOVERY_CANCELED_AFTERWARDS, // user clicked "cancel" button after reovery was finished
686 E_RECOVERY_HANDLED // the recovery wizard page was shown already ... and will be shown now again ...
688 sal_Int32 m_eRecoveryState;
689 sal_Bool m_bWaitForUser;
690 sal_Bool m_bWaitForCore;
691 sal_Bool m_bUserDecideNext;
692 sal_Bool m_bWasRecoveryStarted;
693 sal_Bool m_bRecoveryOnly;
695 //-------------------------------------------
696 // member
697 public:
699 //---------------------------------------
700 /** @short TODO */
701 RecoveryDialog(Window* pParent,
702 RecoveryCore* pCore );
704 //---------------------------------------
705 /** @short TODO */
706 virtual ~RecoveryDialog();
708 //---------------------------------------
709 // IRecoveryUpdateListener
710 virtual void updateItems();
711 virtual void stepNext(TURLInfo* pItem);
712 virtual void start();
713 virtual void end();
715 //---------------------------------------
716 /** @short TODO */
717 virtual short execute();
719 //---------------------------------------
720 /** @short TODO*/
721 virtual void setDefButton();
723 //-------------------------------------------
724 // helper
725 private:
727 //---------------------------------------
728 /** @short TODO */
729 DECL_LINK(NextButtonHdl, void*);
730 DECL_LINK(CancelButtonHdl, void*);
732 //---------------------------------------
733 /** @short TODO */
734 void impl_refreshDocList();
736 //---------------------------------------
737 /** @short TODO */
738 String impl_getStatusString( const TURLInfo& rInfo ) const;
741 //===============================================
742 class BrokenRecoveryDialog : public ModalDialog
744 //-------------------------------------------
745 // member
746 private:
747 FixedText m_aDescrFT;
748 FixedText m_aFileListFT;
749 ListBox m_aFileListLB;
750 FixedText m_aSaveDirFT;
751 Edit m_aSaveDirED;
752 PushButton m_aSaveDirBtn;
753 FixedLine m_aBottomFL;
754 OKButton m_aOkBtn;
755 CancelButton m_aCancelBtn;
757 ::rtl::OUString m_sSavePath;
758 RecoveryCore* m_pCore;
759 sal_Bool m_bBeforeRecovery;
760 sal_Bool m_bExecutionNeeded;
762 //-------------------------------------------
763 // interface
764 public:
766 //---------------------------------------
767 /** @short TODO */
768 BrokenRecoveryDialog(Window* pParent ,
769 RecoveryCore* pCore ,
770 sal_Bool bBeforeRecovery);
772 //---------------------------------------
773 /** @short TODO */
774 virtual ~BrokenRecoveryDialog();
776 //---------------------------------------
777 /** @short TODO */
778 virtual sal_Bool isExecutionNeeded();
780 //---------------------------------------
781 /** @short TODO */
782 virtual ::rtl::OUString getSaveDirURL();
784 //-------------------------------------------
785 // helper
786 private:
788 //---------------------------------------
789 /** @short TODO */
790 void impl_refresh();
792 //---------------------------------------
793 /** @short TODO */
794 DECL_LINK(SaveButtonHdl, void*);
796 //---------------------------------------
797 /** @short TODO */
798 DECL_LINK(OkButtonHdl, void*);
800 //---------------------------------------
801 /** @short TODO */
802 DECL_LINK(CancelButtonHdl, void*);
804 //---------------------------------------
805 /** @short TODO */
806 void impl_askForSavePath();
811 class ErrorRepWelcomeDialog : public IExtendedTabPage
813 private:
814 Window maTitleWin;
815 FixedText maTitleFT;
816 FixedLine maTitleFL;
817 FixedText maDescrFT;
819 FixedLine maBottomFL;
820 PushButton maPrevBtn;
821 OKButton maNextBtn;
822 CancelButton maCancelBtn;
824 DECL_LINK( PrevBtnHdl, void* );
825 DECL_LINK( NextBtnHdl, void* );
826 DECL_LINK( CancelBtnHdl, void* );
827 public:
828 ErrorRepWelcomeDialog( Window* _pParent, sal_Bool _bAllowBack = sal_True );
829 virtual ~ErrorRepWelcomeDialog();
830 /** @short TODO*/
831 virtual short execute();
833 //---------------------------------------
834 /** @short TODO*/
835 virtual void setDefButton();
838 struct ErrorRepParams
840 ErrorRepParams()
841 #ifdef WNT
842 : miHTTPConnectionType( 0 )
843 #else
844 : miHTTPConnectionType( 1 )
845 #endif
846 , mbAllowContact( false )
849 String maHTTPProxyServer;
850 String maHTTPProxyPort;
851 int miHTTPConnectionType;
852 bool mbAllowContact;
853 String maReturnAddress;
854 String maSubject;
855 String maBody;
858 class ErrorDescriptionEdit : public MultiLineEdit
860 private:
861 DECL_LINK( ModifyHdl, void* );
863 public:
864 ErrorDescriptionEdit( Window* pParent, const ResId& rResId );
865 virtual ~ErrorDescriptionEdit();
868 class ErrorRepSendDialog : public IExtendedTabPage
870 private:
871 Window maTitleWin;
872 FixedText maTitleFT;
873 FixedLine maTitleFL;
874 FixedText maDescrFT;
876 FixedText maDocTypeFT;
877 Edit maDocTypeED;
878 FixedText maUsingFT;
879 ErrorDescriptionEdit maUsingML;
880 PushButton maShowRepBtn;
881 PushButton maOptBtn;
882 CheckBox maContactCB;
883 FixedText maEMailAddrFT;
884 Edit maEMailAddrED;
886 FixedLine maBottomFL;
887 PushButton maPrevBtn;
888 OKButton maNextBtn;
889 CancelButton maCancelBtn;
891 ErrorRepParams maParams;
893 DECL_LINK( ShowRepBtnHdl, void* );
894 DECL_LINK( OptBtnHdl, void* );
895 DECL_LINK( ContactCBHdl, void* );
896 DECL_LINK( PrevBtnHdl, void* );
897 DECL_LINK( SendBtnHdl, void* );
898 DECL_LINK( CancelBtnHdl, void* );
900 void initControls();
902 public:
903 ErrorRepSendDialog( Window* _pParent );
904 virtual ~ErrorRepSendDialog();
906 String GetDocType( void ) const;
907 String GetUsing( void ) const;
908 bool IsContactAllowed( void ) const;
909 String GetEMailAddress( void ) const;
911 bool ReadParams();
912 bool SaveParams();
913 bool SendReport();
915 /** @short TODO*/
916 virtual short execute();
918 //---------------------------------------
919 /** @short TODO*/
920 virtual void setDefButton();
923 class ErrorRepOptionsDialog : public ModalDialog
925 private:
926 FixedLine maProxyFL;
927 RadioButton maSystemBtn;
928 RadioButton maDirectBtn;
929 RadioButton maManualBtn;
930 FixedText maProxyServerFT;
931 Edit maProxyServerEd;
932 FixedText maProxyPortFT;
933 Edit maProxyPortEd;
934 FixedText maDescriptionFT;
935 FixedLine maButtonsFL;
936 OKButton maOKBtn;
937 CancelButton maCancelBtn;
939 ErrorRepParams& mrParams;
941 DECL_LINK( CancelBtnHdl, void* );
942 DECL_LINK( OKBtnHdl, void * );
943 DECL_LINK( ManualBtnHdl, void * );
945 public:
946 ErrorRepOptionsDialog( Window* _pParent, ErrorRepParams& rParams );
947 virtual ~ErrorRepOptionsDialog();
950 class ErrorRepEdit : public ExtMultiLineEdit
952 public:
953 ErrorRepEdit( Window* pParent, const ResId& rResId );
954 virtual ~ErrorRepEdit();
957 class ErrorRepPreviewDialog : public ModalDialog
959 private:
960 ErrorRepEdit maContentML;
961 OKButton maOKBtn;
963 long mnMinHeight;
965 public:
966 ErrorRepPreviewDialog( Window* _pParent );
967 virtual ~ErrorRepPreviewDialog();
969 virtual void Resize();
971 } // namespace DocRecovery
972 } // namespace svx
974 #undef css
976 #endif