merge the formfield patch from ooo-build
[ooovba.git] / svx / source / inc / recoveryui.hxx
blobc72511cc8990dad882668f6107e92f6ef08153e0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: recoveryui.hxx,v $
10 * $Revision: 1.4 $
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 _RECOVERYUI_HXX
32 #define _RECOVERYUI_HXX
34 //===============================================
35 // includes
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
40 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
41 #include <cppuhelper/implbase2.hxx>
42 #include <vcl/window.hxx>
43 #include "docrecovery.hxx"
45 //===============================================
46 // namespace
48 namespace svx
51 // Dont export this header ... Otherwise you have to remove this namespace alias!
52 namespace css = ::com::sun::star;
53 namespace svxdr = ::svx::DocRecovery;
55 //===============================================
56 // declarations
58 class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
59 css::frame::XSynchronousDispatch > // => XDispatch!
61 //-------------------------------------------
62 // const, types, etcpp.
63 private:
65 /** @short TODO */
66 enum EJob
68 E_JOB_UNKNOWN,
69 E_DO_EMERGENCY_SAVE,
70 E_DO_RECOVERY,
71 E_DO_CRASHREPORT
74 //-------------------------------------------
75 // member
76 private:
78 /** @short TODO */
79 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
81 /** @short TODO */
82 Window* m_pParentWindow;
84 /** @short TODO */
85 RecoveryUI::EJob m_eJob;
87 /** @short TODO */
88 css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
90 //-------------------------------------------
91 // interface
92 public:
94 //---------------------------------------
95 /** @short TODO */
96 RecoveryUI(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
98 //---------------------------------------
99 /** @short TODO */
100 virtual ~RecoveryUI();
102 //---------------------------------------
103 // css.lang.XServiceInfo
105 virtual ::rtl::OUString SAL_CALL getImplementationName()
106 throw(css::uno::RuntimeException);
108 virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& sServiceName)
109 throw(css::uno::RuntimeException);
111 virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
112 throw(css::uno::RuntimeException);
114 //---------------------------------------
115 virtual com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL& aURL,
116 const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
117 throw(css::uno::RuntimeException);
119 //---------------------------------------
120 // css.frame.XDispatch
122 virtual void SAL_CALL dispatch(const css::util::URL& aURL ,
123 const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
124 throw(css::uno::RuntimeException);
126 virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
127 const css::util::URL& aURL )
128 throw(css::uno::RuntimeException);
129 virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
130 const css::util::URL& aURL )
131 throw(css::uno::RuntimeException);
133 //---------------------------------------
134 // XServiceInfo helper
136 static ::rtl::OUString st_getImplementationName();
137 static css::uno::Sequence< ::rtl::OUString > st_getSupportedServiceNames();
138 static css::uno::Reference< css::uno::XInterface > SAL_CALL st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
140 //-------------------------------------------
141 // helper
142 private:
144 EJob impl_classifyJob(const css::util::URL& aURL);
146 sal_Bool impl_doEmergencySave();
148 void impl_doRecovery();
150 void impl_showAllRecoveredDocs();
152 void impl_doCrashReport();
156 } // namespace svx
158 #endif // _RECOVERYUI_HXX