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