summaryrefslogtreecommitdiffstats
path: root/include/sfx2
diff options
context:
space:
mode:
authorMatt K <mattkse@gmail.com>2021-02-26 10:24:38 -0600
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-27 12:31:38 +0200
commit95eb088802562b75f8b299908160145c7e88d763 (patch)
treedbabada569f125ca900906463a697b1e606dbae5 /include/sfx2
parentsw_ooxmlexport14: simplify code (diff)
downloadcore-95eb088802562b75f8b299908160145c7e88d763.tar.gz
core-95eb088802562b75f8b299908160145c7e88d763.zip
tdf#47065 Add new file open UI options and implement a new thread
Add new UI options when opening a locked or non-writeable document to allow the user to be notified when such a document becomes editable . If the user selects "Notify", then that document is added to a list of open documents to be checked by a thread every 60 seconds for read/write access and whether lock file is available/obtainable. If access is allowed for a document, then show UI dialog to the user asking to Reload that document. If Reload is selected by the user then that document is reloaded with read/write access. The checking thread is spawned only once no matter how many "Notify" documents there are. The thread is spawned if not already running when a new "Notify" document is opened, and it terminates when all "Notify" documents have been closed or the application terminates. Also update badstatics clang plugin to ignore new global variables introduced. Change-Id: I7555ce6f5df79c2c87216e0129ef3b2883c7d921 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111654 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/docfile.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index ad316dd2fca8..83bcb91c5812 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -30,6 +30,7 @@
#include <svl/itemset.hxx>
#include <tools/link.hxx>
#include <tools/stream.hxx>
+#include <mutex>
namespace com::sun::star::beans { struct PropertyValue; }
namespace com::sun::star::embed { class XStorage; }
@@ -53,6 +54,7 @@ class SfxMedium_Impl;
class INetURLObject;
class SfxFrame;
class DateTime;
+struct ImplSVEvent;
namespace weld
{
@@ -93,6 +95,15 @@ public:
virtual ~SfxMedium() override;
+ DECL_STATIC_LINK(SfxMedium, ShowReloadEditableDialog, void*, void);
+ bool CheckCanGetLockfile() const;
+ void SetOriginallyReadOnly(bool val);
+ void AddToCheckEditableWorkerList();
+ void SetWorkerReloadEvent(ImplSVEvent* pEvent);
+ ImplSVEvent* GetWorkerReloadEvent() const;
+ std::shared_ptr<std::recursive_mutex> GetCheckEditableMutex() const;
+ void CancelCheckEditableEntry(bool bRemoveEvent = true);
+
void UseInteractionHandler( bool );
css::uno::Reference< css::task::XInteractionHandler >
GetInteractionHandler( bool bGetAlways = false );
@@ -291,6 +302,7 @@ private:
bool bIsLoading, bool bOwnLock, bool bHandleSysLocked);
enum class MessageDlg { LockFileIgnore, LockFileCorrupt };
bool ShowLockFileProblemDialog(MessageDlg nWhichDlg);
+ bool ShowReadOnlyOpenDialog();
};