xref: /trunk/main/svx/source/inc/recoveryui.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _RECOVERYUI_HXX
25cdf0e10cSrcweir #define _RECOVERYUI_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //===============================================
28cdf0e10cSrcweir // includes
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
32cdf0e10cSrcweir #include <com/sun/star/frame/XSynchronousDispatch.hpp>
33cdf0e10cSrcweir #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
34cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
35cdf0e10cSrcweir #include <vcl/window.hxx>
36cdf0e10cSrcweir #include "docrecovery.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir //===============================================
39cdf0e10cSrcweir // namespace
40cdf0e10cSrcweir 
41cdf0e10cSrcweir namespace svx
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 
44cdf0e10cSrcweir // Dont export this header ... Otherwise you have to remove this namespace alias!
45cdf0e10cSrcweir namespace css   = ::com::sun::star;
46cdf0e10cSrcweir namespace svxdr = ::svx::DocRecovery;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //===============================================
49cdf0e10cSrcweir // declarations
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo        ,
52cdf0e10cSrcweir                                                    css::frame::XSynchronousDispatch > // => XDispatch!
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     //-------------------------------------------
55cdf0e10cSrcweir     // const, types, etcpp.
56cdf0e10cSrcweir     private:
57cdf0e10cSrcweir 
58cdf0e10cSrcweir         /** @short TODO */
59cdf0e10cSrcweir         enum EJob
60cdf0e10cSrcweir         {
61cdf0e10cSrcweir             E_JOB_UNKNOWN,
62cdf0e10cSrcweir             E_DO_EMERGENCY_SAVE,
63cdf0e10cSrcweir             E_DO_RECOVERY,
64cdf0e10cSrcweir             E_DO_CRASHREPORT
65cdf0e10cSrcweir         };
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     //-------------------------------------------
68cdf0e10cSrcweir     // member
69cdf0e10cSrcweir     private:
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         /** @short TODO */
72cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir         /** @short TODO */
75cdf0e10cSrcweir         Window* m_pParentWindow;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir         /** @short TODO */
78cdf0e10cSrcweir         RecoveryUI::EJob m_eJob;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir         /** @short TODO */
81cdf0e10cSrcweir         css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     //-------------------------------------------
84cdf0e10cSrcweir     // interface
85cdf0e10cSrcweir     public:
86cdf0e10cSrcweir 
87cdf0e10cSrcweir         //---------------------------------------
88cdf0e10cSrcweir         /** @short  TODO */
89cdf0e10cSrcweir         RecoveryUI(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir         //---------------------------------------
92cdf0e10cSrcweir         /** @short  TODO */
93cdf0e10cSrcweir         virtual ~RecoveryUI();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         //---------------------------------------
96cdf0e10cSrcweir         // css.lang.XServiceInfo
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getImplementationName()
99cdf0e10cSrcweir             throw(css::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& sServiceName)
102cdf0e10cSrcweir             throw(css::uno::RuntimeException);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
105cdf0e10cSrcweir             throw(css::uno::RuntimeException);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         //---------------------------------------
108cdf0e10cSrcweir         virtual com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL& aURL,
109cdf0e10cSrcweir                                             const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
110cdf0e10cSrcweir             throw(css::uno::RuntimeException);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         //---------------------------------------
113cdf0e10cSrcweir         // css.frame.XDispatch
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         virtual void SAL_CALL dispatch(const css::util::URL&                                  aURL      ,
116cdf0e10cSrcweir                                        const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
117cdf0e10cSrcweir             throw(css::uno::RuntimeException);
118cdf0e10cSrcweir 
119cdf0e10cSrcweir         virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
120cdf0e10cSrcweir                                                 const css::util::URL&                                     aURL     )
121cdf0e10cSrcweir             throw(css::uno::RuntimeException);
122cdf0e10cSrcweir         virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
123cdf0e10cSrcweir                                                    const css::util::URL&                                     aURL     )
124cdf0e10cSrcweir             throw(css::uno::RuntimeException);
125cdf0e10cSrcweir 
126cdf0e10cSrcweir         //---------------------------------------
127cdf0e10cSrcweir         // XServiceInfo helper
128cdf0e10cSrcweir 
129cdf0e10cSrcweir         static ::rtl::OUString st_getImplementationName();
130cdf0e10cSrcweir         static css::uno::Sequence< ::rtl::OUString > st_getSupportedServiceNames();
131cdf0e10cSrcweir         static css::uno::Reference< css::uno::XInterface > SAL_CALL st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     //-------------------------------------------
134cdf0e10cSrcweir     // helper
135cdf0e10cSrcweir     private:
136cdf0e10cSrcweir 
137cdf0e10cSrcweir         EJob impl_classifyJob(const css::util::URL& aURL);
138cdf0e10cSrcweir 
139cdf0e10cSrcweir         sal_Bool impl_doEmergencySave();
140cdf0e10cSrcweir 
141cdf0e10cSrcweir         void impl_doRecovery();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 		void impl_showAllRecoveredDocs();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir         void impl_doCrashReport();
146cdf0e10cSrcweir 
147cdf0e10cSrcweir };
148cdf0e10cSrcweir 
149cdf0e10cSrcweir } // namespace svx
150cdf0e10cSrcweir 
151cdf0e10cSrcweir #endif // _RECOVERYUI_HXX
152