From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sun, 7 Apr 2024 11:06:44 +0200
Subject: Adding upstream version 4:7.4.7.
Signed-off-by: Daniel Baumann
---
include/sfx2/AccessibilityCheck.hxx | 34 +
include/sfx2/AccessibilityIssue.hxx | 59 ++
include/sfx2/DocumentMetadataAccess.hxx | 152 ++++
include/sfx2/DocumentSigner.hxx | 47 ++
include/sfx2/LokControlHandler.hxx | 155 ++++
include/sfx2/Metadatable.hxx | 170 ++++
include/sfx2/QuerySaveDocument.hxx | 43 +
include/sfx2/StyleManager.hxx | 51 ++
include/sfx2/StylePreviewRenderer.hxx | 57 ++
include/sfx2/XmlIdRegistry.hxx | 67 ++
include/sfx2/app.hxx | 233 ++++++
include/sfx2/basedlgs.hxx | 136 +++
include/sfx2/bindings.hxx | 208 +++++
include/sfx2/brokenpackageint.hxx | 63 ++
include/sfx2/chalign.hxx | 55 ++
include/sfx2/charwin.hxx | 72 ++
include/sfx2/childwin.hxx | 235 ++++++
include/sfx2/classificationhelper.hxx | 227 +++++
include/sfx2/ctrlitem.hxx | 97 +++
.../sfx2/devtools/DevelopmentToolChildWindow.hxx | 27 +
.../sfx2/devtools/DevelopmentToolDockingWindow.hxx | 72 ++
include/sfx2/devtools/DocumentModelTreeHandler.hxx | 52 ++
.../sfx2/devtools/ObjectInspectorTreeHandler.hxx | 101 +++
include/sfx2/devtools/ObjectInspectorWidgets.hxx | 55 ++
include/sfx2/dialoghelper.hxx | 41 +
include/sfx2/digitalsignatures.hxx | 38 +
include/sfx2/dinfdlg.hxx | 579 +++++++++++++
include/sfx2/dispatch.hxx | 184 +++++
include/sfx2/dllapi.h | 36 +
include/sfx2/docfac.hxx | 96 +++
include/sfx2/docfile.hxx | 309 +++++++
include/sfx2/docfilt.hxx | 125 +++
include/sfx2/docinf.hxx | 75 ++
include/sfx2/docinsert.hxx | 77 ++
include/sfx2/dockwin.hxx | 130 +++
include/sfx2/docmacromode.hxx | 307 +++++++
include/sfx2/docstoragemodifylistener.hxx | 82 ++
include/sfx2/doctempl.hxx | 117 +++
include/sfx2/event.hxx | 268 ++++++
include/sfx2/evntconf.hxx | 102 +++
include/sfx2/fcontnr.hxx | 119 +++
include/sfx2/filedlghelper.hxx | 313 +++++++
include/sfx2/flatpak.hxx | 33 +
include/sfx2/frame.hxx | 203 +++++
include/sfx2/frmdescr.hxx | 102 +++
include/sfx2/frmhtml.hxx | 38 +
include/sfx2/frmhtmlw.hxx | 71 ++
include/sfx2/groupid.hxx | 74 ++
include/sfx2/htmlmode.hxx | 31 +
include/sfx2/infobar.hxx | 140 ++++
include/sfx2/inputdlg.hxx | 38 +
include/sfx2/ipclient.hxx | 101 +++
include/sfx2/linkmgr.hxx | 187 +++++
include/sfx2/linksrc.hxx | 118 +++
include/sfx2/listview.hxx | 116 +++
include/sfx2/lnkbase.hxx | 179 ++++
include/sfx2/lokcallback.hxx | 51 ++
include/sfx2/lokcomponenthelpers.hxx | 90 ++
include/sfx2/lokhelper.hxx | 171 ++++
include/sfx2/mailmodelapi.hxx | 104 +++
include/sfx2/mieclip.hxx | 43 +
include/sfx2/minfitem.hxx | 70 ++
include/sfx2/module.hxx | 103 +++
include/sfx2/msg.hxx | 264 ++++++
include/sfx2/msgpool.hxx | 74 ++
include/sfx2/navigat.hxx | 43 +
include/sfx2/new.hxx | 108 +++
include/sfx2/newstyle.hxx | 55 ++
include/sfx2/notebookbar/SfxNotebookBar.hxx | 89 ++
include/sfx2/objface.hxx | 121 +++
include/sfx2/objitem.hxx | 48 ++
include/sfx2/objsh.hxx | 918 +++++++++++++++++++++
include/sfx2/opengrf.hxx | 72 ++
include/sfx2/pageids.hxx | 71 ++
include/sfx2/passwd.hxx | 130 +++
include/sfx2/printer.hxx | 62 ++
include/sfx2/printopt.hxx | 86 ++
include/sfx2/progress.hxx | 63 ++
include/sfx2/request.hxx | 129 +++
include/sfx2/safemode.hxx | 73 ++
include/sfx2/sfxbasecontroller.hxx | 218 +++++
include/sfx2/sfxbasemodel.hxx | 753 +++++++++++++++++
include/sfx2/sfxdlg.hxx | 155 ++++
include/sfx2/sfxhelp.hxx | 64 ++
include/sfx2/sfxhtml.hxx | 113 +++
include/sfx2/sfxmodelfactory.hxx | 66 ++
include/sfx2/sfxresid.hxx | 30 +
include/sfx2/sfxsids.hrc | 739 +++++++++++++++++
include/sfx2/sfxstatuslistener.hxx | 74 ++
include/sfx2/sfxuno.hxx | 50 ++
include/sfx2/shell.hxx | 587 +++++++++++++
include/sfx2/sidebar/AsynchronousCall.hxx | 52 ++
include/sfx2/sidebar/Context.hxx | 58 ++
include/sfx2/sidebar/ControllerItem.hxx | 79 ++
include/sfx2/sidebar/Deck.hxx | 87 ++
include/sfx2/sidebar/FocusManager.hxx | 140 ++++
include/sfx2/sidebar/IContextChangeReceiver.hxx | 40 +
include/sfx2/sidebar/ILayoutableWindow.hxx | 40 +
include/sfx2/sidebar/Panel.hxx | 123 +++
include/sfx2/sidebar/PanelLayout.hxx | 52 ++
include/sfx2/sidebar/ResourceManager.hxx | 132 +++
include/sfx2/sidebar/Sidebar.hxx | 67 ++
include/sfx2/sidebar/SidebarChildWindow.hxx | 46 ++
include/sfx2/sidebar/SidebarController.hxx | 302 +++++++
include/sfx2/sidebar/SidebarDockingWindow.hxx | 66 ++
include/sfx2/sidebar/SidebarModelUpdate.hxx | 33 +
include/sfx2/sidebar/SidebarPanelBase.hxx | 102 +++
include/sfx2/sidebar/TabBar.hxx | 136 +++
include/sfx2/sidebar/Theme.hxx | 184 +++++
include/sfx2/signaturestate.hxx | 54 ++
include/sfx2/stbitem.hxx | 134 +++
include/sfx2/strings.hrc | 361 ++++++++
include/sfx2/styfitem.hxx | 62 ++
include/sfx2/styledlg.hxx | 52 ++
include/sfx2/tabdlg.hxx | 269 ++++++
include/sfx2/tbxctrl.hxx | 142 ++++
include/sfx2/templatedlg.hxx | 193 +++++
include/sfx2/templatedlglocalview.hxx | 72 ++
include/sfx2/templatelocalview.hxx | 192 +++++
include/sfx2/templateproperties.hxx | 29 +
include/sfx2/templdlg.hxx | 46 ++
include/sfx2/thumbnailview.hxx | 331 ++++++++
include/sfx2/thumbnailviewitem.hxx | 138 ++++
include/sfx2/toolbarids.hxx | 77 ++
include/sfx2/tplpitem.hxx | 53 ++
include/sfx2/userinputinterception.hxx | 82 ++
include/sfx2/viewfac.hxx | 60 ++
include/sfx2/viewfrm.hxx | 277 +++++++
include/sfx2/viewsh.hxx | 435 ++++++++++
include/sfx2/watermarkitem.hxx | 47 ++
include/sfx2/weldutils.hxx | 67 ++
include/sfx2/xmldump.hxx | 29 +
include/sfx2/zoomitem.hxx | 81 ++
133 files changed, 17806 insertions(+)
create mode 100644 include/sfx2/AccessibilityCheck.hxx
create mode 100644 include/sfx2/AccessibilityIssue.hxx
create mode 100644 include/sfx2/DocumentMetadataAccess.hxx
create mode 100644 include/sfx2/DocumentSigner.hxx
create mode 100644 include/sfx2/LokControlHandler.hxx
create mode 100644 include/sfx2/Metadatable.hxx
create mode 100644 include/sfx2/QuerySaveDocument.hxx
create mode 100644 include/sfx2/StyleManager.hxx
create mode 100644 include/sfx2/StylePreviewRenderer.hxx
create mode 100644 include/sfx2/XmlIdRegistry.hxx
create mode 100644 include/sfx2/app.hxx
create mode 100644 include/sfx2/basedlgs.hxx
create mode 100644 include/sfx2/bindings.hxx
create mode 100644 include/sfx2/brokenpackageint.hxx
create mode 100644 include/sfx2/chalign.hxx
create mode 100644 include/sfx2/charwin.hxx
create mode 100644 include/sfx2/childwin.hxx
create mode 100644 include/sfx2/classificationhelper.hxx
create mode 100644 include/sfx2/ctrlitem.hxx
create mode 100644 include/sfx2/devtools/DevelopmentToolChildWindow.hxx
create mode 100644 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
create mode 100644 include/sfx2/devtools/DocumentModelTreeHandler.hxx
create mode 100644 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
create mode 100644 include/sfx2/devtools/ObjectInspectorWidgets.hxx
create mode 100644 include/sfx2/dialoghelper.hxx
create mode 100644 include/sfx2/digitalsignatures.hxx
create mode 100644 include/sfx2/dinfdlg.hxx
create mode 100644 include/sfx2/dispatch.hxx
create mode 100644 include/sfx2/dllapi.h
create mode 100644 include/sfx2/docfac.hxx
create mode 100644 include/sfx2/docfile.hxx
create mode 100644 include/sfx2/docfilt.hxx
create mode 100644 include/sfx2/docinf.hxx
create mode 100644 include/sfx2/docinsert.hxx
create mode 100644 include/sfx2/dockwin.hxx
create mode 100644 include/sfx2/docmacromode.hxx
create mode 100644 include/sfx2/docstoragemodifylistener.hxx
create mode 100644 include/sfx2/doctempl.hxx
create mode 100644 include/sfx2/event.hxx
create mode 100644 include/sfx2/evntconf.hxx
create mode 100644 include/sfx2/fcontnr.hxx
create mode 100644 include/sfx2/filedlghelper.hxx
create mode 100644 include/sfx2/flatpak.hxx
create mode 100644 include/sfx2/frame.hxx
create mode 100644 include/sfx2/frmdescr.hxx
create mode 100644 include/sfx2/frmhtml.hxx
create mode 100644 include/sfx2/frmhtmlw.hxx
create mode 100644 include/sfx2/groupid.hxx
create mode 100644 include/sfx2/htmlmode.hxx
create mode 100644 include/sfx2/infobar.hxx
create mode 100644 include/sfx2/inputdlg.hxx
create mode 100644 include/sfx2/ipclient.hxx
create mode 100644 include/sfx2/linkmgr.hxx
create mode 100644 include/sfx2/linksrc.hxx
create mode 100644 include/sfx2/listview.hxx
create mode 100644 include/sfx2/lnkbase.hxx
create mode 100644 include/sfx2/lokcallback.hxx
create mode 100644 include/sfx2/lokcomponenthelpers.hxx
create mode 100644 include/sfx2/lokhelper.hxx
create mode 100644 include/sfx2/mailmodelapi.hxx
create mode 100644 include/sfx2/mieclip.hxx
create mode 100644 include/sfx2/minfitem.hxx
create mode 100644 include/sfx2/module.hxx
create mode 100644 include/sfx2/msg.hxx
create mode 100644 include/sfx2/msgpool.hxx
create mode 100644 include/sfx2/navigat.hxx
create mode 100644 include/sfx2/new.hxx
create mode 100644 include/sfx2/newstyle.hxx
create mode 100644 include/sfx2/notebookbar/SfxNotebookBar.hxx
create mode 100644 include/sfx2/objface.hxx
create mode 100644 include/sfx2/objitem.hxx
create mode 100644 include/sfx2/objsh.hxx
create mode 100644 include/sfx2/opengrf.hxx
create mode 100644 include/sfx2/pageids.hxx
create mode 100644 include/sfx2/passwd.hxx
create mode 100644 include/sfx2/printer.hxx
create mode 100644 include/sfx2/printopt.hxx
create mode 100644 include/sfx2/progress.hxx
create mode 100644 include/sfx2/request.hxx
create mode 100644 include/sfx2/safemode.hxx
create mode 100644 include/sfx2/sfxbasecontroller.hxx
create mode 100644 include/sfx2/sfxbasemodel.hxx
create mode 100644 include/sfx2/sfxdlg.hxx
create mode 100644 include/sfx2/sfxhelp.hxx
create mode 100644 include/sfx2/sfxhtml.hxx
create mode 100644 include/sfx2/sfxmodelfactory.hxx
create mode 100644 include/sfx2/sfxresid.hxx
create mode 100644 include/sfx2/sfxsids.hrc
create mode 100644 include/sfx2/sfxstatuslistener.hxx
create mode 100644 include/sfx2/sfxuno.hxx
create mode 100644 include/sfx2/shell.hxx
create mode 100644 include/sfx2/sidebar/AsynchronousCall.hxx
create mode 100644 include/sfx2/sidebar/Context.hxx
create mode 100644 include/sfx2/sidebar/ControllerItem.hxx
create mode 100644 include/sfx2/sidebar/Deck.hxx
create mode 100644 include/sfx2/sidebar/FocusManager.hxx
create mode 100644 include/sfx2/sidebar/IContextChangeReceiver.hxx
create mode 100644 include/sfx2/sidebar/ILayoutableWindow.hxx
create mode 100644 include/sfx2/sidebar/Panel.hxx
create mode 100644 include/sfx2/sidebar/PanelLayout.hxx
create mode 100644 include/sfx2/sidebar/ResourceManager.hxx
create mode 100644 include/sfx2/sidebar/Sidebar.hxx
create mode 100644 include/sfx2/sidebar/SidebarChildWindow.hxx
create mode 100644 include/sfx2/sidebar/SidebarController.hxx
create mode 100644 include/sfx2/sidebar/SidebarDockingWindow.hxx
create mode 100644 include/sfx2/sidebar/SidebarModelUpdate.hxx
create mode 100644 include/sfx2/sidebar/SidebarPanelBase.hxx
create mode 100644 include/sfx2/sidebar/TabBar.hxx
create mode 100644 include/sfx2/sidebar/Theme.hxx
create mode 100644 include/sfx2/signaturestate.hxx
create mode 100644 include/sfx2/stbitem.hxx
create mode 100644 include/sfx2/strings.hrc
create mode 100644 include/sfx2/styfitem.hxx
create mode 100644 include/sfx2/styledlg.hxx
create mode 100644 include/sfx2/tabdlg.hxx
create mode 100644 include/sfx2/tbxctrl.hxx
create mode 100644 include/sfx2/templatedlg.hxx
create mode 100644 include/sfx2/templatedlglocalview.hxx
create mode 100644 include/sfx2/templatelocalview.hxx
create mode 100644 include/sfx2/templateproperties.hxx
create mode 100644 include/sfx2/templdlg.hxx
create mode 100644 include/sfx2/thumbnailview.hxx
create mode 100644 include/sfx2/thumbnailviewitem.hxx
create mode 100644 include/sfx2/toolbarids.hxx
create mode 100644 include/sfx2/tplpitem.hxx
create mode 100644 include/sfx2/userinputinterception.hxx
create mode 100644 include/sfx2/viewfac.hxx
create mode 100644 include/sfx2/viewfrm.hxx
create mode 100644 include/sfx2/viewsh.hxx
create mode 100644 include/sfx2/watermarkitem.hxx
create mode 100644 include/sfx2/weldutils.hxx
create mode 100644 include/sfx2/xmldump.hxx
create mode 100644 include/sfx2/zoomitem.hxx
(limited to 'include/sfx2')
diff --git a/include/sfx2/AccessibilityCheck.hxx b/include/sfx2/AccessibilityCheck.hxx
new file mode 100644
index 000000000..4c90ad31d
--- /dev/null
+++ b/include/sfx2/AccessibilityCheck.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+
+namespace sfx
+{
+class SFX2_DLLPUBLIC AccessibilityCheck
+{
+protected:
+ AccessibilityIssueCollection m_aIssueCollection;
+
+public:
+ AccessibilityCheck() = default;
+ virtual ~AccessibilityCheck();
+
+ virtual void check() = 0;
+
+ AccessibilityIssueCollection& getIssueCollection();
+};
+
+} // end sfx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/AccessibilityIssue.hxx b/include/sfx2/AccessibilityIssue.hxx
new file mode 100644
index 000000000..4cc9a72e7
--- /dev/null
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+
+namespace sfx
+{
+enum class AccessibilityIssueID
+{
+ UNSPECIFIED, // TODO: remove - temporary
+ DOCUMENT_TITLE,
+ DOCUMENT_LANGUAGE,
+ STYLE_LANGUAGE,
+ NO_ALT_OLE,
+ NO_ALT_GRAPHIC,
+ NO_ALT_SHAPE,
+ TABLE_MERGE_SPLIT,
+ TEXT_FORMATTING,
+};
+
+class SFX2_DLLPUBLIC AccessibilityIssue
+{
+public:
+ AccessibilityIssue(AccessibilityIssueID eIssueID = AccessibilityIssueID::UNSPECIFIED);
+ virtual ~AccessibilityIssue();
+
+ virtual bool canGotoIssue() const = 0;
+ virtual void gotoIssue() const = 0;
+
+ AccessibilityIssueID m_eIssueID;
+ OUString m_aIssueText;
+};
+
+class SFX2_DLLPUBLIC AccessibilityIssueCollection
+{
+private:
+ std::vector> m_aIssues;
+
+public:
+ AccessibilityIssueCollection() = default;
+
+ std::vector>& getIssues();
+};
+
+} // end sfx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/DocumentMetadataAccess.hxx b/include/sfx2/DocumentMetadataAccess.hxx
new file mode 100644
index 000000000..bcbf9f1b3
--- /dev/null
+++ b/include/sfx2/DocumentMetadataAccess.hxx
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
+#define INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
+
+#include
+
+#include
+
+#include
+
+#include
+
+#include
+
+
+/** Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess
+
+ This is not a service only because it needs some kind of XML ID registry
+ from the document, and i do not like defining an API for that.
+ Also, the implementation does _no_ locking, so make sure access is
+ protected externally.
+ */
+
+namespace com::sun::star::embed {
+ class XStorage;
+}
+namespace com::sun::star::frame {
+ class XModel;
+}
+
+namespace com::sun::star::uno { class XComponentContext; }
+
+class SfxObjectShell;
+
+namespace sfx2 {
+
+
+/** create a base URI for loading metadata from an ODF (sub)document.
+
+ @param i_xContext component context
+ @param i_xModel model of the document (required if no URI is provided)
+ @param i_rPkgURI the URI for the package
+ @param i_rSubDocument (optional) path of the subdocument in package
+
+ @return a base URI suitable for XDocumentMetadataAccess::loadFromStorage
+ */
+css::uno::Reference< css::rdf::XURI> SFX2_DLLPUBLIC
+createBaseURI(
+ css::uno::Reference const & i_xContext,
+ css::uno::Reference const & i_xModel,
+ OUString const & i_rPkgURI,
+ std::u16string_view i_rSubDocument = std::u16string_view());
+
+
+struct DocumentMetadataAccess_Impl;
+
+class DocumentMetadataAccess final :
+ public cppu::WeakImplHelper
+{
+ DocumentMetadataAccess(const DocumentMetadataAccess&) = delete;
+ DocumentMetadataAccess& operator=( const DocumentMetadataAccess& ) = delete;
+public:
+ explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext,
+ SfxObjectShell const & i_rRegistrySupplier,
+ OUString const & i_rBaseURI);
+ // N.B.: in contrast to previous, this constructor does _not_ initialize!
+ // caller must immediately call loadFromStorage/Medium!
+ explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext,
+ SfxObjectShell const & i_rRegistrySupplier);
+ virtual ~DocumentMetadataAccess() override;
+
+ // css::rdf::XNode:
+ virtual OUString SAL_CALL getStringValue() override;
+
+ // css::rdf::XURI:
+ virtual OUString SAL_CALL getNamespace() override;
+ virtual OUString SAL_CALL getLocalName() override;
+
+ // css::rdf::XRepositorySupplier:
+ virtual css::uno::Reference<
+ css::rdf::XRepository > SAL_CALL getRDFRepository() override;
+
+ // css::rdf::XDocumentMetadataAccess:
+ virtual css::uno::Reference<
+ css::rdf::XMetadatable > SAL_CALL
+ getElementByMetadataReference(
+ const css::beans::StringPair & i_rReference) override;
+ virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL
+ getElementByURI(const css::uno::Reference< css::rdf::XURI > & i_xURI) override;
+ virtual css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
+ const css::uno::Reference< css::rdf::XURI > & i_xType) override;
+ virtual css::uno::Reference< css::rdf::XURI> SAL_CALL
+ addMetadataFile(const OUString & i_rFileName,
+ const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > & i_rTypes) override;
+ virtual css::uno::Reference< css::rdf::XURI> SAL_CALL
+ importMetadataFile(::sal_Int16 i_Format,
+ const css::uno::Reference< css::io::XInputStream > & i_xInStream,
+ const OUString & i_rFileName,
+ const css::uno::Reference< css::rdf::XURI > & i_xBaseURI,
+ const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > & i_rTypes) override;
+ virtual void SAL_CALL removeMetadataFile(
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xGraphName) override;
+ virtual void SAL_CALL addContentOrStylesFile(
+ const OUString & i_rFileName) override;
+ virtual void SAL_CALL removeContentOrStylesFile(
+ const OUString & i_rFileName) override;
+
+ virtual void SAL_CALL loadMetadataFromStorage(
+ const css::uno::Reference<
+ css::embed::XStorage > & i_xStorage,
+ const css::uno::Reference<
+ css::rdf::XURI > & i_xBaseURI,
+ const css::uno::Reference<
+ css::task::XInteractionHandler> & i_xHandler) override;
+ virtual void SAL_CALL storeMetadataToStorage(
+ const css::uno::Reference<
+ css::embed::XStorage > & i_xStorage) override;
+ virtual void SAL_CALL loadMetadataFromMedium(
+ const css::uno::Sequence<
+ css::beans::PropertyValue > & i_rMedium) override;
+ virtual void SAL_CALL storeMetadataToMedium(
+ const css::uno::Sequence<
+ css::beans::PropertyValue > & i_rMedium) override;
+
+private:
+ std::unique_ptr m_pImpl;
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/DocumentSigner.hxx b/include/sfx2/DocumentSigner.hxx
new file mode 100644
index 000000000..8059cb9cb
--- /dev/null
+++ b/include/sfx2/DocumentSigner.hxx
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#ifndef INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+#define INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+
+#include
+#include
+#include
+
+namespace com::sun::star::security
+{
+class XCertificate;
+}
+namespace com::sun::star::uno
+{
+template class Reference;
+}
+
+namespace sfx2
+{
+class SFX2_DLLPUBLIC DocumentSigner
+{
+private:
+ OUString m_aUrl;
+
+public:
+ DocumentSigner(OUString const& rUrl)
+ : m_aUrl(rUrl)
+ {
+ }
+
+ bool signDocument(css::uno::Reference const& rxCertificate);
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_SFX2_DOCUMENTSIGNER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/LokControlHandler.hxx b/include/sfx2/LokControlHandler.hxx
new file mode 100644
index 000000000..c422afc97
--- /dev/null
+++ b/include/sfx2/LokControlHandler.hxx
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class LokControlHandler
+{
+public:
+ static bool postMouseEvent(const SdrPage* pPage, const SdrView* pDrawView,
+ vcl::Window const& rMainWindow, int nType, Point aPointHmm,
+ int nCount, int nButtons, int nModifier)
+ {
+ SdrObjListIter aIterator(pPage, SdrIterMode::Flat);
+ while (aIterator.IsMore())
+ {
+ SdrObject* pObject = aIterator.Next();
+ SdrUnoObj* pUnoObect = dynamic_cast(pObject);
+ if (pUnoObect)
+ {
+ tools::Rectangle aControlRectHMM = pUnoObect->GetLogicRect();
+ if (aControlRectHMM.Contains(aPointHmm))
+ {
+ css::uno::Reference xControl
+ = pUnoObect->GetUnoControl(*pDrawView, *rMainWindow.GetOutDev());
+ if (!xControl.is())
+ return false;
+
+ css::uno::Reference xControlWindow(xControl,
+ css::uno::UNO_QUERY);
+ if (!xControlWindow.is())
+ return false;
+
+ css::uno::Reference xWindowPeer(xControl->getPeer());
+
+ VclPtr pWindow = VCLUnoHelper::GetWindow(xWindowPeer);
+ if (pWindow)
+ {
+ Point aControlRelativePositionHMM = aPointHmm - aControlRectHMM.TopLeft();
+ Point aControlRelativePosition = o3tl::convert(
+ aControlRelativePositionHMM, o3tl::Length::mm100, o3tl::Length::px);
+
+ LokMouseEventData aMouseEventData(nType, aControlRelativePosition, nCount,
+ MouseEventModifiers::SIMPLECLICK,
+ nButtons, nModifier);
+
+ SfxLokHelper::postMouseEventAsync(pWindow, aMouseEventData);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ static void drawUnoControl(const SdrView* pDrawView, const SdrUnoObj* pUnoObect,
+ vcl::Window const& rMainWindow, VirtualDevice& rDevice,
+ tools::Rectangle const& rTileRectHMM, double scaleX, double scaleY)
+ {
+ css::uno::Reference xControl
+ = pUnoObect->GetUnoControl(*pDrawView, *rMainWindow.GetOutDev());
+ if (!xControl.is())
+ return;
+
+ css::uno::Reference xControlWindow(xControl, css::uno::UNO_QUERY);
+ if (!xControlWindow.is())
+ return;
+
+ css::uno::Reference xGraphics(rDevice.CreateUnoGraphics());
+ if (!xGraphics.is())
+ return;
+
+ css::uno::Reference xControlView(xControl, css::uno::UNO_QUERY);
+ if (!xControlView.is())
+ return;
+
+ tools::Rectangle aObjectRectHMM = pUnoObect->GetLogicRect();
+ Point aOffsetFromTile(aObjectRectHMM.Left() - rTileRectHMM.Left(),
+ aObjectRectHMM.Top() - rTileRectHMM.Top());
+ tools::Rectangle aRectangleHMM(aOffsetFromTile, aObjectRectHMM.GetSize());
+ tools::Rectangle aRectanglePx
+ = o3tl::convert(aRectangleHMM, o3tl::Length::mm100, o3tl::Length::px);
+
+ xControlWindow->setPosSize(0, 0, aRectanglePx.GetWidth(), aRectanglePx.GetHeight(),
+ css::awt::PosSize::POSSIZE);
+
+ xControlView->setGraphics(xGraphics);
+
+ xControlView->draw(aRectanglePx.Left() * scaleX, aRectanglePx.Top() * scaleY);
+ }
+
+ static void paintControlTile(const SdrPage* pPage, const SdrView* pDrawView,
+ vcl::Window const& rMainWindow, VirtualDevice& rDevice,
+ Size aOutputSize, tools::Rectangle const& rTileRect)
+ {
+ tools::Rectangle aTileRectHMM
+ = o3tl::convert(rTileRect, o3tl::Length::twip, o3tl::Length::mm100);
+
+ // Resizes the virtual device so to contain the entries context
+ rDevice.SetOutputSizePixel(aOutputSize);
+
+ rDevice.Push(vcl::PushFlags::MAPMODE);
+ MapMode aDeviceMapMode(rDevice.GetMapMode());
+
+ const Fraction scale = conversionFract(o3tl::Length::px, o3tl::Length::mm100);
+ Fraction scaleX = Fraction(aOutputSize.Width(), aTileRectHMM.GetWidth()) * scale;
+ Fraction scaleY = Fraction(aOutputSize.Height(), aTileRectHMM.GetHeight()) * scale;
+ aDeviceMapMode.SetScaleX(scaleX);
+ aDeviceMapMode.SetScaleY(scaleY);
+ rDevice.SetMapMode(aDeviceMapMode);
+
+ SdrObjListIter aIterator(pPage, SdrIterMode::Flat);
+
+ while (aIterator.IsMore())
+ {
+ SdrObject* pObject = aIterator.Next();
+ SdrUnoObj* pUnoObect = dynamic_cast(pObject);
+ if (pUnoObect)
+ {
+ tools::Rectangle aObjectRectHMM = pUnoObect->GetLogicRect();
+
+ // Check if we intersect with the tile rectangle and we
+ // need to draw the control.
+ if (aObjectRectHMM.Overlaps(aTileRectHMM))
+ {
+ drawUnoControl(pDrawView, pUnoObect, rMainWindow, rDevice, aTileRectHMM,
+ double(scaleX), double(scaleY));
+ }
+ }
+ }
+
+ rDevice.Pop();
+ }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/Metadatable.hxx b/include/sfx2/Metadatable.hxx
new file mode 100644
index 000000000..a84bddb89
--- /dev/null
+++ b/include/sfx2/Metadatable.hxx
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_METADATABLE_HXX
+#define INCLUDED_SFX2_METADATABLE_HXX
+
+#include
+
+#include
+
+#include
+#include
+
+#include
+
+
+namespace com::sun::star {
+ namespace frame { class XModel; }
+}
+
+namespace sfx2 {
+ class IXmlIdRegistry;
+}
+
+namespace sfx2 {
+
+class XmlIdRegistry;
+class MetadatableUndo;
+
+
+// XML ID handling ---------------------------------------------------
+
+
+/// create a sfx2::XmlIdRegistryDocument or a sfx2::XmlIdRegistryClipboard
+SFX2_DLLPUBLIC ::sfx2::IXmlIdRegistry *
+createXmlIdRegistry(const bool i_DocIsClipboard);
+
+
+/** base class for core objects that may have xml:id.
+
+ The interface of this class consists of 3 parts:
+
- implementations that are used by the MetadatableMixin
+ below
+ - hooks to be called by the sw core whenever actions that are
+ relevant to the uniqueness of xml:ids are taken (copying,
+ splitting, merging, deletion, undo, etc.)
+ - abstract methods that are called by the implementation of the
+ previous hooks
+
+ */
+class SFX2_DLLPUBLIC Metadatable
+{
+public:
+ Metadatable() : m_pReg(nullptr) {}
+
+ // destructor calls RemoveMetadataReference
+ virtual ~Metadatable();
+
+ // for MetadatableMixin ----------------------------------------------
+
+ css::beans::StringPair GetMetadataReference() const;
+ void SetMetadataReference( const css::beans::StringPair & i_rReference);
+ void EnsureMetadataReference();
+
+ // hooks -------------------------------------------------------------
+
+ // called from dtor!
+ void RemoveMetadataReference();
+
+ /** register this as a copy of i_rSource */
+ void RegisterAsCopyOf(Metadatable const & i_rSource,
+ const bool i_bCopyPrecedesSource = false);
+
+ /** create an Undo Metadatable, which remembers this' reference */
+ std::shared_ptr CreateUndo() const;
+ std::shared_ptr CreateUndoForDelete();
+
+ /** restore this from Undo Metadatable */
+ void RestoreMetadata(std::shared_ptr const& i_pUndo);
+
+ /** merge this and i_rOther into this */
+ void JoinMetadatable(Metadatable const & i_rOther,
+ const bool i_isMergedEmpty, const bool i_isOtherEmpty);
+
+ // abstract methods --------------------------------------------------
+
+ /** get the registry from the SwDoc */
+ virtual ::sfx2::IXmlIdRegistry& GetRegistry() = 0;
+
+ /** is this in a clipboard document? */
+ virtual bool IsInClipboard() const = 0;
+
+ /** is this in undo array? */
+ virtual bool IsInUndo() const = 0;
+
+ /** which stream is this in? true: content.xml; false: styles.xml */
+ virtual bool IsInContent() const = 0;
+
+ /** create XMetadatable from this.
+ note: if IsInUndo or IsInClipboard return true,
+ MakeUnoObject must not be called!
+ */
+ virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject() = 0;
+
+private:
+ Metadatable(const Metadatable&) = delete;
+ Metadatable& operator=(const Metadatable&) = delete;
+
+ friend class MetadatableClipboard;
+ friend class MetadatableUndo;
+
+ // note that Reg may be a XmlIdRegistryDocument or a XmlIdRegistryClipboard
+ XmlIdRegistry* m_pReg; // null => no XmlId
+};
+
+
+/** base class for UNO objects that implement XMetadatable.
+
+ An instance of this base class is associated with an instance of
+ Metadatable.
+ */
+class SFX2_DLLPUBLIC MetadatableMixin :
+ public cppu::WeakImplHelper
+{
+
+public:
+ MetadatableMixin() {};
+
+ // css::rdf::XNode:
+ virtual OUString SAL_CALL getStringValue() override;
+
+ // css::rdf::XURI:
+ virtual OUString SAL_CALL getLocalName() override;
+ virtual OUString SAL_CALL getNamespace() override;
+
+ // css::rdf::XMetadatable:
+ virtual css::beans::StringPair SAL_CALL getMetadataReference() override;
+ virtual void SAL_CALL setMetadataReference(
+ const css::beans::StringPair & i_rReference) override;
+ virtual void SAL_CALL ensureMetadataReference() override;
+
+protected:
+ /// get the core object corresponding to this UNO object.
+ virtual Metadatable * GetCoreObject() = 0;
+ /// get the XModel for the document
+ virtual css::uno::Reference< css::frame::XModel >
+ GetModel() = 0;
+
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_SFX2_METADATABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/QuerySaveDocument.hxx b/include/sfx2/QuerySaveDocument.hxx
new file mode 100644
index 000000000..2d800be80
--- /dev/null
+++ b/include/sfx2/QuerySaveDocument.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_QUERYSAVEDOCUMENT_HXX
+#define INCLUDED_SFX2_QUERYSAVEDOCUMENT_HXX
+
+#include
+
+#include
+
+#include
+
+namespace weld
+{
+class Widget;
+}
+
+/** Opens the general query save document dialog.
+ @param _pParent
+ The parent window.
+ @_rTitle
+ The title of the document.
+*/
+SFX2_DLLPUBLIC short ExecuteQuerySaveDocument(weld::Widget* _pParent, std::u16string_view _rTitle);
+
+#endif // INCLUDED_SFX2_QUERYSAVEDOCUMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/StyleManager.hxx b/include/sfx2/StyleManager.hxx
new file mode 100644
index 000000000..1c19b981d
--- /dev/null
+++ b/include/sfx2/StyleManager.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_SFX2_STYLEMANAGER_HXX
+#define INCLUDED_SFX2_STYLEMANAGER_HXX
+
+#include
+
+#include
+#include
+
+#include
+
+class OutputDevice;
+class SfxObjectShell;
+namespace sfx2 { class StylePreviewRenderer; }
+
+namespace sfx2
+{
+
+class SFX2_DLLPUBLIC StyleManager
+{
+protected:
+ SfxObjectShell& mrShell;
+
+public:
+ StyleManager(SfxObjectShell& rShell)
+ : mrShell(rShell)
+ {}
+
+ virtual ~StyleManager()
+ {}
+
+ SfxStyleSheetBase* Search(std::u16string_view rStyleName, SfxStyleFamily eFamily);
+
+ virtual std::unique_ptr CreateStylePreviewRenderer(
+ OutputDevice& rOutputDev, SfxStyleSheetBase* pStyle,
+ tools::Long nMaxHeight) = 0;
+};
+
+} // end namespace sfx2
+
+#endif //INCLUDED_SFX2_STYLEMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/StylePreviewRenderer.hxx b/include/sfx2/StylePreviewRenderer.hxx
new file mode 100644
index 000000000..1692182bd
--- /dev/null
+++ b/include/sfx2/StylePreviewRenderer.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_SFX2_STYLEPREVIEWRENDERER_HXX
+#define INCLUDED_SFX2_STYLEPREVIEWRENDERER_HXX
+
+#include
+#include
+
+class OutputDevice;
+class SfxStyleSheetBase;
+
+namespace sfx2
+{
+
+class SFX2_DLLPUBLIC StylePreviewRenderer
+{
+protected:
+ const SfxObjectShell& mrShell;
+ OutputDevice& mrOutputDev;
+ SfxStyleSheetBase* mpStyle;
+ tools::Long mnMaxHeight;
+
+public:
+ enum class RenderAlign
+ {
+ TOP, CENTER
+ };
+
+ StylePreviewRenderer(const SfxObjectShell& rShell,
+ OutputDevice& rOutputDev,
+ SfxStyleSheetBase* pStyle,
+ tools::Long nMaxHeight)
+ : mrShell(rShell)
+ , mrOutputDev(rOutputDev)
+ , mpStyle(pStyle)
+ , mnMaxHeight(nMaxHeight)
+ {}
+
+ virtual ~StylePreviewRenderer()
+ {}
+
+ virtual bool recalculate() = 0;
+ virtual bool render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign = RenderAlign::CENTER) = 0;
+};
+
+} // end namespace sfx2
+
+#endif // INCLUDED_SVX_STYLEPREVIEWRENDERER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/XmlIdRegistry.hxx b/include/sfx2/XmlIdRegistry.hxx
new file mode 100644
index 000000000..494c83020
--- /dev/null
+++ b/include/sfx2/XmlIdRegistry.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_XMLIDREGISTRY_HXX
+#define INCLUDED_SFX2_XMLIDREGISTRY_HXX
+
+#include
+
+#include
+
+#include
+
+namespace com::sun::star::beans { struct StringPair; }
+namespace com::sun::star::uno { template class Reference; }
+
+namespace com::sun::star::rdf {
+ class XMetadatable;
+}
+
+namespace sfx2 {
+
+// XML ID utilities --------------------------------------------------
+
+/** is i_rIdref a valid NCName ? */
+bool SFX2_DLLPUBLIC isValidNCName(std::u16string_view i_rIdref);
+
+bool SFX2_DLLPUBLIC isValidXmlId(std::u16string_view i_rStreamName,
+ std::u16string_view i_rIdref);
+
+// XML ID handling ---------------------------------------------------
+
+/** interface for getElementByMetadataReference;
+ for use by sfx2::DocumentMetadataAccess
+ */
+class SFX2_DLLPUBLIC IXmlIdRegistry
+{
+
+public:
+ virtual ~IXmlIdRegistry() { }
+
+ virtual css::uno::Reference< css::rdf::XMetadatable >
+ GetElementByMetadataReference(
+ const css::beans::StringPair & i_rXmlId) const = 0;
+
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_SFX2_XMLIDREGISTRY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
new file mode 100644
index 000000000..3be667198
--- /dev/null
+++ b/include/sfx2/app.hxx
@@ -0,0 +1,233 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_APP_HXX
+#define INCLUDED_SFX2_APP_HXX
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+namespace com::sun::star::script { class XLibraryContainer; }
+
+namespace weld { class Window; }
+
+class BasicManager;
+class DdeService;
+class SfxAppData_Impl;
+class SfxDispatcher;
+class SfxEventHint;
+class SfxItemSet;
+class SfxObjectShell;
+class SfxObjectShellLock;
+class SfxProgress;
+class SfxSlotPool;
+class SfxViewFrame;
+class StarBASIC;
+class SfxWorkWindow;
+class SfxFilterMatcher;
+class SfxModule;
+struct SfxChildWinFactory;
+struct SfxStbCtrlFactory;
+struct SfxTbxCtrlFactory;
+class SbxArray;
+class SbxValue;
+
+namespace sfx2
+{
+ namespace sidebar {
+ class Theme;
+ }
+}
+
+enum class SfxToolsModule
+{
+ Math = 0,
+ Calc = 1,
+ Draw = 2,
+ Writer = 3,
+ Basic = 4,
+ LAST = Basic
+};
+
+class SFX2_DLLPUBLIC SfxLinkItem final : public SfxPoolItem
+{
+ Link aLink;
+public:
+ SfxLinkItem( sal_uInt16 nWhichId, const Link& rValue ) : SfxPoolItem( nWhichId )
+ { aLink = rValue; }
+
+ virtual SfxLinkItem* Clone( SfxItemPool* = nullptr ) const override
+ { return new SfxLinkItem( *this ); }
+ virtual bool operator==( const SfxPoolItem& rL) const override
+ { return static_cast(rL).aLink == aLink; }
+ const Link&
+ GetValue() const { return aLink; }
+};
+
+// This is a singleton class. Sad that there apparently is no other
+// way than a comment like this to indicate that to the code reader.
+class SFX2_DLLPUBLIC SfxApplication final : public SfxShell
+{
+ std::unique_ptr pImpl;
+
+ DECL_DLLPRIVATE_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, bool );
+
+ void Deinitialize();
+
+public:
+ SFX_DECL_INTERFACE(SFX_INTERFACE_SFXAPP)
+
+private:
+ /// SfxInterface initializer.
+ static void InitInterface_Impl();
+ SfxApplication();
+
+public:
+ virtual ~SfxApplication() override;
+ static SfxApplication* GetOrCreate();
+ static SfxApplication* Get();
+
+ // DDE
+#if defined(_WIN32)
+ static bool DdeExecute( const OUString& rCmd );
+#endif
+ bool InitializeDde();
+ const DdeService* GetDdeService() const;
+ DdeService* GetDdeService();
+#if defined(_WIN32)
+ void AddDdeTopic( SfxObjectShell* );
+#endif
+ void RemoveDdeTopic( SfxObjectShell const * );
+
+ // "static" methods
+ /**
+ * @param pArgs Takes ownership
+ */
+ ErrCode LoadTemplate( SfxObjectShellLock& xDoc, const OUString& rFileName, std::unique_ptr pArgs );
+ weld::Window* GetTopWindow() const;
+
+ // members
+ SfxFilterMatcher& GetFilterMatcher();
+ SfxProgress* GetProgress() const;
+ sal_uInt16 GetFreeIndex();
+ void ReleaseIndex(sal_uInt16 i);
+
+ // Basic/Scripting
+ static bool IsXScriptURL( const OUString& rScriptURL );
+ static OUString ChooseScript(weld::Window *pParent);
+ static void MacroOrganizer(weld::Window* pParent, sal_Int16 nTabId);
+ static ErrCode CallBasic( const OUString&, BasicManager*, SbxArray *pArgs, SbxValue *pRet );
+ static ErrCode CallAppBasic( const OUString& i_macroName )
+ { return CallBasic( i_macroName, SfxApplication::GetBasicManager(), nullptr, nullptr ); }
+ static BasicManager* GetBasicManager();
+ css::script::XLibraryContainer * GetDialogContainer();
+ css::script::XLibraryContainer * GetBasicContainer();
+ static StarBASIC* GetBasic();
+ void SaveBasicAndDialogContainer() const;
+
+ // misc.
+ static void GetOptions(SfxItemSet &);
+ void SetOptions(const SfxItemSet &);
+ virtual void Invalidate(sal_uInt16 nId = 0) override;
+ void NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = true );
+ bool IsDowning() const;
+ void ResetLastDir();
+
+ SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
+ SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
+
+ SAL_DLLPRIVATE void SetOptions_Impl(const SfxItemSet &);
+ SAL_DLLPRIVATE void Initialize_Impl();
+
+ SAL_DLLPRIVATE SfxAppData_Impl* Get_Impl() const { return pImpl.get(); }
+
+ // Object-Factories/global arrays
+ SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, const SfxChildWinFactory&);
+ SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, const SfxStbCtrlFactory&);
+ SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const SfxTbxCtrlFactory&);
+ SAL_DLLPRIVATE SfxTbxCtrlFactory* GetTbxCtrlFactory(const std::type_info& rSlotType, sal_uInt16 nSlotID) const;
+ SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& rSlotType, sal_uInt16 nSlotID) const;
+ SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) const;
+ SAL_DLLPRIVATE std::vector& GetViewFrames_Impl() const;
+ SAL_DLLPRIVATE std::vector& GetViewShells_Impl() const;
+ SAL_DLLPRIVATE std::vector& GetObjectShells_Impl() const;
+ SAL_DLLPRIVATE void SetViewFrame_Impl(SfxViewFrame *pViewFrame);
+
+ // Slot Methods
+ // TODO/CLEANUP: still needed?
+ SAL_DLLPRIVATE void NewDocDirectExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE static void NewDocDirectState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void NewDocExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void OpenDocExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void OpenRemoteExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void SignPDFExec_Impl(SfxRequest&);
+ SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE static void PropExec_Impl(SfxRequest const &);
+ SAL_DLLPRIVATE static void PropState_Impl(SfxItemSet &);
+ SAL_DLLPRIVATE void OfaExec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE static void OfaState_Impl(SfxItemSet &);
+
+ SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *);
+ SAL_DLLPRIVATE const OUString& GetLastDir_Impl() const;
+ SAL_DLLPRIVATE void SetLastDir_Impl( const OUString & );
+
+ SAL_DLLPRIVATE static void Registrations_Impl();
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl(const SfxViewFrame *pFrame) const;
+
+ // TODO/CLEANUP: still needed? -- unclear whether this comment
+ // refers to the GetDisabledSlotList_Impl() method which was
+ // already removed, or the below methods?
+ SAL_DLLPRIVATE SfxSlotPool& GetAppSlotPool_Impl() const;
+ SAL_DLLPRIVATE static SfxModule* GetModule_Impl();
+
+ static void SetModule(SfxToolsModule nSharedLib, std::unique_ptr pModule);
+ static SfxModule* GetModule(SfxToolsModule nSharedLib);
+
+ static bool loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWidth);
+
+ /** loads the application logo as used in the impress slideshow pause screen */
+ static BitmapEx GetApplicationLogo(tools::Long nWidth);
+
+ /** if true then dialog/infobar notifications like the tip of the day or
+ version change infobar should be suppressed */
+ static bool IsHeadlessOrUITest();
+
+ static bool IsTipOfTheDayDue();
+
+ /** this Theme contains Images so must be deleted before DeInitVCL */
+ sfx2::sidebar::Theme & GetSidebarTheme();
+};
+
+inline SfxApplication* SfxGetpApp()
+{
+ return SfxApplication::Get();
+}
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
new file mode 100644
index 000000000..b753569ef
--- /dev/null
+++ b/include/sfx2/basedlgs.hxx
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_BASEDLGS_HXX
+#define INCLUDED_SFX2_BASEDLGS_HXX
+
+#include
+#include
+#include
+#include
+
+class SfxTabPage;
+class SfxBindings;
+class SfxChildWindow;
+struct SfxChildWinInfo;
+class SfxItemSet;
+struct WhichRangesContainer;
+
+class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController
+{
+private:
+ DECL_DLLPRIVATE_STATIC_LINK(SfxDialogController, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
+
+ DECL_DLLPRIVATE_LINK(FocusChangeHdl, weld::Container&, void);
+
+public:
+ SfxDialogController(weld::Widget* pParent, const OUString& rUIFile, const OString& rDialogId);
+ // dialog gets focus
+ virtual void Activate() {}
+ // dialog loses focus
+ virtual void Deactivate() {}
+
+ // when the dialog has an associated SfxChildWin, typically for Modeless interaction
+ virtual void ChildWinDispose() {} // called from the associated SfxChildWin dtor
+ virtual void Close(); // called by the SfxChildWin when the dialog is closed
+ virtual void EndDialog(int nResponse); // called by the SfxChildWin to close the dialog
+};
+
+class SfxModelessDialog_Impl;
+
+class SFX2_DLLPUBLIC SfxModelessDialogController : public SfxDialogController
+{
+ SfxBindings* m_pBindings;
+ std::unique_ptr m_xImpl;
+
+ SfxModelessDialogController(SfxModelessDialogController&) = delete;
+ void operator =(SfxModelessDialogController&) = delete;
+
+ void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
+
+protected:
+ SfxModelessDialogController(SfxBindings*, SfxChildWindow* pChildWin,
+ weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID);
+
+public:
+ virtual ~SfxModelessDialogController() override;
+
+ void Initialize (SfxChildWinInfo const * pInfo);
+ bool IsClosing() const;
+ virtual void Close() override;
+ virtual void EndDialog(int nResponse) override;
+ virtual void Activate() override;
+ virtual void Deactivate() override;
+ virtual void ChildWinDispose() override;
+ virtual void FillInfo(SfxChildWinInfo&) const;
+ SfxBindings& GetBindings() const { return *m_pBindings; }
+};
+
+typedef WhichRangesContainer (*GetTabPageRanges)(); // provides international Which values
+
+class SFX2_DLLPUBLIC SfxOkDialogController : public SfxDialogController
+{
+public:
+ SfxOkDialogController(weld::Widget* pParent, const OUString& rUIXMLDescription,
+ const OString& rID)
+ : SfxDialogController(pParent, rUIXMLDescription, rID)
+ {
+ }
+
+ virtual weld::Button& GetOKButton() const = 0;
+ virtual const SfxItemSet* GetExampleSet() const = 0;
+};
+
+class SFX2_DLLPUBLIC SfxSingleTabDialogController : public SfxOkDialogController
+{
+private:
+ std::unique_ptr m_xOutputSet;
+ const SfxItemSet* m_pInputSet;
+
+public:
+ SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet,
+ const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"),
+ const OString& rID = OString("SingleTabDialog"));
+
+ weld::Container* get_content_area() { return m_xContainer.get(); }
+
+ virtual ~SfxSingleTabDialogController() override;
+
+ void SetTabPage(std::unique_ptr xTabPage);
+ SfxTabPage* GetTabPage() const { return m_xSfxPage.get(); }
+
+ virtual weld::Button& GetOKButton() const override { return *m_xOKBtn; }
+ virtual const SfxItemSet* GetExampleSet() const override { return nullptr; }
+
+ const SfxItemSet* GetOutputItemSet() const { return m_xOutputSet.get(); }
+ const SfxItemSet* GetInputItemSet() const { return m_pInputSet; }
+
+protected:
+ std::unique_ptr m_xSfxPage;
+ std::unique_ptr m_xContainer;
+ std::unique_ptr m_xOKBtn;
+ std::unique_ptr m_xHelpBtn;
+
+ void CreateOutputItemSet(const SfxItemSet& rInput);
+ void SetInputSet(const SfxItemSet* pInSet) { m_pInputSet = pInSet; }
+ DECL_DLLPRIVATE_LINK(OKHdl_Impl, weld::Button&, void);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
new file mode 100644
index 000000000..d058c939e
--- /dev/null
+++ b/include/sfx2/bindings.hxx
@@ -0,0 +1,208 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_BINDINGS_HXX
+#define INCLUDED_SFX2_BINDINGS_HXX
+
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace com::sun::star::frame { class XDispatch; }
+namespace com::sun::star::frame { class XDispatchProvider; }
+namespace com::sun::star::frame { class XDispatchRecorder; }
+namespace com::sun::star::frame { class XFrame; }
+namespace com::sun::star::util { struct URL; }
+
+class SfxSlot;
+class SfxSlotServer;
+class SfxControllerItem;
+class SfxStateCache;
+class SfxItemSet;
+class SfxDispatcher;
+class SfxBindings_Impl;
+class Timer;
+class SfxWorkWindow;
+struct SfxFoundCache_Impl;
+class SfxFoundCacheArr_Impl;
+
+enum class SfxCallMode : sal_uInt16
+{
+ SLOT = 0x00, // sync/async from Slot
+ SYNCHRON = 0x01, // synchronously in the same Stackframe
+ ASYNCHRON = 0x02, // asynchronously via AppEvent
+ RECORD = 0x04, // take into account while recording
+ API = 0x08 // API call (silent)
+};
+
+namespace o3tl {
+
+template<> struct typed_flags: is_typed_flags
+{};
+
+}
+
+class SFX2_DLLPUBLIC SfxBindings final : public SfxBroadcaster
+
+/* [Description]
+
+ In each SFx application one instance of the SfxBindings-Class will
+ exists from until .
+ This instance is automatically created and destroyed by SfxApplication.
+ However these instances will be handled by the Macro
+ or the associated .
+
+ The SfxBindings manages all of its Slot-Ids bound by the registered
+ controllers and keeps a cache of the respectively.
+ (it is what we call the combination of SfxShell instance and SfxSlot).
+ In the SfxBindings it is stored, if and in this case which controllers
+ that are dirty and which Slot-Server-Caches are dirty respectively.
+ It summarizes status queries (calls to the status methods specified
+ in the IDL) that are served by the same state methods, and handles
+ the simulation of .
+*/
+
+{
+friend class SfxApplication;
+friend class SfxShell;
+friend class SfxBindings_Impl;
+
+ std::unique_ptr< SfxBindings_Impl> pImpl; // Data of the Bindings instance
+ SfxDispatcher* pDispatcher; // Dispatcher, to be used
+ sal_uInt16 nRegLevel; // Lock-Level while Reconfig
+
+private:
+ SAL_DLLPRIVATE const SfxPoolItem* Execute_Impl( sal_uInt16 nSlot, const SfxPoolItem **pArgs, sal_uInt16 nModi,
+ SfxCallMode nCall, const SfxPoolItem **pInternalArgs, bool bGlobalOnly=false);
+ SAL_DLLPRIVATE void SetSubBindings_Impl( SfxBindings* );
+ SAL_DLLPRIVATE void UpdateSlotServer_Impl(); // Update SlotServer
+ SAL_DLLPRIVATE std::optional CreateSet_Impl(SfxStateCache& rCache, const SfxSlot* &pRealSlot,
+ const SfxSlotServer**, SfxFoundCacheArr_Impl&);
+ SAL_DLLPRIVATE std::size_t GetSlotPos( sal_uInt16 nId, std::size_t nStartSearchAt = 0 );
+ SAL_DLLPRIVATE void Update_Impl(SfxStateCache& rCache);
+ static SAL_DLLPRIVATE void UpdateControllers_Impl(
+ const SfxFoundCache_Impl& rFound,
+ const SfxPoolItem *pItem,
+ SfxItemState eItemState );
+ SAL_DLLPRIVATE SfxStateCache* GetStateCache( sal_uInt16 nId, std::size_t * pPos);
+ DECL_DLLPRIVATE_LINK( NextJob, Timer *, void );
+ SAL_DLLPRIVATE bool NextJob_Impl(Timer const * pTimer);
+
+public:
+ SfxBindings();
+ virtual ~SfxBindings() override;
+
+ void HidePopups( bool bHide = true );
+
+ void SetDispatcher(SfxDispatcher *pDisp);
+
+ void Update( sal_uInt16 nId ); // For example, from Menu::Activate
+ void Update();
+ SAL_DLLPRIVATE void StartUpdate_Impl(bool bComplete=false);
+ void Invalidate( sal_uInt16 nId );
+ void Invalidate( const sal_uInt16* pIds );
+ void InvalidateShell( const SfxShell &rSh, bool bDeep = false );
+ void InvalidateAll( bool bWithMsg );
+ void SetState( const SfxItemSet &rSet );
+ void SetState( const SfxPoolItem &rItem );
+ void Invalidate( sal_uInt16 nId, bool bWithItem, bool bWithMsg=false);
+ bool IsInUpdate() const;
+ void SetVisibleState( sal_uInt16 nId, bool bShow );
+
+ SfxStateCache* GetStateCache( sal_uInt16 nId);
+ SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId );
+ /**
+ * @param rpState the caller has to delete the pointer
+ */
+ SfxItemState QueryState( sal_uInt16 nSID, std::unique_ptr &rpState );
+ template
+ SfxItemState QueryState( TypedWhichId nSID, std::unique_ptr &rpState )
+ {
+ std::unique_ptr tmp;
+ auto ret = QueryState(sal_uInt16(nSID), tmp);
+ rpState.reset(static_cast(tmp.release()));
+ return ret;
+ }
+
+ void QueryControlState ( sal_uInt16 nSID, boost::property_tree::ptree& rState );
+
+ sal_uInt16 QuerySlotId( const css::util::URL& aURL );
+
+ const SfxPoolItem* ExecuteSynchron( sal_uInt16 nSlot,
+ const SfxPoolItem **pArgs = nullptr);
+ bool Execute( sal_uInt16 nSlot,
+ const SfxPoolItem **pArgs = nullptr,
+ SfxCallMode nCall = SfxCallMode::SLOT);
+
+ SAL_DLLPRIVATE void SetDispatchProvider_Impl( const css::uno::Reference< css::frame::XDispatchProvider > & rFrame );
+ void SetActiveFrame( const css::uno::Reference< css::frame::XFrame > & rFrame );
+ css::uno::Reference< css::frame::XFrame > GetActiveFrame() const;
+ // Reconfig
+ sal_uInt16 EnterRegistrations(const char *pFile = nullptr, int nLine = 0);
+ void LeaveRegistrations( const char *pFile = nullptr, int nLine = 0 );
+ void Register( SfxControllerItem& rBinding );
+ void Release( SfxControllerItem& rBinding );
+ SfxDispatcher* GetDispatcher() const
+ { return pDispatcher; }
+ const css::uno::Reference< css::frame::XDispatchRecorder >& GetRecorder() const;
+ css::uno::Reference < css::frame::XDispatch >
+ GetDispatch( const SfxSlot*, const css::util::URL& aURL, bool bMasterCommand );
+ SAL_DLLPRIVATE void ContextChanged_Impl();
+ SAL_DLLPRIVATE void Execute_Impl( SfxRequest& rReq, const SfxSlot* pSlot, SfxShell* pShell );
+ SAL_DLLPRIVATE void DeleteControllers_Impl();
+ SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() { return pDispatcher; }
+ SAL_DLLPRIVATE void ClearCache_Impl( sal_uInt16 nSlotId );
+ SAL_DLLPRIVATE void RegisterInternal_Impl( SfxControllerItem& rBinding );
+ SAL_DLLPRIVATE void Register_Impl( SfxControllerItem& rBinding, bool );
+ SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl() const;
+ SAL_DLLPRIVATE void SetWorkWindow_Impl( std::unique_ptr );
+ SAL_DLLPRIVATE SfxBindings* GetSubBindings_Impl() const;
+ SAL_DLLPRIVATE void SetRecorder_Impl( css::uno::Reference< css::frame::XDispatchRecorder > const & );
+ SAL_DLLPRIVATE void InvalidateSlotsInMap_Impl();
+ SAL_DLLPRIVATE void AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 nId );
+};
+
+#ifdef DBG_UTIL
+#define ENTERREGISTRATIONS() EnterRegistrations(__FILE__, __LINE__)
+#define LEAVEREGISTRATIONS() LeaveRegistrations(__FILE__, __LINE__)
+#define DENTERREGISTRATIONS() \
+ EnterRegistrations( OStringBuffer(__FILE__).append('(').append(reinterpret_cast(this)).append(')').getStr(), __LINE__ )
+#define DLEAVEREGISTRATIONS( ) \
+ LeaveRegistrations( OStringBuffer(__FILE__).append('(').append(reinterpret_cast(this)).append(')').getStr(), __LINE__ )
+#else
+#define ENTERREGISTRATIONS() EnterRegistrations()
+#define LEAVEREGISTRATIONS() LeaveRegistrations()
+#define DENTERREGISTRATIONS() EnterRegistrations()
+#define DLEAVEREGISTRATIONS() LeaveRegistrations()
+#endif
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/brokenpackageint.hxx b/include/sfx2/brokenpackageint.hxx
new file mode 100644
index 000000000..37c98540a
--- /dev/null
+++ b/include/sfx2/brokenpackageint.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_BROKENPACKAGEINT_HXX
+#define INCLUDED_SFX2_BROKENPACKAGEINT_HXX
+
+#include
+#include
+#include
+
+#include
+
+namespace com::sun::star::task
+{
+class XInteractionRequest;
+}
+
+class RequestPackageReparation_Impl;
+class SFX2_DLLPUBLIC RequestPackageReparation
+{
+ rtl::Reference mxImpl;
+
+public:
+ RequestPackageReparation(const OUString& aName);
+ ~RequestPackageReparation();
+ RequestPackageReparation(const RequestPackageReparation&) = delete;
+ RequestPackageReparation& operator=(const RequestPackageReparation&) = delete;
+ bool isApproved() const;
+ css::uno::Reference GetRequest() const;
+};
+
+class NotifyBrokenPackage_Impl;
+class SFX2_DLLPUBLIC NotifyBrokenPackage
+{
+ rtl::Reference mxImpl;
+
+public:
+ NotifyBrokenPackage(const OUString& aName);
+ ~NotifyBrokenPackage();
+ NotifyBrokenPackage(const NotifyBrokenPackage&) = delete;
+ NotifyBrokenPackage& operator=(const NotifyBrokenPackage&) = delete;
+ css::uno::Reference GetRequest() const;
+};
+
+#endif // INCLUDED_SFX2_BROKENPACKAGEINT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/chalign.hxx b/include/sfx2/chalign.hxx
new file mode 100644
index 000000000..d63646ea1
--- /dev/null
+++ b/include/sfx2/chalign.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_CHALIGN_HXX
+#define INCLUDED_SFX2_CHALIGN_HXX
+
+// New order: first, navigation bar, then vertically docked child windows
+// (Explorer!), then horizontally docked child windows (Browser!),
+// then the format bar, status bar, and at the end of the toolbar.
+
+enum class SfxChildAlignment
+{
+ HIGHESTTOP, // for example Navigation bar
+ LOWESTBOTTOM,
+ FIRSTLEFT,
+ LASTRIGHT,
+ LEFT, // for example SplitWindow
+ RIGHT,
+ LASTLEFT,
+ FIRSTRIGHT,
+ TOP, // for example Hyperlink-Builder, SplitWindow
+ BOTTOM, // for example SplitWindow
+ TOOLBOXTOP, // for example Object bar
+ TOOLBOXBOTTOM,
+ LOWESTTOP, // for example Calc bar
+ HIGHESTBOTTOM, // for example Status bar
+ TOOLBOXLEFT, // for example Tool bar
+ TOOLBOXRIGHT,
+ NOALIGNMENT // all FloatingWindows
+};
+
+// Verifies that a valid alignment is used
+inline bool SfxChildAlignValid( SfxChildAlignment eAlign )
+{
+ return ( eAlign >= SfxChildAlignment::HIGHESTTOP && eAlign <= SfxChildAlignment::NOALIGNMENT );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
new file mode 100644
index 000000000..f4118d44c
--- /dev/null
+++ b/include/sfx2/charwin.hxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_INC_CHARWIN_HXX
+#define INCLUDED_SFX2_INC_CHARWIN_HXX
+
+#include
+#include
+#include
+#include
+
+class SFX2_DLLPUBLIC SvxCharView final : public weld::CustomWidgetController
+{
+private:
+ VclPtr mxVirDev;
+ tools::Long mnY;
+ Point maPosition;
+ vcl::Font maFont;
+ bool maHasInsert;
+ OUString m_sText;
+
+ Link maMouseClickHdl;
+ Link maClearClickHdl;
+ Link maClearAllClickHdl;
+
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void Resize() override;
+ virtual bool MouseButtonDown(const MouseEvent&) override;
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual bool KeyInput(const KeyEvent&) override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+public:
+ SvxCharView(const VclPtr& rVirDev);
+
+ void SetFont( const vcl::Font& rFont );
+ vcl::Font const & GetFont() const { return maFont; }
+ void SetText( const OUString& rText );
+ OUString const & GetText() const { return m_sText; }
+ void SetHasInsert( bool bInsert );
+ void InsertCharToDoc();
+
+ void createContextMenu();
+
+ Size get_preferred_size() const { return GetDrawingArea()->get_preferred_size(); }
+
+ void setMouseClickHdl(const Link &rLink);
+ void setClearClickHdl(const Link &rLink);
+ void setClearAllClickHdl(const Link &rLink);
+
+ void ContextMenuSelect(std::string_view rIdent);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
new file mode 100644
index 000000000..68ad6ff50
--- /dev/null
+++ b/include/sfx2/childwin.hxx
@@ -0,0 +1,235 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_CHILDWIN_HXX
+#define INCLUDED_SFX2_CHILDWIN_HXX
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+namespace com::sun::star::frame { class XFrame; }
+
+class SfxWorkWindow;
+class SfxModule;
+class SfxChildWindow;
+class SfxBindings;
+class SfxModelessDialogController;
+
+enum class SfxChildWindowFlags
+{
+ NONE = 0x000,
+ FORCEDOCK = 0x004, // Float forbidden
+ TASK = 0x010, // ChildWindow inside the Task
+ CANTGETFOCUS = 0x020, // ChildWindow can not get focus
+ ALWAYSAVAILABLE = 0x040, // ChildWindow is never disabled
+ NEVERHIDE = 0x080, // ChildWindow is always visible
+ NEVERCLONE = 0x100, // ChildWindow is not recreated in new view
+};
+
+namespace o3tl
+{
+ template<> struct typed_flags : is_typed_flags {};
+}
+
+
+#define CHILDWIN_NOPOS USHRT_MAX
+
+// ChildWindow Configuration
+struct SAL_DLLPUBLIC_RTTI SfxChildWinInfo
+{
+ OUString aExtraString;
+ OUString aModule;
+ OString aWinState;
+ Point aPos;
+ Size aSize;
+ SfxChildWindowFlags nFlags;
+ bool bVisible;
+
+ SfxChildWinInfo()
+ {
+ bVisible = false;
+ nFlags = SfxChildWindowFlags::NONE;
+ }
+ bool GetExtraData_Impl( SfxChildAlignment *pAlign ) const;
+};
+
+// ChildWindow factory methods
+typedef std::unique_ptr (*SfxChildWinCtor)( vcl::Window *pParentWindow,
+ sal_uInt16 nId,
+ SfxBindings *pBindings,
+ SfxChildWinInfo *pInfo);
+
+struct SFX2_DLLPUBLIC SfxChildWinFactory
+{
+ SfxChildWinCtor pCtor; // Factory method
+ SfxChildWinInfo aInfo; // Configuration
+ sal_uInt16 nId; // ChildWindow-Id ( SlotId )
+ sal_uInt16 nPos; // Position in UI
+
+ SfxChildWinFactory( SfxChildWinCtor pTheCtor, sal_uInt16 nID, sal_uInt16 n );
+};
+
+struct SfxChildWindow_Impl;
+
+extern SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent);
+
+class SFX2_DLLPUBLIC SfxChildWindow
+{
+ VclPtr pParent; // parent window ( Topwindow )
+ VclPtr pWindow; // actual contents
+ std::unique_ptr< SfxChildWindow_Impl> pImpl; // Implementation data
+ std::shared_ptr xController; // actual contents
+ SfxChildAlignment eChildAlignment; // Current css::drawing::Alignment
+ // Another window in pWindow
+ sal_uInt16 nType; // ChildWindow-Id
+ SAL_DLLPRIVATE void ClearWorkwin();
+
+protected:
+ void SetWindow(const VclPtr& p) { pWindow = p; }
+ SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId);
+
+public:
+ virtual ~SfxChildWindow();
+ void Destroy();
+ vcl::Window* GetWindow() const
+ { return pWindow; }
+ void SetController(std::shared_ptr controller) { xController = controller; }
+ void ClearController() { xController.reset(); }
+ std::shared_ptr& GetController() { return xController; }
+ const std::shared_ptr& GetController() const { return xController; }
+ vcl::Window* GetParent() const
+ { return pParent; }
+ SfxChildAlignment GetAlignment() const
+ { return eChildAlignment; }
+ void SetAlignment(SfxChildAlignment eAlign);
+ virtual void Hide();
+ virtual void Show( ShowFlags nFlags );
+ sal_uInt16 GetPosition() const;
+ sal_uInt16 GetType() const
+ { return nType; }
+
+ virtual SfxChildWinInfo GetInfo() const;
+ void SaveStatus(const SfxChildWinInfo& rInfo);
+
+ static void RegisterChildWindow(SfxModule*, const SfxChildWinFactory&);
+
+ static std::unique_ptr CreateChildWindow( sal_uInt16, vcl::Window*, SfxBindings*, SfxChildWinInfo const &);
+ void SetHideNotDelete( bool bOn );
+ bool IsHideNotDelete() const;
+ bool IsVisible() const;
+ void SetWantsFocus( bool );
+ bool WantsFocus() const;
+
+ virtual bool QueryClose();
+ const css::uno::Reference< css::frame::XFrame >& GetFrame() const;
+ void SetFrame( const css::uno::Reference< css::frame::XFrame > & );
+
+ SAL_DLLPRIVATE static void InitializeChildWinFactory_Impl(sal_uInt16, SfxChildWinInfo&);
+ void SetVisible_Impl( bool bVis );
+ SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* );
+ SAL_DLLPRIVATE void Activate_Impl();
+
+ SAL_DLLPRIVATE void SetFactory_Impl( const SfxChildWinFactory* );
+};
+
+const int nCloseResponseToJustHide = -42;
+
+#define SFX_DECL_CHILDWINDOW(Class) \
+ public : \
+ static std::unique_ptr CreateImpl(vcl::Window *pParent, sal_uInt16 nId, \
+ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
+ static void RegisterChildWindow (bool bVisible=false, SfxModule *pMod=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE); \
+ virtual SfxChildWinInfo GetInfo() const override
+
+#define SFX_DECL_CHILDWINDOW_WITHID(Class) \
+ SFX_DECL_CHILDWINDOW(Class); \
+ static sal_uInt16 GetChildWindowId ()\
+
+#define SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SFX_IMPL_POS_CHILDWINDOW(Class, MyID, CHILDWIN_NOPOS)
+
+#define SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SFX_IMPL_POS_CHILDWINDOW_WITHID(Class, MyID, CHILDWIN_NOPOS)
+
+#define SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \
+ std::unique_ptr Class::CreateImpl( vcl::Window *pParent, \
+ sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \
+ { \
+ return std::make_unique(pParent, nId, pBindings, pInfo);\
+ } \
+ void Class::RegisterChildWindow (bool bVis, SfxModule *pMod, SfxChildWindowFlags nFlags) \
+ { \
+ SfxChildWinFactory aFact( \
+ Class::CreateImpl, MyID, Pos ); \
+ aFact.aInfo.nFlags |= nFlags; \
+ aFact.aInfo.bVisible = bVis; \
+ SfxChildWindow::RegisterChildWindow(pMod, aFact); \
+ }
+
+#define SFX_IMPL_POS_CHILDWINDOW_WITHID(Class, MyID, Pos) \
+ SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \
+ sal_uInt16 Class::GetChildWindowId () \
+ { return MyID; } \
+
+#define SFX_IMPL_MODELESSDIALOGCONTOLLER(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ static_cast(GetController().get())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ static_cast(GetController().get())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_DOCKINGWINDOW(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ static_cast(GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+#define SFX_IMPL_DOCKINGWINDOW_WITHID(Class, MyID) \
+ SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
+ SfxChildWinInfo Class::GetInfo() const \
+ { \
+ SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
+ static_cast(GetWindow())->FillInfo( aInfo ); \
+ return aInfo; }
+
+bool GetPosSizeFromString( std::u16string_view rStr, Point& rPos, Size& rSize );
+
+bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
new file mode 100644
index 000000000..5a4fa6b1e
--- /dev/null
+++ b/include/sfx2/classificationhelper.hxx
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_SFX2_CLASSIFICATIONHELPER_HXX
+#define INCLUDED_SFX2_CLASSIFICATIONHELPER_HXX
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+namespace com::sun::star::beans
+{
+class XPropertyContainer;
+}
+namespace com::sun::star::document
+{
+class XDocumentProperties;
+}
+
+class SfxViewFrame;
+
+/// Return code of SfxClassificationHelper::CheckPaste().
+enum class SfxClassificationCheckPasteResult
+{
+ None = 1,
+ TargetDocNotClassified = 2,
+ DocClassificationTooLow = 3
+};
+
+/// Specifies a policy type, to be used with SetBACName(). Getters always use IntellectualProperty for now.
+enum class SfxClassificationPolicyType
+{
+ ExportControl = 1,
+ NationalSecurity = 2,
+ IntellectualProperty = 3
+};
+
+/// Shared code to handle Business Authorization Identification and Labeling Scheme (BAILS) properties.
+class SFX2_DLLPUBLIC SfxClassificationHelper
+{
+ class SAL_DLLPRIVATE Impl;
+ std::unique_ptr m_pImpl;
+
+public:
+ /// Does the document have any BAILS properties?
+ static bool IsClassified(
+ const css::uno::Reference& xDocumentProperties);
+ /// Checks if pasting from xSource to xDestination would leak information.
+ static SfxClassificationCheckPasteResult
+ CheckPaste(const css::uno::Reference& xSource,
+ const css::uno::Reference& xDestination);
+ /// Wrapper around CheckPaste(): informs the user if necessary and finds out if the paste can be continued or not.
+ static bool ShowPasteInfo(SfxClassificationCheckPasteResult eResult);
+
+ SfxClassificationHelper(
+ const css::uno::Reference& xDocumentProperties,
+ bool bUseLocalizedPolicy = true);
+ ~SfxClassificationHelper();
+ /// Get the currently selected category for eType.
+ const OUString& GetBACName(SfxClassificationPolicyType eType) const;
+ /// Return all possible valid category names, based on the policy.
+ std::vector GetBACNames();
+ /// Return all possible valid category identifiers, based on the policy.
+ std::vector GetBACIdentifiers();
+ /// Get the currently selected category abbreviation for eType. Returns full name if no abbreviation defined.
+ const OUString& GetAbbreviatedBACName(const OUString& sFullName);
+ /// Get the currently selected category for the identifier.
+ OUString GetBACNameForIdentifier(std::u16string_view sIdentifier);
+ /// Return all possible valid abbreviated category names, based on the policy.
+ std::vector GetAbbreviatedBACNames();
+ /// Setting this sets all the other properties, based on the policy.
+ void SetBACName(const OUString& rName, SfxClassificationPolicyType eType);
+ /// Returns the class with the higher priority (based on sensitivity).
+ OUString GetHigherClass(const OUString& first, const OUString& second);
+ /// If GetImpactScale() and GetImpactLevel*() will return something meaningful.
+ bool HasImpactLevel();
+ InfobarType GetImpactLevelType();
+ /// Larger value means more confidential.
+ sal_Int32 GetImpactLevel();
+ /// Comparing the GetImpactLevel() result is only meaningful when the impact scale is the same.
+ OUString GetImpactScale();
+ OUString GetDocumentWatermark();
+ /// The selected category has some content for the document header.
+ bool HasDocumentHeader();
+ /// The selected category has some content for the document footer.
+ bool HasDocumentFooter();
+ void UpdateInfobar(SfxViewFrame& rViewFrame);
+
+ std::vector const& GetMarkings() const;
+ std::vector const& GetIntellectualPropertyParts() const;
+ std::vector const& GetIntellectualPropertyPartNumbers() const;
+
+ /// Does a best-effort conversion of rType to SfxClassificationPolicyType.
+ static SfxClassificationPolicyType stringToPolicyType(std::u16string_view rType);
+ /// Returns the string representation of a SfxClassificationPolicyType element.
+ static const OUString& policyTypeToString(SfxClassificationPolicyType eType);
+
+ /// Brief text located at the top of each document's pages.
+ static const OUString& PROP_DOCHEADER();
+ /// Brief text located at the bottom of each document's pages.
+ static const OUString& PROP_DOCFOOTER();
+ /// Brief text formatted as a watermark on each document's page.
+ static const OUString& PROP_DOCWATERMARK();
+ /// Get the property prefix for the IntellectualProperty policy type.
+ static const OUString& PROP_PREFIX_INTELLECTUALPROPERTY();
+
+ static SfxClassificationPolicyType getPolicyType();
+};
+
+namespace sfx
+{
+/// Specifies the origin: either defined by the BAF policy or manual via. the advanced classification dialog
+enum class ClassificationCreationOrigin
+{
+ NONE,
+ BAF_POLICY,
+ MANUAL
+};
+
+class ClassificationKeyCreator
+{
+private:
+ const SfxClassificationPolicyType m_ePolicyType;
+ const OUString m_sPolicy;
+ sal_Int32 m_nTextNumber;
+ sal_Int32 m_nIPPartNumber;
+ sal_Int32 m_nMarkingNumber;
+
+ OUString const& getPolicyKey() const { return m_sPolicy; }
+
+public:
+ ClassificationKeyCreator(SfxClassificationPolicyType ePolicyType)
+ : m_ePolicyType(ePolicyType)
+ , m_sPolicy(SfxClassificationHelper::policyTypeToString(m_ePolicyType))
+ , m_nTextNumber(1)
+ , m_nIPPartNumber(1)
+ , m_nMarkingNumber(1)
+ {
+ }
+
+ OUString makeTextKey() const { return getPolicyKey() + "Custom:Text"; }
+
+ OUString makeNumberedTextKey()
+ {
+ return makeTextKey() + ":n" + OUString::number(m_nTextNumber++);
+ }
+
+ bool isMarkingTextKey(std::u16string_view aKey) const
+ {
+ return o3tl::starts_with(aKey, makeTextKey());
+ }
+
+ OUString makeCategoryNameKey() const
+ {
+ return getPolicyKey() + "BusinessAuthorizationCategory:Name";
+ }
+
+ bool isCategoryNameKey(std::u16string_view aKey) const
+ {
+ return o3tl::starts_with(aKey, makeCategoryNameKey());
+ }
+
+ OUString makeCategoryIdentifierKey() const
+ {
+ return getPolicyKey() + "BusinessAuthorizationCategory:Identifier";
+ }
+
+ bool isCategoryIdentifierKey(std::u16string_view aKey) const
+ {
+ return o3tl::starts_with(aKey, makeCategoryIdentifierKey());
+ }
+
+ OUString makeMarkingKey() const { return getPolicyKey() + "Custom:Marking"; }
+
+ OUString makeNumberedMarkingKey()
+ {
+ return makeMarkingKey() + ":n" + OUString::number(m_nMarkingNumber++);
+ }
+
+ bool isMarkingKey(std::u16string_view aKey) const
+ {
+ return o3tl::starts_with(aKey, makeMarkingKey());
+ }
+
+ OUString makeIntellectualPropertyPartKey() const
+ {
+ return getPolicyKey() + "Custom:IntellectualPropertyPart";
+ }
+
+ OUString makeNumberedIntellectualPropertyPartKey()
+ {
+ return makeIntellectualPropertyPartKey() + ":n" + OUString::number(m_nIPPartNumber++);
+ }
+
+ bool isIntellectualPropertyPartKey(std::u16string_view aKey) const
+ {
+ return o3tl::starts_with(aKey, makeIntellectualPropertyPartKey());
+ }
+
+ OUString makeFullTextualRepresentationKey() const
+ {
+ return getPolicyKey() + "Custom:FullTexturalRepresentation";
+ }
+
+ /// Classification creation origin key
+ OUString makeCreationOriginKey() const { return getPolicyKey() + "CreationOrigin"; }
+};
+
+SFX2_DLLPUBLIC sfx::ClassificationCreationOrigin getCreationOriginProperty(
+ css::uno::Reference const& rxPropertyContainer,
+ sfx::ClassificationKeyCreator const& rKeyCreator);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
new file mode 100644
index 000000000..03e530c78
--- /dev/null
+++ b/include/sfx2/ctrlitem.hxx
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_CTRLITEM_HXX
+#define INCLUDED_SFX2_CTRLITEM_HXX
+
+#include
+#include
+#include
+#include
+#include
+
+class SfxBindings;
+
+class SFX2_DLLPUBLIC SfxControllerItem
+{
+private:
+ SfxControllerItem* pNext; // to notify next ControllerItem
+ SfxBindings* pBindings;
+ MapUnit eFallbackCoreMetric;
+ sal_uInt16 nId;
+
+public:
+ SfxBindings & GetBindings() {
+ DBG_ASSERT(pBindings, "no Bindings");
+ return *pBindings;
+ }
+ const SfxBindings & GetBindings() const {
+ DBG_ASSERT(pBindings, "no Bindings");
+ return *pBindings;
+ }
+
+ SfxControllerItem(); // for arrays
+ SfxControllerItem( sal_uInt16 nId, SfxBindings & );
+ virtual ~SfxControllerItem();
+ virtual void dispose();
+
+ void Bind( sal_uInt16 nNewId, SfxBindings *); // Register in SfxBindings
+ void UnBind();
+ void ReBind();
+ bool IsBound() const;
+ void ClearCache();
+
+ SfxControllerItem* GetItemLink();
+ SfxControllerItem* ChangeItemLink( SfxControllerItem* pNewLink );
+
+ void SetId( sal_uInt16 nItemId );
+ sal_uInt16 GetId() const { return nId; }
+
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+
+ virtual void GetControlState( sal_uInt16 nSID, boost::property_tree::ptree& );
+
+ MapUnit GetCoreMetric() const;
+ // override what GetCoreMetric will return if it cannot determine the current CoreMetric
+ void SetFallbackCoreMetric(MapUnit eFallback)
+ {
+ eFallbackCoreMetric = eFallback;
+ }
+
+ static SfxItemState GetItemState( const SfxPoolItem* pState );
+
+ SAL_DLLPRIVATE void BindInternal_Impl( sal_uInt16 nNewId, SfxBindings* );
+};
+
+
+class SFX2_DLLPUBLIC SfxStatusForwarder final : public SfxControllerItem
+{
+ SfxControllerItem* pMaster;
+
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState ) override;
+
+public:
+ SfxStatusForwarder( sal_uInt16 nSlotId,
+ SfxControllerItem&rMaster );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/devtools/DevelopmentToolChildWindow.hxx b/include/sfx2/devtools/DevelopmentToolChildWindow.hxx
new file mode 100644
index 000000000..d78ac5c2e
--- /dev/null
+++ b/include/sfx2/devtools/DevelopmentToolChildWindow.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+
+/**
+ * Necessary child window for the development tools docking window
+ */
+class SAL_WARN_UNUSED SFX2_DLLPUBLIC DevelopmentToolChildWindow final : public SfxChildWindow
+{
+ SFX_DECL_CHILDWINDOW_WITHID(DevelopmentToolChildWindow);
+
+ DevelopmentToolChildWindow(vcl::Window* pParentWindow, sal_uInt16 nId, SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
new file mode 100644
index 000000000..4da9fccd9
--- /dev/null
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+/** Development tool main docking window
+ *
+ * Contains two sides. Left side contains the simplified DOM tree and
+ * the right side the object inspector tree.
+ */
+class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : public SfxDockingWindow
+{
+private:
+ std::unique_ptr mpObjectInspectorWidgets;
+ std::unique_ptr mpDocumentModelTreeView;
+ std::unique_ptr mpDomToolbar;
+
+ // Reference to the root object for the current document
+ css::uno::Reference mxRoot;
+ // Stores the current selected object in the document
+ css::uno::Reference mxCurrentSelection;
+ css::uno::Reference mxSelectionListener;
+ css::uno::Reference mxSelectionSupplier;
+
+ // Handler for the DOM tree
+ DocumentModelTreeHandler maDocumentModelTreeHandler;
+ // Handler for the object inspector tree
+ ObjectInspectorTreeHandler maObjectInspectorTreeHandler;
+
+ DECL_DLLPRIVATE_LINK(DocumentModelTreeViewSelectionHandler, weld::TreeView&, void);
+ DECL_DLLPRIVATE_LINK(DomToolbarButtonClicked, const OString&, void);
+
+ void updateSelection();
+
+public:
+ DevelopmentToolDockingWindow(SfxBindings* pBindings, SfxChildWindow* pChildWindow,
+ vcl::Window* pParent);
+
+ virtual ~DevelopmentToolDockingWindow() override;
+
+ void dispose() override;
+
+ void ToggleFloatingMode() override;
+
+ // Signals that the selected object in the document changes
+ void selectionChanged(css::uno::Reference const& xInterface);
+
+ // Signals to change to the current selected object in the object inspector
+ void changeToCurrentSelection();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/devtools/DocumentModelTreeHandler.hxx b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
new file mode 100644
index 000000000..47294d527
--- /dev/null
+++ b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+
+#include
+#include
+
+/** Document model tree handler
+ *
+ * Handles the DOM tree part of DevTools, which includes interaction with
+ * the DOM tree view UI elements and the DOM model.
+ */
+class DocumentModelTreeHandler
+{
+private:
+ std::unique_ptr& mpDocumentModelTree;
+ css::uno::Reference mxDocument;
+
+ // Clears all children of a tree node, where the parent is
+ // identified by the input tree iter.
+ void clearChildren(weld::TreeIter const& rParent);
+
+ // Clear all tree view nodes.
+ void clearAll();
+
+public:
+ DocumentModelTreeHandler(std::unique_ptr& pDocumentModelTree,
+ css::uno::Reference const& xDocument);
+
+ DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
+
+ void inspectDocument();
+
+ static css::uno::Reference getObjectByID(OUString const& rID);
+
+ void dispose();
+
+ // selects the input object if it exists in the DOM tree view
+ void selectObject(css::uno::Reference const& xInterface);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
new file mode 100644
index 000000000..b6fa678de
--- /dev/null
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+/** Object inspector tree handler
+ *
+ * Handles the object inspector part of DevTools - mainly interaction
+ * between UI objects that consist of the object inspector.
+ *
+ */
+class ObjectInspectorTreeHandler
+{
+private:
+ std::unique_ptr& mpObjectInspectorWidgets;
+
+ // object stack to remember previously inspected objects so it is
+ // possible to return back to them
+ std::deque maInspectionStack;
+
+ // just the current context
+ css::uno::Reference mxContext;
+
+ // treeview sort and compare
+ comphelper::string::NaturalStringSorter mxSorter;
+ void setSortFunction(std::unique_ptr& pTreeView);
+ sal_Int32 compare(std::unique_ptr& pTreeView, const weld::TreeIter& rLeft,
+ const weld::TreeIter& rRight);
+
+ // treeview manipulation
+ static void clearObjectInspectorChildren(std::unique_ptr& pTreeView,
+ weld::TreeIter const& rParent);
+ static void handleExpanding(std::unique_ptr& pTreeView,
+ weld::TreeIter const& rParent);
+ static void clearAll(std::unique_ptr& pTreeView);
+
+ void appendInterfaces(css::uno::Reference const& xInterface);
+ void appendServices(css::uno::Reference const& xInterface);
+ void appendProperties(css::uno::Reference const& xInterface);
+ void appendMethods(css::uno::Reference const& xInterface);
+
+ void inspectObject(css::uno::Reference const& xInterface);
+
+ // Object stack handling
+ void clearStack();
+ void addToStack(css::uno::Any const& rAny);
+ css::uno::Any popFromStack();
+
+ void updateBackButtonState();
+
+public:
+ ObjectInspectorTreeHandler(std::unique_ptr& pObjectInspectorWidgets);
+
+ // callbacks when a node in the tree view is expanded
+ DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
+ DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
+ DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
+ DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
+
+ // callback when the tree view selection changed to a different node
+ DECL_LINK(SelectionChanged, weld::TreeView&, void);
+
+ // callback when a pop-up is triggered on a tree view node
+ DECL_LINK(PopupMenuHandler, const CommandEvent&, bool);
+
+ // callback when a button is clicked on a toolbar
+ DECL_LINK(ToolbarButtonClicked, const OString&, void);
+
+ // callback when a page is entered or left on the notebook bar for
+ // different categories
+ DECL_LINK(NotebookEnterPage, const OString&, void);
+ DECL_LINK(NotebookLeavePage, const OString&, bool);
+
+ DECL_LINK(HeaderBarClick, int, void);
+
+ void introspect(css::uno::Reference const& xInterface);
+
+ void dispose();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/devtools/ObjectInspectorWidgets.hxx b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
new file mode 100644
index 000000000..9c719d2aa
--- /dev/null
+++ b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include
+
+struct ObjectInspectorWidgets
+{
+ ObjectInspectorWidgets(const std::unique_ptr& rxBuilder)
+ : mpClassNameLabel(rxBuilder->weld_label("class_name_value_id"))
+ , mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id"))
+ , mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id"))
+ , mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id"))
+ , mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id"))
+ , mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar"))
+ , mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar"))
+ , mpTextView(rxBuilder->weld_text_view("object_inspector_text_view"))
+ , mpPaned(rxBuilder->weld_paned("object_inspector_paned"))
+ {
+ }
+
+ ~ObjectInspectorWidgets()
+ {
+ // dispose welded objects
+ mpClassNameLabel.reset();
+ mpInterfacesTreeView.reset();
+ mpServicesTreeView.reset();
+ mpPropertiesTreeView.reset();
+ mpMethodsTreeView.reset();
+ mpToolbar.reset();
+ mpNotebook.reset();
+ mpTextView.reset();
+ mpPaned.reset();
+ }
+
+ std::unique_ptr mpClassNameLabel;
+ std::unique_ptr mpInterfacesTreeView;
+ std::unique_ptr mpServicesTreeView;
+ std::unique_ptr mpPropertiesTreeView;
+ std::unique_ptr mpMethodsTreeView;
+ std::unique_ptr mpToolbar;
+ std::unique_ptr mpNotebook;
+ std::unique_ptr mpTextView;
+ std::unique_ptr mpPaned;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
new file mode 100644
index 000000000..a853d5d9d
--- /dev/null
+++ b/include/sfx2/dialoghelper.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_SFX2_DIALOGHELPER_HXX
+#define INCLUDED_SFX2_DIALOGHELPER_HXX
+
+#include
+#include
+#include
+
+class DateTime;
+class LocaleDataWrapper;
+class OutputDevice;
+
+//when two tab pages both have the same basic layout with a preview on the
+//right, get both of their non-preview areas to request the same size so that
+//the preview appears in the same place in each one so flipping between tabs
+//isn't distracting as it jumps around
+
+Size SFX2_DLLPUBLIC getParagraphPreviewOptimalSize(const OutputDevice& rReference);
+
+Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const OutputDevice& rReference);
+
+Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& rReference);
+
+Size SFX2_DLLPUBLIC getPreviewOptionsSize(const OutputDevice& rReference);
+
+OUString SFX2_DLLPUBLIC getWidestDateTime(const LocaleDataWrapper& rWrapper, bool bWithSec);
+
+OUString SFX2_DLLPUBLIC formatDateTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper,
+ bool bWithSec);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/digitalsignatures.hxx b/include/sfx2/digitalsignatures.hxx
new file mode 100644
index 000000000..8f0e161b4
--- /dev/null
+++ b/include/sfx2/digitalsignatures.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+
+#include
+
+namespace sfx2
+{
+/// Extension of css::security::XDocumentDigitalSignatures for internal purposes.
+class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI DigitalSignatures
+{
+public:
+ /// Same as signDocumentWithCertificate(), but passes the xModel as well.
+ virtual bool
+ SignModelWithCertificate(const css::uno::Reference& xModel,
+ const css::uno::Reference& xCertificate,
+ const css::uno::Reference& xStorage,
+ const css::uno::Reference& xStream)
+ = 0;
+
+protected:
+ ~DigitalSignatures() noexcept = default;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
new file mode 100644
index 000000000..fc7ebbfd4
--- /dev/null
+++ b/include/sfx2/dinfdlg.hxx
@@ -0,0 +1,579 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 INCLUDED_SFX2_DINFDLG_HXX
+#define INCLUDED_SFX2_DINFDLG_HXX
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+
+#include
+#include
+
+namespace com::sun::star::beans { struct PropertyValue; }
+
+namespace com::sun::star {
+ namespace document {
+ class XDocumentProperties;
+ }
+}
+
+struct CustomProperty;
+class SvtCalendarBox;
+
+// class SfxDocumentInfoItem ---------------------------------------------
+
+class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxDocumentInfoItem final : public SfxStringItem
+{
+private:
+ sal_Int32 m_AutoloadDelay;
+ OUString m_AutoloadURL;
+ bool m_isAutoloadEnabled;
+ OUString m_DefaultTarget;
+ OUString m_TemplateName;
+ OUString m_Author;
+ css::util::DateTime m_CreationDate;
+ OUString m_ModifiedBy;
+ css::util::DateTime m_ModificationDate;
+ OUString m_PrintedBy;
+ css::util::DateTime m_PrintDate;
+ sal_Int16 m_EditingCycles;
+ sal_Int32 m_EditingDuration;
+ OUString m_Description;
+ OUString m_Keywords;
+ OUString m_Subject;
+ OUString m_Title;
+ bool m_bHasTemplate;
+ bool m_bDeleteUserData;
+ bool m_bUseUserData;
+ bool m_bUseThumbnailSave;
+ std::vector< std::unique_ptr > m_aCustomProperties;
+ css::uno::Sequence< css::document::CmisProperty > m_aCmisProperties;
+
+public:
+ static SfxPoolItem* CreateDefault();
+ SfxDocumentInfoItem();
+ SfxDocumentInfoItem( const OUString &rFileName,
+ const css::uno::Reference< css::document::XDocumentProperties> & i_xDocProps,
+ const css::uno::Sequence< css::document::CmisProperty> & i_cmisProps,
+ bool bUseUserData, bool bUseThumbnailSave );
+ SfxDocumentInfoItem( const SfxDocumentInfoItem& );
+ virtual ~SfxDocumentInfoItem() override;
+
+ /// update i_xDocProps with the data in this object
+ void UpdateDocumentInfo(
+ const css::uno::Reference< css::document::XDocumentProperties> & i_xDocProps,
+ bool i_bDoNotUpdateUserDefined = false)
+ const;
+ bool isCmisDocument() const { return m_aCmisProperties.hasElements();}
+
+ bool isAutoloadEnabled() const { return m_isAutoloadEnabled; }
+ sal_Int32 getAutoloadDelay() const { return m_AutoloadDelay; }
+ const OUString& getAutoloadURL() const { return m_AutoloadURL; }
+ const OUString& getDefaultTarget() const { return m_DefaultTarget; }
+ const OUString& getTemplateName() const { return m_TemplateName; }
+ const OUString& getAuthor() const { return m_Author; }
+
+ const css::util::DateTime&
+ getCreationDate() const { return m_CreationDate; }
+ const OUString& getModifiedBy() const { return m_ModifiedBy; }
+
+ const css::util::DateTime&
+ getModificationDate() const { return m_ModificationDate; }
+ const OUString& getPrintedBy() const { return m_PrintedBy; }
+ const css::util::DateTime&
+ getPrintDate() const { return m_PrintDate; }
+ sal_Int16 getEditingCycles() const { return m_EditingCycles; }
+ sal_Int32 getEditingDuration() const { return m_EditingDuration; }
+ const OUString& getDescription() const { return m_Description; }
+ void setDescription(const OUString& i_val) { m_Description = i_val; }
+ const OUString& getKeywords() const { return m_Keywords; }
+ void setKeywords(const OUString& i_val) { m_Keywords = i_val; }
+ const OUString& getSubject() const { return m_Subject; }
+ void setSubject(const OUString& i_val) { m_Subject = i_val; }
+ const OUString& getTitle() const { return m_Title; }
+ void setTitle(const OUString& i_val) { m_Title = i_val; }
+
+ /// reset user-specific data (author, modified-by, ...)
+ void resetUserData(const OUString & i_rAuthor);
+
+ void SetTemplate( bool b ) { m_bHasTemplate = b; }
+ bool HasTemplate() const { return m_bHasTemplate; }
+ void SetDeleteUserData( bool bSet );
+ void SetUseUserData( bool bSet );
+ void SetUseThumbnailSave( bool bSet );
+ bool IsUseUserData() const { return m_bUseUserData;}
+ bool IsUseThumbnailSave() const { return m_bUseThumbnailSave;}
+
+
+ std::vector< std::unique_ptr > GetCustomProperties() const;
+ void ClearCustomProperties();
+ void AddCustomProperty( const OUString& sName,
+ const css::uno::Any& rValue );
+
+ const css::uno::Sequence< css::document::CmisProperty >&
+ GetCmisProperties() const { return m_aCmisProperties;}
+
+ void SetCmisProperties(const css::uno::Sequence< css::document::CmisProperty >& cmisProps );
+ virtual SfxDocumentInfoItem* Clone( SfxItemPool* pPool = nullptr ) const override;
+ virtual bool operator==( const SfxPoolItem& ) const override;
+ virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
+ virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
+};
+
+// class SfxDocumentPage -------------------------------------------------
+
+class SfxDocumentPage final : public SfxTabPage
+{
+private:
+ OUString m_aUnknownSize;
+ OUString m_aMultiSignedStr;
+
+ bool bEnableUseUserData : 1,
+ bHandleDelete : 1;
+
+ std::unique_ptr m_xBmp;
+ std::unique_ptr m_xNameED;
+ std::unique_ptr m_xChangePassBtn;
+
+ std::unique_ptr m_xShowTypeFT;
+ std::unique_ptr m_xFileValEd;
+ std::unique_ptr m_xShowSizeFT;
+
+ std::unique_ptr m_xCreateValFt;
+ std::unique_ptr m_xChangeValFt;
+ std::unique_ptr m_xSignedValFt;
+ std::unique_ptr m_xSignatureBtn;
+ std::unique_ptr m_xPrintValFt;
+ std::unique_ptr m_xTimeLogValFt;
+ std::unique_ptr