bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / inc / recoveryui.hxx
blobd8454c9e4c3558f3b0fbfe5e5f59c3edbbaf3421
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _RECOVERYUI_HXX
21 #define _RECOVERYUI_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
25 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
26 #include <cppuhelper/implbase2.hxx>
27 #include <vcl/window.hxx>
28 #include "docrecovery.hxx"
31 namespace svx
34 namespace svxdr = ::svx::DocRecovery;
37 class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo ,
38 css::frame::XSynchronousDispatch > // => XDispatch!
40 //-------------------------------------------
41 // const, types, etcpp.
42 private:
44 /** @short TODO */
45 enum EJob
47 E_JOB_UNKNOWN,
48 E_DO_EMERGENCY_SAVE,
49 E_DO_RECOVERY,
50 E_DO_CRASHREPORT
53 //-------------------------------------------
54 // member
55 private:
57 /** @short TODO */
58 css::uno::Reference< css::uno::XComponentContext > m_xContext;
60 /** @short TODO */
61 Window* m_pParentWindow;
63 /** @short TODO */
64 RecoveryUI::EJob m_eJob;
66 /** @short TODO */
67 css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
69 //-------------------------------------------
70 // interface
71 public:
73 //---------------------------------------
74 /** @short TODO */
75 RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext);
77 //---------------------------------------
78 /** @short TODO */
79 virtual ~RecoveryUI();
81 //---------------------------------------
82 // css.lang.XServiceInfo
84 virtual OUString SAL_CALL getImplementationName()
85 throw(css::uno::RuntimeException);
87 virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName)
88 throw(css::uno::RuntimeException);
90 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
91 throw(css::uno::RuntimeException);
93 //---------------------------------------
94 virtual com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue(const css::util::URL& aURL,
95 const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
96 throw(css::uno::RuntimeException);
98 //---------------------------------------
99 // css.frame.XDispatch
101 virtual void SAL_CALL dispatch(const css::util::URL& aURL ,
102 const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
103 throw(css::uno::RuntimeException);
105 virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
106 const css::util::URL& aURL )
107 throw(css::uno::RuntimeException);
108 virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
109 const css::util::URL& aURL )
110 throw(css::uno::RuntimeException);
112 //---------------------------------------
113 // XServiceInfo helper
115 static OUString st_getImplementationName();
116 static css::uno::Sequence< OUString > st_getSupportedServiceNames();
117 static css::uno::Reference< css::uno::XInterface > SAL_CALL st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR);
119 //-------------------------------------------
120 // helper
121 private:
123 EJob impl_classifyJob(const css::util::URL& aURL);
125 sal_Bool impl_doEmergencySave();
127 void impl_doRecovery();
129 void impl_showAllRecoveredDocs();
131 void impl_doCrashReport();
135 } // namespace svx
137 #endif // _RECOVERYUI_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */