summaryrefslogtreecommitdiff
path: root/offapi/com
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 /offapi/com
parentee1407608c0d228e4705215e9700af3200511cc8 (diff)
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 'offapi/com')
-rw-r--r--offapi/com/sun/star/document/ReadOnlyOpenRequest.idl51
-rw-r--r--offapi/com/sun/star/document/ReloadEditableRequest.idl50
2 files changed, 101 insertions, 0 deletions
diff --git a/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl b/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl
new file mode 100644
index 000000000000..49a82b7016f9
--- /dev/null
+++ b/offapi/com/sun/star/document/ReadOnlyOpenRequest.idl
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 .
+ */
+#ifndef __com_sun_star_document_ReadOnlyOpenRequest_idl__
+#define __com_sun_star_document_ReadOnlyOpenRequest_idl__
+
+#include <com/sun/star/uno/Exception.idl>
+
+module com
+{
+ module sun
+ {
+ module star
+ {
+ module document
+ {
+ /** Is used for interaction handle to query user decision regarding whether to open
+ a document read-only and whether to notify the user when the document becomes
+ editable.
+
+ @since LibreOffice 7.2
+ */
+ published exception ReadOnlyOpenRequest : ::com::sun::star::uno::Exception
+ {
+ /** The URL of the document that is open but was made editable.
+ */
+ string DocumentURL;
+ };
+ };
+ };
+ };
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/offapi/com/sun/star/document/ReloadEditableRequest.idl b/offapi/com/sun/star/document/ReloadEditableRequest.idl
new file mode 100644
index 000000000000..f091bcf26f69
--- /dev/null
+++ b/offapi/com/sun/star/document/ReloadEditableRequest.idl
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 .
+ */
+#ifndef __com_sun_star_document_ReloadEditableRequest_idl__
+#define __com_sun_star_document_ReloadEditableRequest_idl__
+
+#include <com/sun/star/uno/Exception.idl>
+
+module com
+{
+ module sun
+ {
+ module star
+ {
+ module document
+ {
+ /** Is used for interaction handle to query user decision regarding reloading a
+ document that was recently made editable.
+
+ @since LibreOffice 7.2
+ */
+ published exception ReloadEditableRequest : ::com::sun::star::uno::Exception
+ {
+ /** The URL of the document that is open but was made editable.
+ */
+ string DocumentURL;
+ };
+ };
+ };
+ };
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */