2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-21 22:06:52 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2013-10-28 03:41:20 +01:00
|
|
|
#ifndef INCLUDED_SVX_SOURCE_INC_DOCRECOVERY_HXX
|
|
|
|
#define INCLUDED_SVX_SOURCE_INC_DOCRECOVERY_HXX
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
#include <vcl/dialog.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/fixed.hxx>
|
2013-07-16 09:12:42 +01:00
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#include <vcl/tabdlg.hxx>
|
|
|
|
#include <vcl/tabpage.hxx>
|
|
|
|
#include <svtools/simptabl.hxx>
|
|
|
|
#include <svtools/svlbitm.hxx>
|
2005-02-02 12:58:07 +00:00
|
|
|
#include <svtools/svmedit2.hxx>
|
2012-10-11 16:13:12 -04:00
|
|
|
#include <svtools/treelistbox.hxx>
|
2017-02-13 10:45:55 +02:00
|
|
|
#include <o3tl/typed_flags_set.hxx>
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2015-09-06 19:59:36 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2013-02-25 15:17:03 +02:00
|
|
|
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
|
2004-11-26 13:21:56 +00:00
|
|
|
#include <com/sun/star/frame/XStatusListener.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatch.hpp>
|
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
|
|
|
|
|
|
|
|
2014-12-18 13:34:45 +01:00
|
|
|
#define RECOVERY_CMDPART_PROTOCOL "vnd.sun.star.autorecovery:"
|
2013-04-07 12:06:47 +02:00
|
|
|
|
2014-12-18 13:34:45 +01:00
|
|
|
#define RECOVERY_CMDPART_DO_EMERGENCY_SAVE "/doEmergencySave"
|
|
|
|
#define RECOVERY_CMDPART_DO_RECOVERY "/doAutoRecovery"
|
2013-04-07 12:06:47 +02:00
|
|
|
|
2015-05-17 09:47:07 +02:00
|
|
|
#define RECOVERY_CMD_DO_PREPARE_EMERGENCY_SAVE "vnd.sun.star.autorecovery:/doPrepareEmergencySave"
|
2014-12-18 13:34:45 +01:00
|
|
|
#define RECOVERY_CMD_DO_EMERGENCY_SAVE "vnd.sun.star.autorecovery:/doEmergencySave"
|
|
|
|
#define RECOVERY_CMD_DO_RECOVERY "vnd.sun.star.autorecovery:/doAutoRecovery"
|
2015-05-17 09:47:07 +02:00
|
|
|
#define RECOVERY_CMD_DO_ENTRY_BACKUP "vnd.sun.star.autorecovery:/doEntryBackup"
|
|
|
|
#define RECOVERY_CMD_DO_ENTRY_CLEANUP "vnd.sun.star.autorecovery:/doEntryCleanUp"
|
2013-04-07 12:06:47 +02:00
|
|
|
|
2014-12-18 13:34:45 +01:00
|
|
|
#define PROP_STATUSINDICATOR "StatusIndicator"
|
|
|
|
#define PROP_DISPATCHASYNCHRON "DispatchAsynchron"
|
|
|
|
#define PROP_SAVEPATH "SavePath"
|
|
|
|
#define PROP_ENTRYID "EntryID"
|
2013-04-07 12:06:47 +02:00
|
|
|
|
2015-05-17 09:47:07 +02:00
|
|
|
#define STATEPROP_ID "ID"
|
|
|
|
#define STATEPROP_STATE "DocumentState"
|
|
|
|
#define STATEPROP_ORGURL "OriginalURL"
|
|
|
|
#define STATEPROP_TEMPURL "TempURL"
|
|
|
|
#define STATEPROP_FACTORYURL "FactoryURL"
|
|
|
|
#define STATEPROP_TEMPLATEURL "TemplateURL"
|
|
|
|
#define STATEPROP_TITLE "Title"
|
|
|
|
#define STATEPROP_MODULE "Module"
|
2013-04-07 12:06:47 +02:00
|
|
|
|
2014-12-18 13:34:45 +01:00
|
|
|
#define RECOVERY_OPERATIONSTATE_START "start"
|
|
|
|
#define RECOVERY_OPERATIONSTATE_STOP "stop"
|
|
|
|
#define RECOVERY_OPERATIONSTATE_UPDATE "update"
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
#define DLG_RET_UNKNOWN -1
|
|
|
|
#define DLG_RET_OK 1
|
|
|
|
#define DLG_RET_CANCEL 0
|
|
|
|
#define DLG_RET_OK_AUTOLUNCH 101
|
|
|
|
|
|
|
|
|
2017-02-13 10:45:55 +02:00
|
|
|
enum class EDocStates
|
2004-11-26 13:21:56 +00:00
|
|
|
{
|
|
|
|
/* TEMP STATES */
|
|
|
|
|
|
|
|
/// default state, if a document was new created or loaded
|
2017-02-13 10:45:55 +02:00
|
|
|
Unknown = 0x000,
|
2004-11-26 13:21:56 +00:00
|
|
|
/** an action was started (saving/loading) ... Can be interesting later if the process may be was interrupted by an exception. */
|
2017-02-13 10:45:55 +02:00
|
|
|
TryLoadBackup = 0x010,
|
|
|
|
TryLoadOriginal = 0x020,
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
/* FINAL STATES */
|
|
|
|
|
2014-04-29 19:25:03 +00:00
|
|
|
/// the Auto/Emergency saved document isn't useable any longer
|
2017-02-13 10:45:55 +02:00
|
|
|
Damaged = 0x040,
|
2014-11-10 15:05:25 +01:00
|
|
|
/// the Auto/Emergency saved document is not really up-to-date (some changes can be missing)
|
2017-02-13 10:45:55 +02:00
|
|
|
Incomplete = 0x080,
|
2004-11-26 13:21:56 +00:00
|
|
|
/// the Auto/Emergency saved document was processed successfully
|
2017-02-13 10:45:55 +02:00
|
|
|
Succeeded = 0x200
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
2017-02-13 10:45:55 +02:00
|
|
|
namespace o3tl {
|
|
|
|
template<> struct typed_flags<EDocStates> : is_typed_flags<EDocStates, 0x2f0> {};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace svx{
|
|
|
|
namespace DocRecovery{
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
enum ERecoveryState
|
|
|
|
{
|
|
|
|
E_SUCCESSFULLY_RECOVERED,
|
|
|
|
E_ORIGINAL_DOCUMENT_RECOVERED,
|
|
|
|
E_RECOVERY_FAILED,
|
2008-07-22 06:41:15 +00:00
|
|
|
E_RECOVERY_IS_IN_PROGRESS,
|
2004-11-26 13:21:56 +00:00
|
|
|
E_NOT_RECOVERED_YET
|
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
struct TURLInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/// unique ID, which is specified by the underlying autorecovery core!
|
|
|
|
sal_Int32 ID;
|
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/// the full qualified document URL
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString OrgURL;
|
2005-02-02 12:58:07 +00:00
|
|
|
|
|
|
|
/// the full qualified URL of the temp. file (if it's exists)
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TempURL;
|
2005-02-02 12:58:07 +00:00
|
|
|
|
|
|
|
/// a may be existing factory URL (e.g. for untitled documents)
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString FactoryURL;
|
2005-02-02 12:58:07 +00:00
|
|
|
|
|
|
|
/// may be the document base on a template file !?
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString TemplateURL;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
/// the pure file name, without path, disc etcpp.
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString DisplayName;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/// the application module, where this document was loaded
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString Module;
|
2005-02-02 12:58:07 +00:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/// state info as e.g. VALID, CORRUPTED, NON EXISTING ...
|
2017-02-13 10:45:55 +02:00
|
|
|
EDocStates DocState;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
/// ui representation for DocState!
|
|
|
|
ERecoveryState RecoveryState;
|
|
|
|
|
|
|
|
/// standard icon
|
|
|
|
Image StandardImage;
|
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
TURLInfo()
|
|
|
|
: ID (-1 )
|
2017-02-13 10:45:55 +02:00
|
|
|
, DocState (EDocStates::Unknown)
|
2005-02-02 12:58:07 +00:00
|
|
|
, RecoveryState(E_NOT_RECOVERED_YET)
|
|
|
|
{}
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
typedef ::std::vector< TURLInfo > TURLList;
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
class IRecoveryUpdateListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// inform listener about changed items, which should be refreshed
|
|
|
|
virtual void updateItems() = 0;
|
|
|
|
|
|
|
|
// inform listener about starting of the asynchronous recovery operation
|
|
|
|
virtual void start() = 0;
|
|
|
|
|
|
|
|
// inform listener about ending of the asynchronous recovery operation
|
|
|
|
virtual void end() = 0;
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
virtual void stepNext(TURLInfo* pItem) = 0;
|
2012-03-14 13:27:56 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~IRecoveryUpdateListener() {}
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2015-09-06 19:59:36 +09:00
|
|
|
class RecoveryCore : public ::cppu::WeakImplHelper< css::frame::XStatusListener >
|
2004-11-26 13:21:56 +00:00
|
|
|
{
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// types, const
|
|
|
|
public:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// member
|
|
|
|
private:
|
|
|
|
|
|
|
|
/// TODO
|
2012-10-18 10:58:02 +02:00
|
|
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
/// TODO
|
|
|
|
css::uno::Reference< css::frame::XDispatch > m_xRealCore;
|
|
|
|
|
|
|
|
/// TODO
|
|
|
|
css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
|
|
|
|
|
|
|
|
/// TODO
|
|
|
|
TURLList m_lURLs;
|
|
|
|
|
|
|
|
/// TODO
|
|
|
|
IRecoveryUpdateListener* m_pListener;
|
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short knows the reason, why we listen on our internal m_xRealCore
|
|
|
|
member.
|
|
|
|
|
|
|
|
@descr Because we listen for different operations
|
|
|
|
on the core dispatch implementation, we must know,
|
|
|
|
which URL we have to use for deregistration!
|
|
|
|
*/
|
2013-03-15 10:56:55 +09:00
|
|
|
bool m_bListenForSaving;
|
2005-02-02 12:58:07 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// native interface
|
|
|
|
public:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2012-10-18 10:58:02 +02:00
|
|
|
RecoveryCore(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
2013-03-15 10:56:55 +09:00
|
|
|
bool bUsedForSaving);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~RecoveryCore() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2016-04-13 13:32:22 +02:00
|
|
|
const css::uno::Reference< css::uno::XComponentContext >& getComponentContext();
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2015-01-20 12:38:10 +02:00
|
|
|
TURLList& getURLListAccess();
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2013-03-15 10:56:55 +09:00
|
|
|
static bool isBrokenTempEntry(const TURLInfo& rInfo);
|
2015-01-20 12:38:10 +02:00
|
|
|
void saveBrokenTempEntries(const OUString& sSaveDir);
|
|
|
|
void saveAllTempEntries(const OUString& sSaveDir);
|
|
|
|
void forgetBrokenTempEntries();
|
|
|
|
void forgetAllRecoveryEntries();
|
2005-11-11 08:01:59 +00:00
|
|
|
void forgetBrokenRecoveryEntries();
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2015-01-20 12:38:10 +02:00
|
|
|
void setProgressHandler(const css::uno::Reference< css::task::XStatusIndicator >& xProgress);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2015-01-20 12:38:10 +02:00
|
|
|
void setUpdateListener(IRecoveryUpdateListener* pListener);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2015-01-20 12:38:10 +02:00
|
|
|
void doEmergencySavePrepare();
|
|
|
|
void doEmergencySave();
|
|
|
|
void doRecovery();
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2017-02-13 10:45:55 +02:00
|
|
|
static ERecoveryState mapDocState2RecoverState(EDocStates eDocState);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// uno interface
|
|
|
|
public:
|
|
|
|
|
|
|
|
// css.frame.XStatusListener
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& aEvent) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
// css.lang.XEventListener
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// helper
|
|
|
|
private:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short starts listening on the internal EmergencySave/AutoRecovery core.
|
|
|
|
*/
|
2004-11-26 13:21:56 +00:00
|
|
|
void impl_startListening();
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short stop listening on the internal EmergencySave/AutoRecovery core.
|
|
|
|
*/
|
|
|
|
void impl_stopListening();
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2013-04-07 12:06:47 +02:00
|
|
|
css::util::URL impl_getParsedURL(const OUString& sURL);
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
class PluginProgressWindow : public vcl::Window
|
2004-11-26 13:21:56 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
css::uno::Reference< css::lang::XComponent > m_xProgress;
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
PluginProgressWindow( vcl::Window* pParent ,
|
2004-11-26 13:21:56 +00:00
|
|
|
const css::uno::Reference< css::lang::XComponent >& xProgress);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~PluginProgressWindow() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2015-09-06 19:59:36 +09:00
|
|
|
class PluginProgress : public ::cppu::WeakImplHelper< css::task::XStatusIndicator ,
|
2004-11-26 13:21:56 +00:00
|
|
|
css::lang::XComponent >
|
|
|
|
{
|
|
|
|
// member
|
|
|
|
private:
|
|
|
|
/** @short TODO */
|
|
|
|
css::uno::Reference< css::task::XStatusIndicatorFactory > m_xProgressFactory;
|
|
|
|
|
|
|
|
css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
|
|
|
|
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<PluginProgressWindow> m_pPlugProgressWindow;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// native interface
|
|
|
|
public:
|
|
|
|
/** @short TODO */
|
2014-09-23 11:20:40 +02:00
|
|
|
PluginProgress( vcl::Window* pParent,
|
2013-02-25 15:17:03 +02:00
|
|
|
const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~PluginProgress() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// uno interface
|
|
|
|
public:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// XStatusIndicator
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual void SAL_CALL start(const OUString& sText ,
|
2017-01-26 12:28:58 +01:00
|
|
|
sal_Int32 nRange) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL end() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL setText(const OUString& sText) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL setValue(sal_Int32 nValue) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL reset() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// XComponent
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener >& xListener) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-05-24 17:11:09 +01:00
|
|
|
class SaveDialog : public Dialog
|
2004-11-26 13:21:56 +00:00
|
|
|
{
|
|
|
|
// member
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<ListBox> m_pFileListLB;
|
|
|
|
VclPtr<OKButton> m_pOkBtn;
|
2004-11-26 13:21:56 +00:00
|
|
|
RecoveryCore* m_pCore;
|
|
|
|
|
|
|
|
// interface
|
|
|
|
public:
|
|
|
|
/** @short create all child controls of this dialog.
|
|
|
|
|
2014-04-29 19:25:03 +00:00
|
|
|
@descr The dialog isn't shown nor it starts any
|
2004-11-26 13:21:56 +00:00
|
|
|
action by itself!
|
|
|
|
|
|
|
|
@param pParent
|
|
|
|
can point to a parent window.
|
|
|
|
If its set to 0, the defmodal-dialog-parent
|
2014-04-26 19:28:59 +02:00
|
|
|
is used automatically.
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
@param pCore
|
|
|
|
provides access to the recovery core service
|
|
|
|
and the current list of open documents,
|
|
|
|
which should be shown inside this dialog.
|
|
|
|
*/
|
2014-09-23 11:20:40 +02:00
|
|
|
SaveDialog(vcl::Window* pParent, RecoveryCore* pCore);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SaveDialog() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(OKButtonHdl, Button*, void);
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SaveProgressDialog : public ModalDialog
|
|
|
|
, public IRecoveryUpdateListener
|
|
|
|
{
|
|
|
|
// member
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<vcl::Window> m_pProgrParent;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
// @short TODO
|
|
|
|
RecoveryCore* m_pCore;
|
|
|
|
|
|
|
|
// @short TODO
|
|
|
|
css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
|
|
|
|
// interface
|
|
|
|
public:
|
|
|
|
/** @short create all child controls of this dialog.
|
|
|
|
|
2014-04-29 19:25:03 +00:00
|
|
|
@descr The dialog isn't shown nor it starts any
|
2004-11-26 13:21:56 +00:00
|
|
|
action by itself!
|
|
|
|
|
|
|
|
@param pParent
|
|
|
|
can point to a parent window.
|
|
|
|
If its set to 0, the defmodal-dialog-parent
|
2014-04-26 19:28:59 +02:00
|
|
|
is used automatically.
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
@param pCore
|
2016-01-09 22:55:28 +01:00
|
|
|
used to start emergency save.
|
2004-11-26 13:21:56 +00:00
|
|
|
*/
|
2014-09-23 11:20:40 +02:00
|
|
|
SaveProgressDialog(vcl::Window* pParent,
|
2004-11-26 13:21:56 +00:00
|
|
|
RecoveryCore* pCore );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SaveProgressDialog() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
/** @short start the emergency save operation. */
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual short Execute() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
// IRecoveryUpdateListener
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void updateItems() override;
|
|
|
|
virtual void stepNext(TURLInfo* pItem) override;
|
|
|
|
virtual void start() override;
|
|
|
|
virtual void end() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
class RecovDocListEntry : public SvLBoxString
|
|
|
|
{
|
2012-11-29 14:17:48 -05:00
|
|
|
public:
|
|
|
|
|
|
|
|
/** @short TODO */
|
2016-03-18 11:02:37 +02:00
|
|
|
RecovDocListEntry( const OUString& sText );
|
2012-11-29 14:17:48 -05:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2012-11-29 14:17:48 -05:00
|
|
|
/** @short TODO */
|
2015-05-11 09:41:13 +09:00
|
|
|
virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext,
|
2015-10-12 16:04:04 +02:00
|
|
|
const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2013-07-16 09:12:42 +01:00
|
|
|
class RecovDocList : public SvSimpleTable
|
2004-11-26 13:21:56 +00:00
|
|
|
{
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// member
|
|
|
|
public:
|
|
|
|
|
|
|
|
Image m_aGreenCheckImg;
|
|
|
|
Image m_aYellowCheckImg;
|
|
|
|
Image m_aRedCrossImg;
|
|
|
|
|
2012-10-25 11:26:43 +01:00
|
|
|
OUString m_aSuccessRecovStr;
|
|
|
|
OUString m_aOrigDocRecovStr;
|
|
|
|
OUString m_aRecovFailedStr;
|
|
|
|
OUString m_aRecovInProgrStr;
|
|
|
|
OUString m_aNotRecovYetStr;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// interface
|
|
|
|
public:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2013-07-16 09:12:42 +01:00
|
|
|
RecovDocList(SvSimpleTableContainer& rParent, ResMgr& rResMgr);
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2012-10-25 11:26:43 +01:00
|
|
|
virtual void InitEntry(SvTreeListEntry* pEntry,
|
|
|
|
const OUString& rText,
|
|
|
|
const Image& rImage1,
|
|
|
|
const Image& rImage2,
|
2015-10-12 16:04:04 +02:00
|
|
|
SvLBoxButtonKind eButtonKind) override;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2014-06-04 14:56:04 +01:00
|
|
|
class RecoveryDialog : public Dialog
|
2004-11-26 13:21:56 +00:00
|
|
|
, public IRecoveryUpdateListener
|
|
|
|
{
|
|
|
|
// member
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<FixedText> m_pDescrFT;
|
|
|
|
VclPtr<vcl::Window> m_pProgrParent;
|
|
|
|
VclPtr<RecovDocList> m_pFileListLB;
|
|
|
|
VclPtr<PushButton> m_pNextBtn;
|
|
|
|
VclPtr<PushButton> m_pCancelBtn;
|
2013-09-04 11:03:46 +02:00
|
|
|
OUString m_aTitleRecoveryInProgress;
|
|
|
|
OUString m_aRecoveryOnlyFinish;
|
|
|
|
OUString m_aRecoveryOnlyFinishDescr;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
RecoveryCore* m_pCore;
|
|
|
|
css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
|
2008-07-22 06:41:15 +00:00
|
|
|
enum EInternalRecoveryState
|
2005-02-02 12:58:07 +00:00
|
|
|
{
|
2015-10-01 13:15:39 +02:00
|
|
|
E_RECOVERY_PREPARED, // dialog started... recovery prepared
|
2005-02-02 12:58:07 +00:00
|
|
|
E_RECOVERY_IN_PROGRESS, // recovery core still in progress
|
|
|
|
E_RECOVERY_CORE_DONE, // recovery core finished it's task
|
|
|
|
E_RECOVERY_DONE, // user clicked "next" button
|
|
|
|
E_RECOVERY_CANCELED, // user clicked "cancel" button
|
|
|
|
E_RECOVERY_CANCELED_BEFORE, // user clicked "cancel" button before recovery was started
|
2015-10-01 13:15:39 +02:00
|
|
|
E_RECOVERY_CANCELED_AFTERWARDS, // user clicked "cancel" button after recovery was finished
|
|
|
|
E_RECOVERY_HANDLED // the recovery wizard page was shown already... and will be shown now again...
|
2005-02-02 12:58:07 +00:00
|
|
|
};
|
|
|
|
sal_Int32 m_eRecoveryState;
|
2013-07-26 09:36:53 +02:00
|
|
|
bool m_bWaitForCore;
|
|
|
|
bool m_bWasRecoveryStarted;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
// member
|
|
|
|
public:
|
|
|
|
/** @short TODO */
|
2014-09-23 11:20:40 +02:00
|
|
|
RecoveryDialog(vcl::Window* pParent,
|
2004-11-26 13:21:56 +00:00
|
|
|
RecoveryCore* pCore );
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~RecoveryDialog() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
// IRecoveryUpdateListener
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void updateItems() override;
|
|
|
|
virtual void stepNext(TURLInfo* pItem) override;
|
|
|
|
virtual void start() override;
|
|
|
|
virtual void end() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-06-04 14:56:04 +01:00
|
|
|
short execute();
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// helper
|
|
|
|
private:
|
|
|
|
/** @short TODO */
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(NextButtonHdl, Button*, void);
|
|
|
|
DECL_LINK(CancelButtonHdl, Button*, void);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2008-07-22 06:41:15 +00:00
|
|
|
/** @short TODO */
|
2013-09-04 11:03:46 +02:00
|
|
|
OUString impl_getStatusString( const TURLInfo& rInfo ) const;
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
class BrokenRecoveryDialog : public ModalDialog
|
|
|
|
{
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// member
|
|
|
|
private:
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<ListBox> m_pFileListLB;
|
|
|
|
VclPtr<Edit> m_pSaveDirED;
|
|
|
|
VclPtr<PushButton> m_pSaveDirBtn;
|
|
|
|
VclPtr<PushButton> m_pOkBtn;
|
|
|
|
VclPtr<CancelButton> m_pCancelBtn;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_sSavePath;
|
2004-11-26 13:21:56 +00:00
|
|
|
RecoveryCore* m_pCore;
|
2013-03-15 10:56:55 +09:00
|
|
|
bool m_bBeforeRecovery;
|
2014-04-14 16:15:22 +02:00
|
|
|
bool m_bExecutionNeeded;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// interface
|
|
|
|
public:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2014-09-23 11:20:40 +02:00
|
|
|
BrokenRecoveryDialog(vcl::Window* pParent ,
|
2005-02-02 12:58:07 +00:00
|
|
|
RecoveryCore* pCore ,
|
2013-03-15 10:56:55 +09:00
|
|
|
bool bBeforeRecovery);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~BrokenRecoveryDialog() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2015-01-20 12:38:10 +02:00
|
|
|
bool isExecutionNeeded();
|
2005-02-02 12:58:07 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short TODO */
|
2016-04-13 13:32:22 +02:00
|
|
|
const OUString& getSaveDirURL();
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
// helper
|
|
|
|
private:
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short TODO */
|
|
|
|
void impl_refresh();
|
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(SaveButtonHdl, Button*, void);
|
2004-11-26 13:21:56 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2004-11-26 13:21:56 +00:00
|
|
|
/** @short TODO */
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(OkButtonHdl, Button*, void);
|
2005-02-02 12:58:07 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short TODO */
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(CancelButtonHdl, Button*, void);
|
2005-02-02 12:58:07 +00:00
|
|
|
|
2014-02-25 20:51:35 +01:00
|
|
|
|
2005-02-02 12:58:07 +00:00
|
|
|
/** @short TODO */
|
|
|
|
void impl_askForSavePath();
|
2004-11-26 13:21:56 +00:00
|
|
|
};
|
2015-05-15 13:27:19 +02:00
|
|
|
}
|
|
|
|
}
|
2004-11-26 13:21:56 +00:00
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|