summaryrefslogtreecommitdiffstats
path: root/sfx2/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/inc')
-rw-r--r--sfx2/inc/SfxRedactionHelper.hxx146
-rw-r--r--sfx2/inc/arrdecl.hxx30
-rw-r--r--sfx2/inc/autoredactdialog.hxx175
-rw-r--r--sfx2/inc/bitmaps.hlst94
-rw-r--r--sfx2/inc/bitset.hxx49
-rw-r--r--sfx2/inc/bluthsndapi.hxx28
-rw-r--r--sfx2/inc/charmapcontrol.hxx66
-rw-r--r--sfx2/inc/charmappopup.hxx41
-rw-r--r--sfx2/inc/checkin.hxx31
-rw-r--r--sfx2/inc/commandpopup/CommandPopup.hxx114
-rw-r--r--sfx2/inc/dinfdlg.hrc87
-rw-r--r--sfx2/inc/doctempl.hrc45
-rw-r--r--sfx2/inc/emojicontrol.hxx56
-rw-r--r--sfx2/inc/emojipopup.hxx41
-rw-r--r--sfx2/inc/emojiview.hxx76
-rw-r--r--sfx2/inc/emojiviewitem.hxx35
-rw-r--r--sfx2/inc/fwkhelper.hxx31
-rw-r--r--sfx2/inc/guisaveas.hxx87
-rw-r--r--sfx2/inc/inettbc.hxx64
-rw-r--r--sfx2/inc/notebookbar/NotebookbarTabControl.hxx48
-rw-r--r--sfx2/inc/pch/precompiled_sfx.cxx12
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx486
-rw-r--r--sfx2/inc/preventduplicateinteraction.hxx329
-rw-r--r--sfx2/inc/recentdocsview.hxx112
-rw-r--r--sfx2/inc/saveastemplatedlg.hxx58
-rw-r--r--sfx2/inc/sfxbasecontroller_internal.hxx19
-rw-r--r--sfx2/inc/sidebar/ContextChangeBroadcaster.hxx67
-rw-r--r--sfx2/inc/sidebar/ContextList.hxx66
-rw-r--r--sfx2/inc/sidebar/ControllerFactory.hxx72
-rw-r--r--sfx2/inc/sidebar/DeckDescriptor.hxx53
-rw-r--r--sfx2/inc/sidebar/DeckLayouter.hxx47
-rw-r--r--sfx2/inc/sidebar/DeckTitleBar.hxx57
-rw-r--r--sfx2/inc/sidebar/PanelDescriptor.hxx51
-rw-r--r--sfx2/inc/sidebar/PanelTitleBar.hxx69
-rw-r--r--sfx2/inc/sidebar/SidebarToolBox.hxx82
-rw-r--r--sfx2/inc/sidebar/TitleBar.hxx70
-rw-r--r--sfx2/inc/sidebar/Tools.hxx56
-rw-r--r--sfx2/inc/sidebar/UnoDeck.hxx62
-rw-r--r--sfx2/inc/sidebar/UnoDecks.hxx54
-rw-r--r--sfx2/inc/sidebar/UnoPanel.hxx69
-rw-r--r--sfx2/inc/sidebar/UnoPanels.hxx57
-rw-r--r--sfx2/inc/sidebar/UnoSidebar.hxx54
-rw-r--r--sfx2/inc/sorgitm.hxx44
-rw-r--r--sfx2/inc/srchdlg.hxx73
-rw-r--r--sfx2/inc/strings.hxx57
-rw-r--r--sfx2/inc/templatecontaineritem.hxx27
-rw-r--r--sfx2/inc/templatedefaultview.hxx29
-rw-r--r--sfx2/inc/templateviewitem.hxx45
-rw-r--r--sfx2/inc/unoctitm.hxx153
49 files changed, 3774 insertions, 0 deletions
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
new file mode 100644
index 000000000..07e752d17
--- /dev/null
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
+#define INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+#include <tools/gen.hxx>
+
+#include <string_view>
+#include <vector>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+class SfxRequest;
+class SfxStringItem;
+class GDIMetaFile;
+class DocumentToGraphicRenderer;
+class SfxViewFrame;
+struct RedactionTarget;
+
+namespace i18nutil
+{
+struct SearchOptions2;
+}
+
+struct PageMargins
+{
+ // Page margins in mm100th
+ sal_Int32 nTop;
+ sal_Int32 nBottom;
+ sal_Int32 nLeft;
+ sal_Int32 nRight;
+};
+
+/*
+ * Mostly a bunch of static methods to handle the redaction functionality at
+ * different points of the process.
+ **/
+class SfxRedactionHelper
+{
+public:
+ /// Checks to see if the request has a parameter of IsRedactMode:bool=true
+ static bool isRedactMode(const SfxRequest& rReq);
+ /*
+ * Returns the value of the given string param as an OUString
+ * Returns empty OUString if no param
+ * */
+ static OUString getStringParam(const SfxRequest& rReq, sal_uInt16 nParamId);
+ /*
+ * Creates metafiles from the pages of the given document,
+ * and pushes into the given vector.
+ * */
+ static void getPageMetaFilesFromDoc(std::vector<GDIMetaFile>& aMetaFiles,
+ std::vector<::Size>& aPageSizes, sal_Int32 nPages,
+ DocumentToGraphicRenderer& aRenderer);
+ /*
+ * Creates one shape and one draw page for each gdimetafile,
+ * and inserts the shapes into the newly created draw pages.
+ * */
+ static void
+ addPagesToDraw(const uno::Reference<XComponent>& xComponent, sal_Int32 nPages,
+ const std::vector<GDIMetaFile>& aMetaFiles,
+ const std::vector<::Size>& aPageSizes, const PageMargins& aPageMargins,
+ const std::vector<std::pair<RedactionTarget, OUString>>& r_aTableTargets,
+ bool bIsAutoRedact);
+ /*
+ * Makes the Redaction toolbar visible to the user.
+ * Meant to be called after converting a document to a Draw doc
+ * for redaction purposes.
+ * */
+ static void showRedactionToolbar(const SfxViewFrame* pViewFrame);
+
+ /*
+ * Used to get the page margins from the original/source Writer document. Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+ static PageMargins
+ getPageMarginsForWriter(const css::uno::Reference<css::frame::XModel>& xModel);
+
+ /*
+ * Used to get the page margins from the original/source Calc document. Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+ static PageMargins getPageMarginsForCalc(const css::uno::Reference<css::frame::XModel>& xModel);
+
+ /*
+ * Used to find the text portions to be redacted. Returns a list of rectangles to cover those
+ * areas to be redacted. Probably the most crucial part of the auto-redaction process.
+ * */
+ static void searchInMetaFile(const RedactionTarget& rRedactionTarget, const GDIMetaFile& rMtf,
+ std::vector<tools::Rectangle>& aRedactionRectangles,
+ const uno::Reference<XComponent>& xComponent);
+
+ /*
+ * Draws a redaction rectangle on the draw page referenced with its page number (0-based)
+ * */
+ static void addRedactionRectToPage(const uno::Reference<XComponent>& xComponent,
+ const uno::Reference<drawing::XDrawPage>& xPage,
+ const std::vector<tools::Rectangle>& aNewRectangles);
+
+ /*
+ * Search for the given term through the gdimetafile, which has the whole content of a draw page,
+ * and draw redaction rectangles to the appropriate positions with suitable sizes.
+ * */
+ static void autoRedactPage(const RedactionTarget& rRedactionTarget,
+ const GDIMetaFile& rGDIMetaFile,
+ const uno::Reference<drawing::XDrawPage>& xPage,
+ const uno::Reference<XComponent>& xComponent);
+
+ /// Fill the search options based on the given redaction target
+ static void fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
+ const RedactionTarget& rTarget);
+
+private:
+ static constexpr std::u16string_view m_aPredefinedTargets[6] = {
+ u"\\b(?:\\d[ -]*?){13,16}\\b", //Credit card numbers
+ u"\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\\b", //Email addresses
+ u"\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
+ "\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
+ "\\b", //IP addresses
+ u"([12]\\d{3}[./-](0[1-9]|1[0-2])[./"
+ "-](0[1-9]|[12]\\d|3[01]))|((0[1-9]|[12]\\d|3[01])[./-](0[1-9]|1[0-2])[./"
+ "-][12]\\d{3})", //Dates (numerical)
+ u"\\s*[a-zA-Z]{2}(?:\\s*\\d\\s*){6}[a-zA-Z]?\\s*", //National Insurance Number (UK)
+ u"([1-9])(?!\\1{2}-\\1{2}-\\1{4})[1-9]{2}-[1-9]{2}-[1-9]{4}" //Social Security Number (US)
+ };
+};
+
+#endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
new file mode 100644
index 000000000..b777fad7a
--- /dev/null
+++ b/sfx2/inc/arrdecl.hxx
@@ -0,0 +1,30 @@
+/* -*- 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_ARRDECL_HXX
+#define INCLUDED_SFX2_INC_ARRDECL_HXX
+
+#include <vector>
+#include <memory>
+
+class SfxFilter;
+typedef ::std::vector<std::shared_ptr<const SfxFilter>> SfxFilterList_Impl;
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
new file mode 100644
index 000000000..28c2c561f
--- /dev/null
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -0,0 +1,175 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SFX2_INC_AUTOREDACTDIALOG_HXX
+#define INCLUDED_SFX2_INC_AUTOREDACTDIALOG_HXX
+
+#include <memory>
+#include <sal/config.h>
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/objsh.hxx>
+
+namespace weld
+{
+class Button;
+}
+namespace weld
+{
+class ComboBox;
+}
+namespace weld
+{
+class Label;
+}
+namespace weld
+{
+class Window;
+}
+namespace weld
+{
+class TreeView;
+}
+
+enum RedactionTargetType
+{
+ REDACTION_TARGET_TEXT,
+ REDACTION_TARGET_REGEX,
+ REDACTION_TARGET_PREDEFINED,
+ REDACTION_TARGET_UNKNOWN
+};
+
+/// Keeps information for a single redaction target
+struct RedactionTarget
+{
+ OUString sName;
+ RedactionTargetType sType;
+ OUString sContent;
+ bool bCaseSensitive;
+ bool bWholeWords;
+ sal_uInt32 nID;
+};
+
+/// Used to display the targets list
+class TargetsTable
+{
+ std::unique_ptr<weld::TreeView> m_xControl;
+ int GetRowByTargetName(std::u16string_view sName);
+
+public:
+ TargetsTable(std::unique_ptr<weld::TreeView> xControl);
+ void InsertTarget(RedactionTarget* pTarget);
+ RedactionTarget* GetTargetByName(std::u16string_view sName);
+ OUString GetNameProposal() const;
+
+ int get_selected_index() const { return m_xControl->get_selected_index(); }
+ std::vector<int> get_selected_rows() const { return m_xControl->get_selected_rows(); }
+ void clear() { m_xControl->clear(); }
+ void remove(int nRow) { m_xControl->remove(nRow); }
+ void select(int nRow) { m_xControl->select(nRow); }
+ OUString get_id(int nRow) const { return m_xControl->get_id(nRow); }
+
+ // Sync data on the targets box with the data on the target
+ void setRowData(int nRowIndex, const RedactionTarget* pTarget);
+
+ void connect_row_activated(const Link<weld::TreeView&, bool>& rLink)
+ {
+ m_xControl->connect_row_activated(rLink);
+ };
+};
+
+namespace sfx2
+{
+class FileDialogHelper;
+}
+
+enum class StartFileDialogType
+{
+ Open,
+ SaveAs
+};
+
+class SfxAutoRedactDialog final : public SfxDialogController
+{
+ SfxObjectShellLock m_xDocShell;
+ std::vector<std::pair<std::unique_ptr<RedactionTarget>, OUString>> m_aTableTargets;
+ std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg;
+ bool m_bIsValidState;
+ bool m_bTargetsCopied;
+
+ std::unique_ptr<weld::Label> m_xRedactionTargetsLabel;
+ std::unique_ptr<TargetsTable> m_xTargetsBox;
+ std::unique_ptr<weld::Button> m_xLoadBtn;
+ std::unique_ptr<weld::Button> m_xSaveBtn;
+ std::unique_ptr<weld::Button> m_xAddBtn;
+ std::unique_ptr<weld::Button> m_xEditBtn;
+ std::unique_ptr<weld::Button> m_xDeleteBtn;
+
+ DECL_LINK(Load, weld::Button&, void);
+ DECL_LINK(Save, weld::Button&, void);
+ DECL_LINK(AddHdl, weld::Button&, void);
+ DECL_LINK(EditHdl, weld::Button&, void);
+ DECL_LINK(DeleteHdl, weld::Button&, void);
+ DECL_LINK(DoubleClickEditHdl, weld::TreeView&, bool);
+ DECL_LINK(LoadHdl, sfx2::FileDialogHelper*, void);
+ DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void);
+
+ void StartFileDialog(StartFileDialogType nType, const OUString& rTitle);
+ /// Carry out proper addition both to the targets box, and to the tabletargets vector.
+ void addTarget(std::unique_ptr<RedactionTarget> pTarget);
+ /// Clear all targets both visually and from the targets vector
+ void clearTargets();
+
+public:
+ SfxAutoRedactDialog(weld::Window* pParent);
+ virtual ~SfxAutoRedactDialog() override;
+
+ /// Check if the dialog has any valid redaction targets.
+ bool hasTargets() const;
+ /// Check if the dialog is in a valid state.
+ bool isValidState() const { return m_bIsValidState; }
+ /** Copies targets vector
+ * Does a shallow copy.
+ * Returns true if successful.
+ */
+ bool getTargets(std::vector<std::pair<RedactionTarget, OUString>>& r_aTargets);
+};
+
+class SfxAddTargetDialog final : public weld::GenericDialogController
+{
+private:
+ std::unique_ptr<weld::Entry> m_xName;
+ std::unique_ptr<weld::ComboBox> m_xType;
+ std::unique_ptr<weld::Label> m_xLabelContent;
+ std::unique_ptr<weld::Entry> m_xContent;
+ std::unique_ptr<weld::Label> m_xLabelPredefContent;
+ std::unique_ptr<weld::ComboBox> m_xPredefContent;
+ std::unique_ptr<weld::CheckButton> m_xCaseSensitive;
+ std::unique_ptr<weld::CheckButton> m_xWholeWords;
+
+ DECL_LINK(SelectTypeHdl, weld::ComboBox&, void);
+
+public:
+ SfxAddTargetDialog(weld::Window* pWindow, const OUString& rName);
+ SfxAddTargetDialog(weld::Window* pWindow, const OUString& sName,
+ const RedactionTargetType& eTargetType, const OUString& sContent,
+ bool bCaseSensitive, bool bWholeWords);
+
+ OUString getName() const { return m_xName->get_text(); }
+ RedactionTargetType getType() const;
+ OUString getContent() const;
+ bool isCaseSensitive() const
+ {
+ return m_xCaseSensitive->get_state() == TriState::TRISTATE_TRUE;
+ }
+ bool isWholeWords() const { return m_xWholeWords->get_state() == TriState::TRISTATE_TRUE; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
new file mode 100644
index 000000000..af7f9705e
--- /dev/null
+++ b/sfx2/inc/bitmaps.hlst
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include <rtl/ustring.hxx>
+
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_INDEX_ON = u"sfx2/res/indexon_small.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_INDEX_OFF = u"sfx2/res/indexoff_small.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_START = u"res/sc06303.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_PREV = u"res/sc06301.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_NEXT = u"res/sc06300.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_PRINT = u"res/sc05504.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_BOOKMARKS = u"sfx2/res/favourite.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_SEARCHDIALOG = u"sfx2/res/sc05961.png";
+inline constexpr OUStringLiteral BMP_HELP_TOOLBOX_COPY = u"sfx2/res/sc05711.png";
+inline constexpr OUStringLiteral BMP_HELP_CONTENT_BOOK_OPEN = u"sfx2/res/hlpbookopen.png";
+inline constexpr OUStringLiteral BMP_HELP_CONTENT_BOOK_CLOSED = u"sfx2/res/hlpbookclosed.png";
+inline constexpr OUStringLiteral BMP_HELP_CONTENT_DOC = u"sfx2/res/hlpdoc.png";
+
+//start, sfx2/source/sidebar/Theme.cxx
+inline constexpr OUStringLiteral CLOSEDOC = u"sfx2/res/closedoc.png";
+#define GRIP "sfx2/res/grip.png"
+#define OPEN_MORE "sfx2/res/symphony/open_more.png"
+#define MOREBUTTON "sfx2/res/symphony/morebutton.png"
+#define SIDEBAR_ANIMATION_LARGE "sfx2/res/symphony/sidebar-animation-large.png"
+#define SIDEBAR_GALLERY_LARGE "sfx2/res/symphony/sidebar-gallery-large.png"
+#define SIDEBAR_NAVIGATOR_LARGE "sfx2/res/symphony/sidebar-navigator-large.png"
+#define SIDEBAR_PROPERTY_LARGE "sfx2/res/symphony/sidebar-property-large.png"
+#define SIDEBAR_PROPERTY_SMALL "sfx2/res/symphony/sidebar-property-small.png"
+#define SIDEBAR_STYLE_LARGE "sfx2/res/symphony/sidebar-style-large.png"
+#define SIDEBAR_TEMPLATE_LARGE "sfx2/res/symphony/sidebar-template-large.png"
+#define SIDEBAR_TRANSITION_LARGE "sfx2/res/symphony/sidebar-transition-large.png"
+#define SIDEBAR_FUNCTIONS_LARGE "sfx2/res/symphony/sidebar-functions-large.png"
+//end, sfx2/source/sidebar/Theme.cxx
+
+inline constexpr OUStringLiteral SFX_THUMBNAIL_TEXT = u"res/ott_96_8.png";
+inline constexpr OUStringLiteral SFX_THUMBNAIL_SHEET = u"res/ots_96_8.png";
+inline constexpr OUStringLiteral SFX_THUMBNAIL_PRESENTATION = u"res/otp_96_8.png";
+inline constexpr OUStringLiteral SFX_THUMBNAIL_DRAWING = u"res/otg_96_8.png";
+
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_TEXT = u"res/writer128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_SHEET = u"res/calc128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_PRESENTATION = u"res/impress128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DRAWING = u"res/draw128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DATABASE = u"res/base128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_MATH = u"res/math128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DEFAULT = u"res/main128.png";
+
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_TEXT = u"res/odt_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_SHEET = u"res/ods_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_PRESENTATION = u"res/odp_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DRAWING = u"res/odg_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DATABASE = u"res/odb_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_MATH = u"res/odf_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DEFAULT = u"res/mainapp_48_8.png";
+
+inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_192 = u"res/base_thumbnail_192.png";
+inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_256 = u"res/base_thumbnail_256.png";
+
+inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE = u"res/recentdoc_remove.png";
+inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE_HIGHLIGHTED = u"res/recentdoc_remove_highlighted.png";
+inline constexpr OUStringLiteral BMP_DEFAULT = u"res/templatestar.png";
+
+inline constexpr OUStringLiteral BMP_128X128_CALC_DOC = u"sfx2/res/128x128_calc_doc-p.png";
+inline constexpr OUStringLiteral BMP_128X128_DRAW_DOC = u"sfx2/res/128x128_draw_doc-p.png";
+inline constexpr OUStringLiteral BMP_128X128_IMPRESS_DOC = u"sfx2/res/128x128_impress_doc-p.png";
+inline constexpr OUStringLiteral BMP_128X128_MATH_DOC = u"sfx2/res/128x128_math_doc-p.png";
+inline constexpr OUStringLiteral BMP_128X128_WRITER_DOC = u"sfx2/res/128x128_writer_doc-p.png";
+
+inline constexpr OUStringLiteral SIDEBAR_CLOSE_INDICATOR = u"cmd/lc_decrementlevel.png";
+inline constexpr OUStringLiteral BMP_ACTION_DEFAULT_WRITER = u"res/odt_16_8.png";
+inline constexpr OUStringLiteral BMP_ACTION_DEFAULT_CALC = u"res/ods_16_8.png";
+inline constexpr OUStringLiteral BMP_ACTION_DEFAULT_IMPRESS = u"res/odp_16_8.png";
+inline constexpr OUStringLiteral BMP_ACTION_DEFAULT_DRAW = u"res/odg_16_8.png";
+inline constexpr OUStringLiteral BMP_ACTION_IMPORT = u"cmd/sc_dataimport.png";
+inline constexpr OUStringLiteral BMP_ACTION_EXTENSIONS = u"cmd/sc_additionsdialog.png";
+inline constexpr OUStringLiteral BMP_ACTION_DELETE_CATEGORY = u"cmd/sc_delete.png";
+inline constexpr OUStringLiteral BMP_ACTION_NEW_CATEGORY = u"cmd/sc_add.png";
+inline constexpr OUStringLiteral BMP_ACTION_RENAME = u"cmd/sc_editdoc.png";
+
+inline constexpr OUStringLiteral BMP_MENU_OPEN = u"cmd/sc_opentemplate.png";
+inline constexpr OUStringLiteral BMP_MENU_EDIT = u"cmd/sc_opentemplate.png";
+inline constexpr OUStringLiteral BMP_MENU_MOVE = u"cmd/sc_move.png";
+inline constexpr OUStringLiteral BMP_MENU_RENAME = u"cmd/sc_editdoc.png";
+inline constexpr OUStringLiteral BMP_MENU_DELETE = u"cmd/sc_delete.png";
+inline constexpr OUStringLiteral BMP_MENU_EXPORT = u"cmd/sc_exportto.png";
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/bitset.hxx b/sfx2/inc/bitset.hxx
new file mode 100644
index 000000000..3573e9c23
--- /dev/null
+++ b/sfx2/inc/bitset.hxx
@@ -0,0 +1,49 @@
+/* -*- 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_BITSET_HXX
+#define INCLUDED_SFX2_INC_BITSET_HXX
+
+#include <sal/types.h>
+
+#include <memory>
+
+class IndexBitSet
+{
+private:
+ sal_uInt16 nBlocks;
+ std::unique_ptr<sal_uInt32[]> pBitmap;
+
+ IndexBitSet& operator|=( sal_uInt16 nBit );
+ IndexBitSet& operator-=( sal_uInt16 nBit );
+ bool Contains( sal_uInt16 nBit ) const;
+
+ IndexBitSet(IndexBitSet const &) = delete;
+ void operator =(IndexBitSet const &) = delete;
+
+public:
+ IndexBitSet();
+ ~IndexBitSet();
+
+ sal_uInt16 GetFreeIndex();
+ void ReleaseIndex(sal_uInt16 i){*this-=i;}
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/bluthsndapi.hxx b/sfx2/inc/bluthsndapi.hxx
new file mode 100644
index 000000000..c95bccf89
--- /dev/null
+++ b/sfx2/inc/bluthsndapi.hxx
@@ -0,0 +1,28 @@
+/* -*- 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_INC_BLUTHSNDAPI_HXX
+#define INCLUDED_SFX2_INC_BLUTHSNDAPI_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <sfx2/mailmodelapi.hxx>
+
+
+// class SfxBluetoothModel_Impl -----------------------------------------------
+
+class SfxBluetoothModel:public SfxMailModel
+{
+public:
+ SendMailResult SaveAndSend( const css::uno::Reference< css::frame::XFrame >& xFrame );
+ SendMailResult Send();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/charmapcontrol.hxx b/sfx2/inc/charmapcontrol.hxx
new file mode 100644
index 000000000..e2c1e1e07
--- /dev/null
+++ b/sfx2/inc/charmapcontrol.hxx
@@ -0,0 +1,66 @@
+/* -*- 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 .
+ */
+
+#pragma once
+
+#include <sal/config.h>
+#include <sfx2/charwin.hxx>
+#include <svtools/toolbarmenu.hxx>
+#include <deque>
+
+class CharmapPopup;
+
+namespace com::sun::star::frame { class XFrame; }
+
+class SfxCharmapCtrl final : public WeldToolbarPopup
+{
+public:
+ explicit SfxCharmapCtrl(CharmapPopup* pControl, weld::Widget* pParent);
+ virtual ~SfxCharmapCtrl() override;
+
+ virtual void GrabFocus() override;
+
+private:
+ rtl::Reference<CharmapPopup> m_xControl;
+
+ ScopedVclPtr<VirtualDevice> m_xVirDev;
+
+ std::deque<OUString> m_aRecentCharList;
+ std::deque<OUString> m_aRecentCharFontList;
+ std::deque<OUString> m_aFavCharList;
+ std::deque<OUString> m_aFavCharFontList;
+
+ SvxCharView m_aRecentCharView[16];
+ SvxCharView m_aFavCharView[16];
+ std::unique_ptr<weld::Label> m_xRecentLabel;
+ std::unique_ptr<weld::Button> m_xDlgBtn;
+ std::unique_ptr<weld::CustomWeld> m_xRecentCharView[16];
+ std::unique_ptr<weld::CustomWeld> m_xFavCharView[16];
+
+ DECL_LINK(CharClickHdl, SvxCharView*, void);
+ DECL_LINK(OpenDlgHdl, weld::Button&, void);
+
+ void getFavCharacterList();
+ void updateFavCharControl();
+
+ void getRecentCharacterList(); //gets both recent char and recent char font list
+ void updateRecentCharControl();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/charmappopup.hxx b/sfx2/inc/charmappopup.hxx
new file mode 100644
index 000000000..eb847dc57
--- /dev/null
+++ b/sfx2/inc/charmappopup.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/.
+ *
+ * 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 .
+ */
+
+#pragma once
+
+#include <svtools/popupwindowcontroller.hxx>
+
+class CharmapPopup final : public svt::PopupWindowController
+{
+public:
+ CharmapPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext);
+ virtual ~CharmapPopup() override;
+
+ virtual VclPtr<vcl::Window> createVclPopupWindow(vcl::Window* pParent) override;
+ virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/checkin.hxx b/sfx2/inc/checkin.hxx
new file mode 100644
index 000000000..78535f7aa
--- /dev/null
+++ b/sfx2/inc/checkin.hxx
@@ -0,0 +1,31 @@
+/* -*- 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 <vcl/weld.hxx>
+
+class SfxCheckinDialog final : public weld::GenericDialogController
+{
+private:
+ std::unique_ptr<weld::TextView> m_xCommentED;
+ std::unique_ptr<weld::CheckButton> m_xMajorCB;
+ std::unique_ptr<weld::Button> m_xOKBtn;
+
+ DECL_LINK(OKHdl, weld::Button&, void);
+
+public:
+ SfxCheckinDialog(weld::Window* pParent);
+ virtual ~SfxCheckinDialog() override;
+
+ OUString GetComment() const;
+ bool IsMajor() const;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/commandpopup/CommandPopup.hxx b/sfx2/inc/commandpopup/CommandPopup.hxx
new file mode 100644
index 000000000..a34425f0d
--- /dev/null
+++ b/sfx2/inc/commandpopup/CommandPopup.hxx
@@ -0,0 +1,114 @@
+/* -*- 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 <vcl/weld.hxx>
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+
+#include <functional>
+#include <unordered_set>
+
+struct CurrentEntry final
+{
+ OUString m_aCommandURL;
+ OUString m_aTooltip;
+
+ CurrentEntry(OUString const& rCommandURL, OUString const& rTooltip)
+ : m_aCommandURL(rCommandURL)
+ , m_aTooltip(rTooltip)
+ {
+ }
+};
+
+struct MenuContent final
+{
+ OUString m_aCommandURL;
+ OUString m_aMenuLabel;
+ OUString m_aSearchableMenuLabel;
+ OUString m_aFullLabelWithPath;
+ OUString m_aTooltip;
+ std::vector<MenuContent> m_aSubMenuContent;
+};
+
+class MenuContentHandler final
+{
+private:
+ css::uno::Reference<css::uno::XComponentContext> m_xContext;
+ css::uno::Reference<css::frame::XFrame> m_xFrame;
+ css::uno::Reference<css::i18n::XCharacterClassification> m_xCharacterClassification;
+ css::uno::Reference<css::util::XURLTransformer> m_xURLTransformer;
+
+ MenuContent m_aMenuContent;
+ OUString m_sModuleLongName;
+ OUString toLower(OUString const& rString);
+ std::unordered_set<OUString> m_aAdded;
+
+public:
+ MenuContentHandler(css::uno::Reference<css::frame::XFrame> const& xFrame);
+
+ void gatherMenuContent(css::uno::Reference<css::container::XIndexAccess> const& xIndexAccess,
+ MenuContent& rMenuContent);
+
+ void findInMenu(OUString const& rText, std::unique_ptr<weld::TreeView>& rpCommandTreeView,
+ std::vector<CurrentEntry>& rCommandList);
+
+private:
+ void findInMenuRecursive(
+ MenuContent const& rMenuContent, OUString const& rText,
+ std::unique_ptr<weld::TreeView>& rpCommandTreeView, std::vector<CurrentEntry>& rCommandList,
+ std::function<bool(MenuContent const&, OUString const&)> const& rSearchCriterium);
+
+ void addCommandIfPossible(MenuContent const& rMenuContent,
+ const std::unique_ptr<weld::TreeView>& rpCommandTreeView,
+ std::vector<CurrentEntry>& rCommandList);
+};
+
+class CommandListBox final
+{
+private:
+ std::unique_ptr<weld::Builder> mxBuilder;
+ std::unique_ptr<weld::Popover> mxPopover;
+ std::unique_ptr<weld::Entry> mpEntry;
+ std::unique_ptr<weld::TreeView> mpCommandTreeView;
+
+ std::vector<CurrentEntry> maCommandList;
+ std::unique_ptr<MenuContentHandler> mpMenuContentHandler;
+
+ DECL_LINK(QueryTooltip, const weld::TreeIter&, OUString);
+ DECL_LINK(RowActivated, weld::TreeView&, bool);
+ DECL_LINK(ModifyHdl, weld::Entry&, void);
+ DECL_LINK(TreeViewKeyPress, const KeyEvent&, bool);
+
+ void dispatchCommandAndClose(OUString const& rCommand);
+
+public:
+ CommandListBox(weld::Window* pParent, css::uno::Reference<css::frame::XFrame> const& xFrame);
+ void connect_closed(const Link<weld::Popover&, void>& rLink)
+ {
+ mxPopover->connect_closed(rLink);
+ }
+};
+
+class CommandPopupHandler final
+{
+private:
+ std::unique_ptr<CommandListBox> mpListBox;
+
+public:
+ void showPopup(weld::Window* pParent, css::uno::Reference<css::frame::XFrame> const& xFrame);
+ DECL_LINK(PopupModeEnd, weld::Popover&, void);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/dinfdlg.hrc b/sfx2/inc/dinfdlg.hrc
new file mode 100644
index 000000000..b0b72d868
--- /dev/null
+++ b/sfx2/inc/dinfdlg.hrc
@@ -0,0 +1,87 @@
+/* -*- 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_DINFDLG_HRC
+#define INCLUDED_SFX2_INC_DINFDLG_HRC
+
+#include <unotools/resmgr.hxx>
+
+#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+
+const TranslateId SFX_CB_PROPERTY_STRINGARRAY[] =
+{
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Checked by"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Client"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Date completed"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Department"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Destinations"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Disposition"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Division"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Document number"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Editor"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Email"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Forward to"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Group"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Info"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Language"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Mailstop"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Matter"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Office"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Owner"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Project"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Publisher"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Purpose"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Received from"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Recorded by"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Recorded date"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Reference"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Source"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Status"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Telephone number"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Typist"),
+ NC_("SFX_CB_PROPERTY_STRINGARRAY", "URL")
+};
+
+enum CustomProperties : sal_Int32 {
+ Custom_Type_Unknown = 0,
+ Custom_Type_Text = 1,
+ Custom_Type_Number = 2,
+ Custom_Type_Date = 3,
+ Custom_Type_Boolean = 4,
+ Custom_Type_Duration = 5,
+ Custom_Type_Datetime = 6
+};
+
+const std::pair<TranslateId, CustomProperties> SFX_LB_PROPERTY_STRINGARRAY[] =
+{
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "Text") , Custom_Type_Text },
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "DateTime") , Custom_Type_Datetime },
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "Date") , Custom_Type_Date },
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "Duration") , Custom_Type_Duration },
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "Number") , Custom_Type_Number },
+ { NC_("SFX_CB_PROPERTY_STRINGARRAY", "Yes or no") , Custom_Type_Boolean }
+};
+
+// accessibility descriptions that use %PRODUCTNAME, we set these explicitly because querying a11y descs
+// in order to change %PRODUCTNAME at runtime is expensive, so limit doing that as much as possible.
+#define STR_A11Y_DESC_USERDATA NC_("documentinfopage|extended_tip|userdatacb", "Saves the user's full name with the file. You can edit the name by choosing Tools - Options - %PRODUCTNAME - User Data.")
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc
new file mode 100644
index 000000000..d6b98a0e2
--- /dev/null
+++ b/sfx2/inc/doctempl.hrc
@@ -0,0 +1,45 @@
+/* -*- 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_DOCTEMPL_HRC
+#define INCLUDED_SFX2_INC_DOCTEMPL_HRC
+
+#include <unotools/resmgr.hxx>
+
+#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+
+const TranslateId TEMPLATE_LONG_NAMES_ARY[] =
+{
+ NC_("TEMPLATE_LONG_NAMES_ARY", "My Templates"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Styles"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Business Correspondence"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Other Business Documents"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Personal Correspondence and Documents"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Forms and Contracts"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Finances"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Education"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Presentation Backgrounds"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Presentations"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Miscellaneous"),
+ NC_("TEMPLATE_LONG_NAMES_ARY", "Labels")
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/emojicontrol.hxx b/sfx2/inc/emojicontrol.hxx
new file mode 100644
index 000000000..50b70dc57
--- /dev/null
+++ b/sfx2/inc/emojicontrol.hxx
@@ -0,0 +1,56 @@
+/* -*- 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 <sal/config.h>
+#include <svtools/toolbarmenu.hxx>
+#include <vcl/customweld.hxx>
+
+namespace com::sun::star::frame
+{
+class XFrame;
+}
+
+class EmojiPopup;
+class EmojiView;
+class ThumbnailViewItem;
+enum class FILTER_CATEGORY;
+
+class SfxEmojiControl final : public WeldToolbarPopup
+
+{
+public:
+ explicit SfxEmojiControl(const EmojiPopup* pControl, weld::Widget* pParent);
+ virtual ~SfxEmojiControl() override;
+
+ virtual void GrabFocus() override;
+
+private:
+ static void ConvertLabelToUnicode(weld::ToggleButton& rBtn);
+
+ FILTER_CATEGORY getFilter(const weld::Toggleable& rBtn) const;
+
+ DECL_LINK(ActivatePageHdl, weld::Toggleable&, void);
+ DECL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, void);
+
+ std::unique_ptr<weld::ToggleButton> mxPeopleBtn;
+ std::unique_ptr<weld::ToggleButton> mxNatureBtn;
+ std::unique_ptr<weld::ToggleButton> mxFoodBtn;
+ std::unique_ptr<weld::ToggleButton> mxActivityBtn;
+ std::unique_ptr<weld::ToggleButton> mxTravelBtn;
+ std::unique_ptr<weld::ToggleButton> mxObjectsBtn;
+ std::unique_ptr<weld::ToggleButton> mxSymbolsBtn;
+ std::unique_ptr<weld::ToggleButton> mxFlagsBtn;
+ std::unique_ptr<weld::ToggleButton> mxUnicode9Btn;
+ std::unique_ptr<EmojiView> mxEmojiView;
+ std::unique_ptr<weld::CustomWeld> mxEmojiWeld;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/emojipopup.hxx b/sfx2/inc/emojipopup.hxx
new file mode 100644
index 000000000..9961c8a84
--- /dev/null
+++ b/sfx2/inc/emojipopup.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/.
+ *
+ * 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 .
+ */
+
+#pragma once
+
+#include <svtools/popupwindowcontroller.hxx>
+
+class EmojiPopup final : public svt::PopupWindowController
+{
+public:
+ EmojiPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext);
+ virtual ~EmojiPopup() override;
+
+ virtual VclPtr<vcl::Window> createVclPopupWindow(vcl::Window* pParent) override;
+ virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/emojiview.hxx b/sfx2/inc/emojiview.hxx
new file mode 100644
index 000000000..8328f2f41
--- /dev/null
+++ b/sfx2/inc/emojiview.hxx
@@ -0,0 +1,76 @@
+/* -*- 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 <sfx2/thumbnailview.hxx>
+
+//unicode item defines
+#define ITEM_MAX_WIDTH 30
+#define ITEM_MAX_HEIGHT 30
+#define ITEM_PADDING 5
+#define ITEM_MAX_TEXT_LENGTH 10
+
+enum class FILTER_CATEGORY
+{
+ PEOPLE,
+ NATURE,
+ FOOD,
+ ACTIVITY,
+ TRAVEL,
+ OBJECTS,
+ SYMBOLS,
+ FLAGS,
+ UNICODE9
+};
+
+// Display unicode emojis depending on the category
+class ViewFilter_Category final
+{
+public:
+ ViewFilter_Category(FILTER_CATEGORY rCategory)
+ : mCategory(rCategory)
+ {
+ }
+
+ bool operator()(const ThumbnailViewItem* pItem);
+
+ static bool isFilteredCategory(FILTER_CATEGORY filter, std::u16string_view rCategory);
+
+private:
+ FILTER_CATEGORY mCategory;
+};
+
+class EmojiView final : public ThumbnailView
+{
+public:
+ EmojiView(std::unique_ptr<weld::ScrolledWindow> xWindow);
+
+ virtual ~EmojiView() override;
+
+ // Fill view with emojis
+ void Populate();
+
+ void setInsertEmojiHdl(const Link<ThumbnailViewItem*, void>& rLink);
+
+ void AppendItem(const OUString& rTitle, const OUString& rCategory, const OUString& rName);
+
+private:
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
+
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
+
+ std::string msJSONData;
+
+ Link<ThumbnailViewItem*, void> maInsertEmojiHdl;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/emojiviewitem.hxx b/sfx2/inc/emojiviewitem.hxx
new file mode 100644
index 000000000..61a330673
--- /dev/null
+++ b/sfx2/inc/emojiviewitem.hxx
@@ -0,0 +1,35 @@
+/* -*- 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 <sfx2/thumbnailviewitem.hxx>
+
+class EmojiViewItem final : public ThumbnailViewItem
+{
+public:
+ EmojiViewItem(ThumbnailView& rView, sal_uInt16 nId);
+
+ virtual ~EmojiViewItem () override;
+
+ void setCategory (const OUString &rCategory) { msCategory = rCategory; }
+
+ const OUString& getCategory () const { return msCategory; }
+
+ virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs) override;
+
+ virtual void calculateItemsPosition (const tools::Long nThumbnailHeight,
+ const tools::Long nPadding, sal_uInt32 nMaxTextLength,
+ const ThumbnailItemAttributes *pAttrs) override;
+private:
+ OUString msCategory;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/fwkhelper.hxx b/sfx2/inc/fwkhelper.hxx
new file mode 100644
index 000000000..d206957c9
--- /dev/null
+++ b/sfx2/inc/fwkhelper.hxx
@@ -0,0 +1,31 @@
+/* -*- 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_FWKHELPER_HXX
+#define INCLUDED_SFX2_INC_FWKHELPER_HXX
+
+#include <sal/config.h>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
+
+void RefreshToolbars(css::uno::Reference<css::frame::XFrame> const& rFrame);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
new file mode 100644
index 000000000..c19f78e3f
--- /dev/null
+++ b/sfx2/inc/guisaveas.hxx
@@ -0,0 +1,87 @@
+/* -*- 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_GUISAVEAS_HXX
+#define INCLUDED_SFX2_INC_GUISAVEAS_HXX
+
+#include <sal/config.h>
+
+#include <string_view>
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XContainerQuery.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XModuleManager2.hpp>
+
+#include <sfx2/signaturestate.hxx>
+
+
+namespace com::sun::star::document { class XDocumentProperties; }
+
+namespace weld { class Window; }
+class ModelData_Impl;
+
+class SfxStoringHelper
+{
+ friend class ModelData_Impl;
+
+private:
+ css::uno::Reference< css::container::XNameAccess > m_xFilterCFG;
+ css::uno::Reference< css::container::XContainerQuery > m_xFilterQuery;
+ css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
+
+ css::uno::Reference< css::container::XNameAccess > const & GetFilterConfiguration();
+ css::uno::Reference< css::container::XContainerQuery > const & GetFilterQuery();
+ css::uno::Reference< css::frame::XModuleManager2 > const & GetModuleManager();
+
+public:
+ SfxStoringHelper();
+
+ bool GUIStoreModel(
+ const css::uno::Reference< css::frame::XModel >& xModel,
+ std::u16string_view aSlotName,
+ css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence,
+ bool bPreselectPassword,
+ SignatureState nDocumentSignatureState );
+
+ static bool CheckFilterOptionsAppearance(
+ const css::uno::Reference< css::container::XNameAccess >& xFilterCFG,
+ const OUString& aFilterName );
+
+
+ static void SetDocInfoState(
+ const css::uno::Reference< css::frame::XModel >& xModel,
+ const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo );
+
+ static bool WarnUnacceptableFormat(
+ const css::uno::Reference< css::frame::XModel >& xModel,
+ std::u16string_view aOldUIName,
+ const OUString& aDefExtension,
+ bool rDefaultIsAlien );
+
+ static css::uno::Reference<css::awt::XWindow> GetModelXWindow(const css::uno::Reference<css::frame::XModel>& rModel);
+ static weld::Window* GetModelWindow( const css::uno::Reference< css::frame::XModel >& xModel );
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx
new file mode 100644
index 000000000..1e695a9e4
--- /dev/null
+++ b/sfx2/inc/inettbc.hxx
@@ -0,0 +1,64 @@
+/* -*- 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_INETTBC_HXX
+#define INCLUDED_SFX2_INC_INETTBC_HXX
+
+#include <rtl/ustring.hxx>
+#include <sfx2/tbxctrl.hxx>
+
+namespace weld { class ComboBox; };
+class URLBoxItemWindow;
+class SvtURLBox;
+
+class SfxURLToolBoxControl_Impl final : public SfxToolBoxControl
+{
+private:
+ bool m_bModified;
+
+ SvtURLBox* GetURLBox() const;
+ URLBoxItemWindow* GetURLBoxItemWindow() const;
+ void OpenURL( const OUString& rName ) const;
+
+ DECL_LINK(OpenHdl, weld::ComboBox&, bool);
+ DECL_LINK(SelectHdl, weld::ComboBox&, void);
+
+ struct ExecuteInfo
+ {
+ css::uno::Reference< css::frame::XDispatch > xDispatch;
+ css::util::URL aTargetURL;
+ css::uno::Sequence< css::beans::PropertyValue > aArgs;
+ };
+
+ DECL_STATIC_LINK( SfxURLToolBoxControl_Impl, ExecuteHdl_Impl, void*, void );
+
+public:
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SfxURLToolBoxControl_Impl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rBox );
+ virtual ~SfxURLToolBoxControl_Impl() override;
+
+ virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/notebookbar/NotebookbarTabControl.hxx b/sfx2/inc/notebookbar/NotebookbarTabControl.hxx
new file mode 100644
index 000000000..ebbffc4f9
--- /dev/null
+++ b/sfx2/inc/notebookbar/NotebookbarTabControl.hxx
@@ -0,0 +1,48 @@
+/* -*- 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 <vcl/tabctrl.hxx>
+
+#include <com/sun/star/frame/XFrame.hpp>
+
+namespace com::sun::star::ui { class XUIConfigurationListener; }
+namespace com::sun::star::uno { class XComponentContext; }
+
+class NotebookbarTabControl final : public NotebookbarTabControlBase
+{
+friend class ChangedUIEventListener;
+
+public:
+ NotebookbarTabControl( Window* pParent );
+ ~NotebookbarTabControl() override;
+
+ virtual void KeyInput( const KeyEvent& rKEvt ) override;
+ virtual bool EventNotify( NotifyEvent& rNEvt ) override;
+ virtual void StateChanged(StateChangedType nStateChange) override;
+ virtual Size calculateRequisition() const override;
+
+private:
+ static void FillShortcutsToolBox(css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ const css::uno::Reference<css::frame::XFrame>& xFrame,
+ const OUString& aModuleName,
+ ToolBox* pShortcuts
+ );
+ void ArrowStops( sal_uInt16 nCode );
+
+ DECL_LINK(OpenNotebookbarPopupMenu, NotebookBar*, void);
+
+ css::uno::Reference<css::ui::XUIConfigurationListener> m_pListener;
+ css::uno::Reference<css::frame::XFrame> m_xFrame;
+ bool m_bInitialized;
+ bool m_bInvalidate;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/pch/precompiled_sfx.cxx b/sfx2/inc/pch/precompiled_sfx.cxx
new file mode 100644
index 000000000..b741a11c2
--- /dev/null
+++ b/sfx2/inc/pch/precompiled_sfx.cxx
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+#include "precompiled_sfx.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
new file mode 100644
index 000000000..1fa9bcf42
--- /dev/null
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -0,0 +1,486 @@
+/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2022-01-26 09:15:03 using:
+ ./bin/update_pch sfx2 sfx --cutoff=3 --exclude:system --exclude:module --exclude:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./sfx2/inc/pch/precompiled_sfx.hxx "make sfx2.build" --find-conflicts
+*/
+
+#include <sal/config.h>
+#if PCH_LEVEL >= 1
+#include <algorithm>
+#include <assert.h>
+#include <cassert>
+#include <chrono>
+#include <condition_variable>
+#include <cstddef>
+#include <cstdlib>
+#include <deque>
+#include <functional>
+#include <initializer_list>
+#include <limits>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <new>
+#include <optional>
+#include <ostream>
+#include <set>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string>
+#include <string_view>
+#include <type_traits>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+#include <boost/property_tree/json_parser.hpp>
+#include <boost/property_tree/ptree.hpp>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#include <osl/conditn.hxx>
+#include <osl/diagnose.h>
+#include <osl/file.hxx>
+#include <osl/interlck.h>
+#include <osl/module.h>
+#include <osl/module.hxx>
+#include <osl/mutex.hxx>
+#include <osl/process.h>
+#include <osl/security.hxx>
+#include <osl/thread.h>
+#include <osl/thread.hxx>
+#include <osl/time.h>
+#include <rtl/alloc.h>
+#include <rtl/bootstrap.hxx>
+#include <rtl/byteseq.hxx>
+#include <rtl/character.hxx>
+#include <rtl/instance.hxx>
+#include <rtl/malformeduriexception.hxx>
+#include <rtl/math.hxx>
+#include <rtl/ref.hxx>
+#include <rtl/strbuf.hxx>
+#include <rtl/string.h>
+#include <rtl/string.hxx>
+#include <rtl/stringconcat.hxx>
+#include <rtl/stringutils.hxx>
+#include <rtl/tencinfo.h>
+#include <rtl/textcvt.h>
+#include <rtl/textenc.h>
+#include <rtl/uri.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.h>
+#include <rtl/ustring.hxx>
+#include <sal/backtrace.hxx>
+#include <sal/log.hxx>
+#include <sal/macros.h>
+#include <sal/saldllapi.h>
+#include <sal/types.h>
+#include <vcl/EnumContext.hxx>
+#include <vcl/InterimItemWindow.hxx>
+#include <vcl/Scanline.hxx>
+#include <vcl/alpha.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/builder.hxx>
+#include <vcl/commandevent.hxx>
+#include <vcl/commandinfoprovider.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/dibtools.hxx>
+#include <vcl/dllapi.h>
+#include <vcl/errcode.hxx>
+#include <vcl/event.hxx>
+#include <vcl/font.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/gfxlink.hxx>
+#include <vcl/gradient.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/graphicfilter.hxx>
+#include <vcl/help.hxx>
+#include <vcl/idle.hxx>
+#include <vcl/image.hxx>
+#include <vcl/imapobj.hxx>
+#include <vcl/keycod.hxx>
+#include <vcl/keycodes.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/syswin.hxx>
+#include <vcl/timer.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/toolboxid.hxx>
+#include <vcl/vclenum.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/weld.hxx>
+#include <vcl/weldutils.hxx>
+#include <vcl/window.hxx>
+#include <vcl/windowstate.hxx>
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basic/basicdllapi.h>
+#include <basic/basicmanagerrepository.hxx>
+#include <basic/basmgr.hxx>
+#include <basic/sbdef.hxx>
+#include <basic/sberrors.hxx>
+#include <basic/sbstar.hxx>
+#include <basic/sbxdef.hxx>
+#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/PropertyExistException.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XContainerQuery.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/document/DocumentProperties.hpp>
+#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/document/UpdateDocMode.hpp>
+#include <com/sun/star/document/XCmisDocument.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XTypeDetection.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/frame/DispatchResultState.hpp>
+#include <com/sun/star/frame/Frame.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/frame/ModuleManager.hpp>
+#include <com/sun/star/frame/UnknownModuleException.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
+#include <com/sun/star/frame/XDispatchResultListener.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XToolbarController.hpp>
+#include <com/sun/star/frame/status/ItemStatus.hpp>
+#include <com/sun/star/frame/status/Visibility.hpp>
+#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/XPrimitive2D.hpp>
+#include <com/sun/star/io/IOException.hpp>
+#include <com/sun/star/io/WrongFormatException.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/NoSupportException.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentSignatureInformation.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/task/ErrorCodeRequest.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include <com/sun/star/ucb/NameClash.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
+#include <com/sun/star/ui/XSidebarPanel.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ControlActions.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Type.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
+#include <com/sun/star/util/CloseVetoException.hpp>
+#include <com/sun/star/util/RevisionTag.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/util/URLTransformer.hpp>
+#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/xml/sax/Parser.hpp>
+#include <comphelper/compbase.hxx>
+#include <comphelper/comphelperdllapi.h>
+#include <comphelper/dispatchcommand.hxx>
+#include <comphelper/docpasswordhelper.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/fileformat.h>
+#include <comphelper/fileurl.hxx>
+#include <comphelper/interaction.hxx>
+#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
+#include <comphelper/lok.hxx>
+#include <comphelper/multicontainer2.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
+#include <comphelper/propertyvalue.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/servicehelper.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/types.hxx>
+#include <cppu/unotype.hxx>
+#include <cppuhelper/cppuhelperdllapi.h>
+#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <drawinglayer/drawinglayerdllapi.h>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx>
+#include <drawinglayer/primitive2d/CommonTypes.hxx>
+#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
+#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <framework/fwkdllapi.h>
+#include <framework/interaction.hxx>
+#include <i18nlangtag/lang.h>
+#include <i18nlangtag/languagetag.hxx>
+#include <o3tl/cow_wrapper.hxx>
+#include <o3tl/deleter.hxx>
+#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
+#include <o3tl/typed_flags_set.hxx>
+#include <officecfg/Office/Common.hxx>
+#include <salhelper/simplereferenceobject.hxx>
+#include <sot/exchange.hxx>
+#include <sot/formats.hxx>
+#include <sot/storage.hxx>
+#include <svl/SfxBroadcaster.hxx>
+#include <svl/eitem.hxx>
+#include <svl/hint.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itemiter.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/lockfilecommon.hxx>
+#include <svl/macitem.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/slstitm.hxx>
+#include <svl/stritem.hxx>
+#include <svl/style.hxx>
+#include <svl/svdde.hxx>
+#include <svl/svldllapi.h>
+#include <svl/undo.hxx>
+#include <svl/urihelper.hxx>
+#include <svl/visitem.hxx>
+#include <svl/whiter.hxx>
+#include <svtools/ehdl.hxx>
+#include <svtools/imagemgr.hxx>
+#include <svtools/miscopt.hxx>
+#include <svtools/sfxecode.hxx>
+#include <svtools/soerr.hxx>
+#include <svtools/svtdllapi.h>
+#include <toolkit/helper/convert.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/color.hxx>
+#include <tools/datetime.hxx>
+#include <tools/debug.hxx>
+#include <tools/degree.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/fract.hxx>
+#include <tools/gen.hxx>
+#include <tools/globname.hxx>
+#include <tools/json_writer.hxx>
+#include <tools/link.hxx>
+#include <tools/long.hxx>
+#include <tools/poly.hxx>
+#include <tools/ref.hxx>
+#include <tools/solar.h>
+#include <tools/stream.hxx>
+#include <tools/svborder.hxx>
+#include <tools/toolsdllapi.h>
+#include <tools/urlobj.hxx>
+#include <typelib/typedescription.h>
+#include <ucbhelper/content.hxx>
+#include <uno/sequence2.h>
+#include <unotools/configmgr.hxx>
+#include <unotools/confignode.hxx>
+#include <unotools/eventcfg.hxx>
+#include <unotools/historyoptions.hxx>
+#include <unotools/localedatawrapper.hxx>
+#include <unotools/mediadescriptor.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <unotools/options.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/resmgr.hxx>
+#include <unotools/saveopt.hxx>
+#include <unotools/securityoptions.hxx>
+#include <unotools/streamwrap.hxx>
+#include <unotools/syslocale.hxx>
+#include <unotools/tempfile.hxx>
+#include <unotools/ucbhelper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/unotoolsdllapi.h>
+#include <unotools/useroptions.hxx>
+#include <unotools/viewoptions.hxx>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#include <appbaslib.hxx>
+#include <appdata.hxx>
+#include <appopen.hxx>
+#include <eventsupplier.hxx>
+#include <helper.hxx>
+#include <helpids.h>
+#include <itemdel.hxx>
+#include <nochaos.hxx>
+#include <objshimp.hxx>
+#include <openflag.hxx>
+#include <openuriexternally.hxx>
+#include <openurlhint.hxx>
+#include <sfx2/StyleManager.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/classificationhelper.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <sfx2/devtools/DevelopmentToolDockingWindow.hxx>
+#include <sfx2/dinfdlg.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/dllapi.h>
+#include <sfx2/docfac.hxx>
+#include <sfx2/docfile.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/dockwin.hxx>
+#include <sfx2/doctempl.hxx>
+#include <sfx2/event.hxx>
+#include <sfx2/fcontnr.hxx>
+#include <sfx2/filedlghelper.hxx>
+#include <sfx2/flatpak.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/frmdescr.hxx>
+#include <sfx2/infobar.hxx>
+#include <sfx2/inputdlg.hxx>
+#include <sfx2/ipclient.hxx>
+#include <sfx2/linkmgr.hxx>
+#include <sfx2/lnkbase.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <sfx2/module.hxx>
+#include <sfx2/msg.hxx>
+#include <sfx2/msgpool.hxx>
+#include <sfx2/newstyle.hxx>
+#include <sfx2/notebookbar/SfxNotebookBar.hxx>
+#include <sfx2/objface.hxx>
+#include <sfx2/objitem.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/passwd.hxx>
+#include <sfx2/printer.hxx>
+#include <sfx2/progress.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/sfxbasecontroller.hxx>
+#include <sfx2/sfxbasemodel.hxx>
+#include <sfx2/sfxdlg.hxx>
+#include <sfx2/sfxhelp.hxx>
+#include <sfx2/sfxresid.hxx>
+#include <sfx2/sfxuno.hxx>
+#include <sfx2/sidebar/Context.hxx>
+#include <sfx2/sidebar/Deck.hxx>
+#include <sfx2/sidebar/FocusManager.hxx>
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+#include <sfx2/sidebar/SidebarChildWindow.hxx>
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/SidebarDockingWindow.hxx>
+#include <sfx2/sidebar/TabBar.hxx>
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/signaturestate.hxx>
+#include <sfx2/stbitem.hxx>
+#include <sfx2/styfitem.hxx>
+#include <sfx2/tabdlg.hxx>
+#include <sfx2/tbxctrl.hxx>
+#include <sfx2/templatedlg.hxx>
+#include <sfx2/thumbnailview.hxx>
+#include <sfx2/thumbnailviewitem.hxx>
+#include <sfx2/tplpitem.hxx>
+#include <sfx2/viewfac.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfxpicklist.hxx>
+#include <sfxtypes.hxx>
+#include <sfxurlrelocator.hxx>
+#include <splitwin.hxx>
+#include <statcach.hxx>
+#include <templdgi.hxx>
+#include <tplcitem.hxx>
+#include <workwin.hxx>
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/preventduplicateinteraction.hxx b/sfx2/inc/preventduplicateinteraction.hxx
new file mode 100644
index 000000000..62e59dd96
--- /dev/null
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -0,0 +1,329 @@
+/* -*- 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_FRAMEWORK_PREVENTDUPLICATEINTERACTION_HXX
+#define INCLUDED_FRAMEWORK_PREVENTDUPLICATEINTERACTION_HXX
+
+#include <vector>
+
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/frame/TerminationVetoException.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/task/XInteractionHandler2.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+
+#include <comphelper/compbase.hxx>
+#include <cppuhelper/implbase.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/wrkwin.hxx>
+#include <vcl/svapp.hxx>
+#include <mutex>
+
+namespace com::sun::star::uno {
+ class XComponentContext;
+}
+
+namespace sfx2 {
+
+inline void closedialogs(SystemWindow& rTopLevel, bool bCloseRoot)
+{
+ for (vcl::Window *pChild = rTopLevel.GetWindow(GetWindowType::FirstTopWindowChild); pChild; pChild = rTopLevel.GetWindow(GetWindowType::NextTopWindowSibling))
+ closedialogs(dynamic_cast<SystemWindow&>(*pChild), true);
+ if (bCloseRoot)
+ rTopLevel.Close();
+}
+
+// This is intended to be the parent for any warning dialogs launched
+// during the load of a document so that those dialogs are modal to
+// this window and don't block any existing windows.
+//
+// If there are dialog children open on exit then veto termination,
+// close the topmost dialog and retry termination.
+class WarningDialogsParent final :
+ public comphelper::WeakComponentImplHelper<css::frame::XTerminateListener>
+{
+private:
+ VclPtr<WorkWindow> m_xWin;
+ css::uno::Reference<css::awt::XWindow> m_xInterface;
+
+private:
+
+ DECL_STATIC_LINK(WarningDialogsParent, TerminateDesktop, void*, void);
+
+ void closewarningdialogs()
+ {
+ if (!m_xWin)
+ return;
+ SolarMutexGuard aSolarGuard;
+ closedialogs(dynamic_cast<SystemWindow&>(*m_xWin), false);
+ }
+
+public:
+
+ using comphelper::WeakComponentImplHelperBase::disposing;
+ virtual void SAL_CALL disposing(const css::lang::EventObject&) override
+ {
+ }
+
+ // XTerminateListener
+ virtual void SAL_CALL queryTermination(const css::lang::EventObject&) override
+ {
+ closewarningdialogs();
+ Application::PostUserEvent(LINK(this, WarningDialogsParent, TerminateDesktop));
+ throw css::frame::TerminationVetoException();
+ }
+
+ virtual void SAL_CALL notifyTermination(const css::lang::EventObject&) override
+ {
+ }
+
+public:
+ WarningDialogsParent()
+ {
+ SolarMutexGuard aSolarGuard;
+ m_xWin = VclPtr<WorkWindow>::Create(nullptr, WB_STDWORK);
+ m_xWin->SetText("dialog parent for warning dialogs during load");
+ m_xInterface = VCLUnoHelper::GetInterface(m_xWin);
+ }
+
+ virtual ~WarningDialogsParent() override
+ {
+ closewarningdialogs();
+ m_xWin.disposeAndClear();
+ }
+
+ const css::uno::Reference<css::awt::XWindow>& GetDialogParent() const
+ {
+ return m_xInterface;
+ }
+};
+
+class WarningDialogsParentScope
+{
+private:
+ css::uno::Reference<css::frame::XDesktop> m_xDesktop;
+ rtl::Reference<WarningDialogsParent> m_xListener;
+
+public:
+ WarningDialogsParentScope(const css::uno::Reference<css::uno::XComponentContext>& rContext)
+ : m_xDesktop(css::frame::Desktop::create(rContext), css::uno::UNO_QUERY_THROW)
+ , m_xListener(new WarningDialogsParent)
+ {
+ m_xDesktop->addTerminateListener(m_xListener);
+ }
+
+ const css::uno::Reference<css::awt::XWindow>& GetDialogParent() const
+ {
+ return m_xListener->GetDialogParent();
+ }
+
+ ~WarningDialogsParentScope()
+ {
+ m_xDesktop->removeTerminateListener(m_xListener);
+ }
+};
+
+/**
+ @short Prevent us from showing the same interaction more than once during
+ the same transaction.
+
+ @descr Every interaction provided to this helper will be safed ... handled by the internal
+ used UUIInteractionHandler (!) and never be handled a second time!
+
+ On the other side there exists some interactions, which allow a retry.
+ So this helper allow to set a list of interactions combined with a retry value.
+ */
+class PreventDuplicateInteraction final :
+ public ::cppu::WeakImplHelper<css::lang::XInitialization, css::task::XInteractionHandler2>
+{
+ mutable std::mutex m_aLock;
+
+ // structs, types etc.
+ public:
+
+ struct InteractionInfo
+ {
+ public:
+ /// describe the interaction.
+ css::uno::Type m_aInteraction;
+ /// after max count was reached this interaction will be blocked.
+ sal_Int32 m_nMaxCount;
+ /// count how often this interaction was called.
+ sal_Int32 m_nCallCount;
+ /** hold the last intercepted request (matching the set interaction type) alive
+ so it can be used for further checks */
+ css::uno::Reference< css::task::XInteractionRequest > m_xRequest;
+
+ public:
+
+ InteractionInfo(const css::uno::Type& aInteraction)
+ : m_aInteraction(aInteraction)
+ , m_nMaxCount (1 )
+ , m_nCallCount (0 )
+ {}
+ };
+
+ // member
+ private:
+
+ /// Used to create needed uno services at runtime.
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+
+ /** The outside interaction handler, which is used to handle every incoming interaction,
+ if it's not blocked. */
+ css::uno::Reference< css::task::XInteractionHandler > m_xHandler;
+
+ std::unique_ptr<WarningDialogsParentScope> m_xWarningDialogsParent;
+
+ /** This list describe which and how incoming interactions must be handled.
+ Further it contains all collected information after this interaction
+ object was used.*/
+ std::vector< InteractionInfo > m_lInteractionRules;
+
+
+ // uno interface
+ public:
+
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
+ /**
+ @interface XInteractionHandler
+ @short called from outside to handle a problem
+ @descr We filter the incoming interactions. some of them
+ will be forwarded to the generic UI interaction handler.
+ So we must not implement it twice. Some other ones
+ will be aborted only.
+
+ @threadsafe yes
+ */
+ virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest) override;
+
+
+ /**
+ @interface XInteractionHandler2
+ @short called from outside to handle a problem
+ @descr We filter the incoming interactions. some of them
+ will be forwarded to the generic UI interaction handler.
+ So we must not implement it twice. Some other ones
+ will be aborted only.
+
+ @threadsafe yes
+ */
+ virtual sal_Bool SAL_CALL handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& xRequest ) override;
+
+
+ /**
+ @interface XInterface
+ @short called to query another interface of the component
+ @descr Will allow to query for XInteractionHandler2 if and only if m_xHandler supports this interface, too.
+
+ @threadsafe yes
+ */
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
+
+ // c++ interface
+ public:
+
+
+ /**
+ @short ctor to guarantee right initialized instances of this class
+ @descr It uses the given uno service manager to create the global
+ generic UI interaction handler for later internal using.
+
+ @param xSMGR
+ uno service manager for creating services internally
+
+ @threadsafe not necessary
+ */
+ PreventDuplicateInteraction(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
+
+
+ /**
+ @short dtor to free used memory.
+ */
+ virtual ~PreventDuplicateInteraction() override;
+
+
+ /**
+ @short set the outside interaction handler, which must be used internally
+ if the interaction will not be blocked by the set list of rules.
+
+ @note This overwrites the settings of e.g. useDefaultUUIHandler()!
+
+ @param xHandler
+ the new interaction handler
+ */
+ void setHandler(const css::uno::Reference< css::task::XInteractionHandler >& xHandler);
+
+
+ /**
+ @short instead of setting an outside interaction handler, this method
+ make sure the default UUI interaction handler of the office is used.
+
+ @note This overwrites the settings of e.g. setHandler()!
+ */
+ void useDefaultUUIHandler();
+
+
+ /**
+ @short add a new interaction to the list of interactions, which
+ must be handled by this helper.
+
+ @descr This method must be called immediately after a new instance of this helper was
+ created. Without such list of InteractionRules, this instances does nothing!
+ On the other side there is no possibility to remove rules.
+ So the same instance can't be used within different transactions.
+ It's a OneWay-object .-)
+
+ @param aInteractionInfo
+ describe the type of interaction, hos often it can be called etcpp.
+
+ @threadsafe yes
+ */
+ void addInteractionRule(const PreventDuplicateInteraction::InteractionInfo& aInteractionInfo);
+
+
+ /**
+ @short return the info struct for the specified interaction.
+
+ @param aInteraction
+ specify the interaction.
+
+ @param pReturn
+ provides information about:
+ - the count how often this interaction was handled during the
+ lifetime of this helper.
+ - the interaction itself, so it can be analyzed further
+
+ @return [boolean]
+ true if the queried interaction could be found.
+ false otherwise.
+
+ @threadsafe yes
+ */
+ bool getInteractionInfo(const css::uno::Type& aInteraction,
+ PreventDuplicateInteraction::InteractionInfo* pReturn ) const;
+};
+
+} // namespace sfx2
+
+#endif // INCLUDED_FRAMEWORK_PREVENTDUPLICATEINTERACTION_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
new file mode 100644
index 000000000..3ee34eabc
--- /dev/null
+++ b/sfx2/inc/recentdocsview.hxx
@@ -0,0 +1,112 @@
+/* -*- 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 <sfx2/thumbnailview.hxx>
+#include <vcl/bitmapex.hxx>
+
+#include <o3tl/typed_flags_set.hxx>
+
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+class INetURLObject;
+struct ImplSVEvent;
+namespace com::sun::star::frame { class XDispatch; }
+
+namespace sfx2
+{
+
+class RecentDocsView;
+
+struct LoadRecentFile
+{
+ css::util::URL aTargetURL;
+ css::uno::Sequence< css::beans::PropertyValue > aArgSeq;
+ css::uno::Reference< css::frame::XDispatch > xDispatch;
+ RecentDocsView* pView;
+};
+
+enum class ApplicationType
+{
+ TYPE_NONE = 0,
+ TYPE_WRITER = 1 << 0,
+ TYPE_CALC = 1 << 1,
+ TYPE_IMPRESS = 1 << 2,
+ TYPE_DRAW = 1 << 3,
+ TYPE_DATABASE = 1 << 4,
+ TYPE_MATH = 1 << 5,
+ TYPE_OTHER = 1 << 6
+};
+
+} // namespace sfx2
+
+namespace o3tl {
+
+template<> struct typed_flags<sfx2::ApplicationType> : is_typed_flags<sfx2::ApplicationType, 0x7f> {};
+
+} // namespace o3tl
+
+namespace sfx2
+{
+
+class RecentDocsView final : public ThumbnailView
+{
+public:
+ RecentDocsView(std::unique_ptr<weld::ScrolledWindow> xWindow, std::unique_ptr<weld::Menu> xMenu);
+ virtual ~RecentDocsView() override;
+
+ void insertItem(const OUString &rURL, const OUString &rTitle, const OUString& rThumbnail, bool isReadOnly, sal_uInt16 nId);
+
+ static bool typeMatchesExtension(ApplicationType type, std::u16string_view rExt);
+
+ ApplicationType mnFileTypes;
+
+ virtual void Clear() override;
+
+ /// Update the information in the view.
+ virtual void Reload() override;
+
+ // launch load of recently used file
+ void PostLoadRecentUsedFile(LoadRecentFile* pLoadRecentFile);
+
+ // received on load of recently used file
+ void DispatchedLoadRecentUsedFile();
+
+private:
+ virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
+
+ virtual bool MouseButtonUp( const MouseEvent& rMEvt ) override;
+
+ virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
+
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+
+ virtual void LoseFocus() override;
+
+ bool isAcceptedFile(const INetURLObject& rURL) const;
+
+ DECL_LINK( ExecuteHdl_Impl, void*, void );
+
+ tools::Long mnItemMaxSize;
+ size_t mnLastMouseDownItem;
+
+ /// Image that appears when there is no recent document.
+ BitmapEx maWelcomeImage;
+ OUString maWelcomeLine1;
+ OUString maWelcomeLine2;
+
+ sfx2::LoadRecentFile* mpLoadRecentFile;
+ ImplSVEvent* m_nExecuteHdlId;
+};
+
+} // namespace sfx2
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/saveastemplatedlg.hxx b/sfx2/inc/saveastemplatedlg.hxx
new file mode 100644
index 000000000..a4df61853
--- /dev/null
+++ b/sfx2/inc/saveastemplatedlg.hxx
@@ -0,0 +1,58 @@
+/* -*- 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_INC_SAVEASTEMPLATEDLG_HXX
+#define INCLUDED_SFX2_INC_SAVEASTEMPLATEDLG_HXX
+
+#include <sal/config.h>
+#include <sfx2/doctempl.hxx>
+#include <vcl/weld.hxx>
+
+#include <com/sun/star/frame/XModel.hpp>
+
+// class SfxSaveAsTemplateDialog -------------------------------------------------------------------
+class SfxSaveAsTemplateDialog final : public weld::GenericDialogController
+{
+private:
+ std::unique_ptr<weld::TreeView> m_xLBCategory;
+ std::unique_ptr<weld::CheckButton> m_xCBXDefault;
+ std::unique_ptr<weld::Entry> m_xTemplateNameEdit;
+ std::unique_ptr<weld::Button> m_xOKButton;
+
+ OUString msSelectedCategory;
+ OUString msTemplateName;
+ sal_uInt16 mnRegionPos;
+
+ std::vector<OUString> msCategories;
+
+ SfxDocumentTemplates maDocTemplates;
+
+ css::uno::Reference<css::frame::XModel> m_xModel;
+
+public:
+ DECL_LINK(OkClickHdl, weld::Button&, void);
+ DECL_LINK(TemplateNameEditHdl, weld::Entry&, void);
+ DECL_LINK(SelectCategoryHdl, weld::TreeView&, void);
+
+ void initialize();
+ void SetCategoryLBEntries(const std::vector<OUString>& names);
+
+ /*Check whether template name is unique or not in a region*/
+ bool IsTemplateNameUnique();
+
+ bool SaveTemplate();
+
+public:
+ SfxSaveAsTemplateDialog(weld::Window* pParent,
+ const css::uno::Reference<css::frame::XModel>& rModel);
+};
+
+#endif // INCLUDED_SFX2_INC_SAVEASTEMPLATEDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sfxbasecontroller_internal.hxx b/sfx2/inc/sfxbasecontroller_internal.hxx
new file mode 100644
index 000000000..0de26d5e9
--- /dev/null
+++ b/sfx2/inc/sfxbasecontroller_internal.hxx
@@ -0,0 +1,19 @@
+/* -*- 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_INC_SFXBASECONTROLLER_INTERNAL_HXX
+#define INCLUDED_SFX2_INC_SFXBASECONTROLLER_INTERNAL_HXX
+
+#include <sal/types.h>
+
+extern sal_uInt32 Get10ThSec();
+
+#endif // INCLUDED_SFX2_INC_SFXBASECONTROLLER_INTERNAL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/ContextChangeBroadcaster.hxx b/sfx2/inc/sidebar/ContextChangeBroadcaster.hxx
new file mode 100644
index 000000000..49770da76
--- /dev/null
+++ b/sfx2/inc/sidebar/ContextChangeBroadcaster.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_INC_SIDEBAR_CONTEXTCHANGEBROADCASTER_HXX
+#define INCLUDED_SFX2_INC_SIDEBAR_CONTEXTCHANGEBROADCASTER_HXX
+
+#include <com/sun/star/frame/XFrame.hpp>
+
+
+namespace sfx2::sidebar {
+
+
+/** This class is a helper for broadcasting context changes that are
+ tied to shells being activated or deactivated.
+*/
+class ContextChangeBroadcaster
+{
+public:
+ ContextChangeBroadcaster();
+ ~ContextChangeBroadcaster();
+
+ void Initialize (const OUString& rsContextName);
+
+ void Activate (const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ void Deactivate (const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ /** Enable or disable the broadcaster.
+ @param bIsEnabled
+ The new value of the "enabled" state.
+ @return
+ The old value of the "enabled" state is returned.
+ */
+ bool SetBroadcasterEnabled (const bool bIsEnabled);
+
+private:
+ OUString msContextName;
+ bool mbIsBroadcasterEnabled;
+
+ void BroadcastContextChange (
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const OUString& rsModuleName,
+ const OUString& rsContextName);
+ static OUString GetModuleName (
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+};
+
+
+} // end of namespace ::sd::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/ContextList.hxx b/sfx2/inc/sidebar/ContextList.hxx
new file mode 100644
index 000000000..b3ecafa53
--- /dev/null
+++ b/sfx2/inc/sidebar/ContextList.hxx
@@ -0,0 +1,66 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <sfx2/sidebar/Context.hxx>
+#include <rtl/ustring.hxx>
+
+#include <vector>
+
+namespace sfx2::sidebar {
+
+/** Per context data for deck and panel descriptors.
+*/
+class ContextList
+{
+public:
+ ContextList();
+
+ class Entry
+ {
+ public:
+ Context maContext;
+ bool mbIsInitiallyVisible;
+ OUString msMenuCommand;
+ };
+
+ /** Return <TRUE/> when the given context matches any of the stored contexts.
+ */
+ const Entry* GetMatch (
+ const Context& rContext) const;
+ Entry* GetMatch (
+ const Context& rContext);
+
+ void AddContextDescription (
+ const Context& rContext,
+ const bool bIsInitiallyVisible,
+ const OUString& rsMenuCommand);
+
+ void ToggleVisibilityForContext( const Context& rContext,const bool bIsInitiallyVisible );
+ const ::std::vector<Entry>& GetEntries() const {return maEntries;};
+
+private:
+ ::std::vector<Entry> maEntries;
+
+ ::std::vector<Entry>::const_iterator FindBestMatch (const Context& rContext) const;
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/ControllerFactory.hxx b/sfx2/inc/sidebar/ControllerFactory.hxx
new file mode 100644
index 000000000..8d45a2e3b
--- /dev/null
+++ b/sfx2/inc/sidebar/ControllerFactory.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 .
+ */
+#pragma once
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <vcl/toolbox.hxx>
+
+namespace com::sun::star::awt { class XWindow; }
+namespace com::sun::star::frame { class XController; }
+namespace com::sun::star::frame { class XFrame; }
+namespace com::sun::star::frame { class XToolbarController; }
+
+class ToolBox;
+
+namespace weld {
+ class Builder;
+ class Toolbar;
+}
+
+namespace sfx2::sidebar {
+
+/** Convenience class for the easy creation of toolbox controllers.
+*/
+class ControllerFactory
+{
+public:
+ static css::uno::Reference<css::frame::XToolbarController> CreateToolBoxController(
+ ToolBox* pToolBox,
+ const ToolBoxItemId nItemId,
+ const OUString& rsCommandName,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const css::uno::Reference<css::frame::XController>& rxController,
+ const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
+ const sal_Int32 nItemWidth, bool bSideBar);
+
+ static css::uno::Reference<css::frame::XToolbarController> CreateToolBoxController(
+ weld::Toolbar& rToolbar,
+ weld::Builder& rBuilder,
+ const OUString& rsCommandName,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const css::uno::Reference<css::frame::XController>& rxController,
+ bool bSideBar);
+
+private:
+ static css::uno::Reference<css::frame::XToolbarController> CreateToolBarController(
+ const css::uno::Reference<css::awt::XWindow>& rToolbar,
+ const OUString& rsCommandName,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const css::uno::Reference<css::frame::XController>& rxController,
+ const sal_Int32 nWidth, bool bSideBar);
+};
+
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/DeckDescriptor.hxx b/sfx2/inc/sidebar/DeckDescriptor.hxx
new file mode 100644
index 000000000..5381b4ea2
--- /dev/null
+++ b/sfx2/inc/sidebar/DeckDescriptor.hxx
@@ -0,0 +1,53 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <sidebar/ContextList.hxx>
+
+#include <sfx2/sidebar/Deck.hxx>
+
+namespace sfx2::sidebar
+{
+class DeckDescriptor
+{
+public:
+ OUString msTitle;
+ OUString msId;
+ OUString msIconURL;
+ OUString msHighContrastIconURL;
+ OUString msTitleBarIconURL;
+ OUString msHighContrastTitleBarIconURL;
+ OUString msHelpText;
+ ContextList maContextList;
+ bool mbIsEnabled;
+ sal_Int32 mnOrderIndex;
+ bool mbExperimental;
+
+ OUString msNodeName; // some impress deck nodes names are different from their Id
+
+ VclPtr<Deck> mpDeck;
+
+ DeckDescriptor();
+ DeckDescriptor(const DeckDescriptor& rOther);
+ ~DeckDescriptor();
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/DeckLayouter.hxx b/sfx2/inc/sidebar/DeckLayouter.hxx
new file mode 100644
index 000000000..a40868f45
--- /dev/null
+++ b/sfx2/inc/sidebar/DeckLayouter.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/.
+ *
+ * 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 .
+ */
+#pragma once
+
+#include <sfx2/sidebar/Panel.hxx>
+
+namespace tools { class Rectangle; }
+
+namespace sfx2::sidebar {
+
+class DeckTitleBar;
+class SidebarDockingWindow;
+
+/** Helper for layouting the direct and indirect children of a
+ deck like title bars, panels, and scroll bars.
+*/
+namespace DeckLayouter
+{
+ void LayoutDeck (
+ const SidebarDockingWindow* pDockingWindow,
+ const tools::Rectangle& rContentArea,
+ sal_Int32& rMinimalWidth,
+ sal_Int32& rMinimalHeight,
+ SharedPanelContainer& rPanels,
+ DeckTitleBar& pDeckTitleBar,
+ weld::ScrolledWindow& pVerticalScrollBar);
+}
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/DeckTitleBar.hxx b/sfx2/inc/sidebar/DeckTitleBar.hxx
new file mode 100644
index 000000000..7ed23a8bf
--- /dev/null
+++ b/sfx2/inc/sidebar/DeckTitleBar.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/.
+ *
+ * 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 .
+ */
+#pragma once
+
+#include <sidebar/TitleBar.hxx>
+#include <vcl/customweld.hxx>
+
+namespace sfx2::sidebar
+{
+class Deck;
+class GripWidget;
+
+class DeckTitleBar final : public TitleBar
+{
+public:
+ DeckTitleBar(const OUString& rsTitle, weld::Builder& rBuilder,
+ const std::function<void()>& rCloserAction);
+ virtual ~DeckTitleBar() override;
+
+ virtual void SetTitle(const OUString& rsTitle) override;
+ virtual OUString GetTitle() const override;
+
+ void SetCloserVisible(const bool bIsCloserVisible);
+ tools::Rectangle GetDragArea() const;
+
+ virtual void DataChanged() override;
+
+private:
+ virtual void HandleToolBoxItemClick() override;
+
+ std::unique_ptr<GripWidget> mxGripWidget;
+ std::unique_ptr<weld::CustomWeld> mxGripWeld;
+ std::unique_ptr<weld::Label> mxLabel;
+
+ const std::function<void()> maCloserAction;
+ bool mbIsCloserVisible;
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/PanelDescriptor.hxx b/sfx2/inc/sidebar/PanelDescriptor.hxx
new file mode 100644
index 000000000..1033379f7
--- /dev/null
+++ b/sfx2/inc/sidebar/PanelDescriptor.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/.
+ *
+ * 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 .
+ */
+#pragma once
+
+#include <sidebar/ContextList.hxx>
+
+namespace sfx2::sidebar {
+
+class PanelDescriptor
+{
+public:
+ OUString msTitle;
+ bool mbIsTitleBarOptional;
+ OUString msId;
+ OUString msDeckId;
+ OUString msTitleBarIconURL;
+ OUString msHighContrastTitleBarIconURL;
+ ContextList maContextList;
+ OUString msImplementationURL;
+ sal_Int32 mnOrderIndex;
+ bool mbShowForReadOnlyDocuments;
+ bool mbWantsCanvas;
+ bool mbWantsAWT;
+ bool mbExperimental;
+
+ OUString msNodeName; // some impress panel nodes names are different from their Id
+
+ PanelDescriptor();
+ PanelDescriptor (const PanelDescriptor& rPanelDescriptor);
+ ~PanelDescriptor();
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/PanelTitleBar.hxx b/sfx2/inc/sidebar/PanelTitleBar.hxx
new file mode 100644
index 000000000..308a0c8f9
--- /dev/null
+++ b/sfx2/inc/sidebar/PanelTitleBar.hxx
@@ -0,0 +1,69 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <sidebar/TitleBar.hxx>
+#include <com/sun/star/frame/XToolbarController.hpp>
+
+namespace com::sun::star::frame { class XController; }
+namespace com::sun::star::frame { class XFrame; }
+
+namespace sfx2::sidebar {
+
+class Panel;
+
+class PanelTitleBar final : public TitleBar
+{
+public:
+ PanelTitleBar(const OUString& rsTitle, weld::Builder& rBuilder, Panel* pPanel);
+ virtual ~PanelTitleBar() override;
+
+ virtual void SetTitle (const OUString& rsTitle) override;
+ virtual OUString GetTitle() const override;
+
+ void SetMoreOptionsCommand(const OUString& rsCommandName,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const css::uno::Reference<css::frame::XController>& rxController);
+
+ void UpdateExpandedState();
+
+ weld::Expander& GetExpander()
+ {
+ return *mxExpander;
+ }
+
+ const OUString& GetMoreOptionsCommand() const { return msMoreOptionsCommand; }
+
+private:
+ virtual void HandleToolBoxItemClick() override;
+
+ DECL_LINK(ExpandHdl, weld::Expander&, void);
+
+ std::unique_ptr<weld::Expander> mxExpander;
+
+ css::uno::Reference<css::frame::XToolbarController> mxController;
+
+ Panel* mpPanel;
+ OString msIdent;
+ OUString msMoreOptionsCommand;
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/SidebarToolBox.hxx b/sfx2/inc/sidebar/SidebarToolBox.hxx
new file mode 100644
index 000000000..acae7475e
--- /dev/null
+++ b/sfx2/inc/sidebar/SidebarToolBox.hxx
@@ -0,0 +1,82 @@
+/* -*- 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_SIDEBAR_SIDEBARTOOLBOX_HXX
+#define INCLUDED_SFX2_SIDEBAR_SIDEBARTOOLBOX_HXX
+
+#include <vcl/builder.hxx>
+#include <vcl/toolbox.hxx>
+#include <map>
+
+namespace com::sun::star::frame { class XToolbarController; }
+
+namespace sfx2::sidebar {
+
+/** The sidebar tool box has two responsibilities:
+ 1. Coordinated location, size, and other states with its parent
+ background window.
+ 2. Create and handle tool bar controller for its items.
+*/
+class SidebarToolBox : public ToolBox
+{
+public:
+ SidebarToolBox(vcl::Window* pParentWindow);
+ virtual ~SidebarToolBox() override;
+ virtual void dispose() override;
+
+ virtual ToolBoxButtonSize GetDefaultButtonSize() const;
+
+ using ToolBox::InsertItem;
+ virtual void InsertItem(const OUString& rCommand,
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ ToolBoxItemBits nBits,
+ const Size& rRequestedSize,
+ ImplToolItems::size_type nPos = APPEND) override;
+
+ virtual bool EventNotify(NotifyEvent& rEvent) override;
+ virtual void KeyInput( const KeyEvent& rKEvt ) override;
+
+ void InitToolBox(VclBuilder::stringmap& rMap);
+
+protected:
+ typedef std::map<ToolBoxItemId, css::uno::Reference<css::frame::XToolbarController>> ControllerContainer;
+ ControllerContainer maControllers;
+ bool mbAreHandlersRegistered;
+ bool mbUseDefaultButtonSize;
+ bool mbSideBar;
+
+ DECL_LINK(DropDownClickHandler, ToolBox*, void);
+ DECL_LINK(ClickHandler, ToolBox*, void);
+ DECL_LINK(DoubleClickHandler, ToolBox*, void);
+ DECL_LINK(SelectHandler, ToolBox*, void);
+ DECL_LINK(ChangedIconSizeHandler, LinkParamNone*, void );
+
+ css::uno::Reference<css::frame::XToolbarController> GetControllerForItemId(const ToolBoxItemId nItemId) const;
+
+ void CreateController(const ToolBoxItemId nItemId,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const sal_Int32 nItemWidth, bool bSideBar);
+ void RegisterHandlers();
+};
+
+
+} // end of namespace sfx2::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/TitleBar.hxx b/sfx2/inc/sidebar/TitleBar.hxx
new file mode 100644
index 000000000..1f589508d
--- /dev/null
+++ b/sfx2/inc/sidebar/TitleBar.hxx
@@ -0,0 +1,70 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <sfx2/sidebar/Theme.hxx>
+#include <vcl/weld.hxx>
+
+namespace sfx2::sidebar {
+
+class TitleBar
+{
+public:
+ TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem);
+ virtual ~TitleBar();
+
+ virtual void SetTitle (const OUString& rsTitle) = 0;
+ virtual OUString GetTitle() const = 0;
+
+ virtual void DataChanged();
+
+ void Show(bool bShow);
+ bool GetVisible() const;
+
+ Size get_preferred_size() const;
+
+ void SetIcon(const css::uno::Reference<css::graphic::XGraphic>& rIcon);
+
+ weld::Toolbar& GetToolBox()
+ {
+ return *mxToolBox;
+ }
+ const weld::Toolbar& GetToolBox() const
+ {
+ return *mxToolBox;
+ }
+
+protected:
+ weld::Builder& mrBuilder;
+ std::unique_ptr<weld::Box> mxTitlebar;
+ std::unique_ptr<weld::Image> mxAddonImage;
+ std::unique_ptr<weld::Toolbar> mxToolBox;
+ Theme::ThemeItem meThemeItem;
+
+ virtual void HandleToolBoxItemClick() = 0;
+
+ DECL_LINK(SelectionHandler, const OString&, void);
+
+private:
+ void SetBackground();
+};
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/Tools.hxx b/sfx2/inc/sidebar/Tools.hxx
new file mode 100644
index 000000000..fb3dc54b4
--- /dev/null
+++ b/sfx2/inc/sidebar/Tools.hxx
@@ -0,0 +1,56 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <vcl/image.hxx>
+
+#include <com/sun/star/util/URL.hpp>
+
+namespace com::sun::star::frame { class XController; }
+namespace com::sun::star::frame { class XDispatch; }
+namespace com::sun::star::frame { class XFrame; }
+
+
+namespace sfx2::sidebar {
+
+class Tools
+{
+public:
+ static css::uno::Reference<css::graphic::XGraphic> GetImage(
+ const OUString& rsImageURL,
+ const OUString& rsHighContrastImageURL,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ static css::uno::Reference<css::graphic::XGraphic> GetImage(
+ const OUString& rsURL,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ static css::util::URL GetURL (const OUString& rsCommand);
+ static css::uno::Reference<css::frame::XDispatch> GetDispatch (
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ const css::util::URL& rURL);
+
+ static OUString GetModuleName (
+ const css::uno::Reference<css::frame::XController>& rxFrame);
+};
+
+
+} // end of namespace sfx2::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/UnoDeck.hxx b/sfx2/inc/sidebar/UnoDeck.hxx
new file mode 100644
index 000000000..42c975c44
--- /dev/null
+++ b/sfx2/inc/sidebar/UnoDeck.hxx
@@ -0,0 +1,62 @@
+/* -*- 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 <com/sun/star/ui/XDeck.hpp>
+
+#include <cppuhelper/implbase.hxx>
+
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+namespace com::sun::star::frame { class XFrame; }
+namespace com::sun::star::ui { class XPanels; }
+namespace sfx2::sidebar { class SidebarController; }
+
+/** get the decks
+*/
+class SfxUnoDeck final : public cppu::WeakImplHelper<css::ui::XDeck>
+{
+
+public:
+
+ SfxUnoDeck(const css::uno::Reference<css::frame::XFrame>& , const OUString&);
+
+ virtual OUString SAL_CALL getId() override;
+
+ virtual OUString SAL_CALL getTitle() override;
+ virtual void SAL_CALL setTitle( const OUString& newTitle ) override;
+
+ virtual sal_Bool SAL_CALL isActive() override;
+ virtual void SAL_CALL activate( const sal_Bool bActivate ) override;
+
+ virtual css::uno::Reference<css::ui::XPanels> SAL_CALL getPanels() override;
+
+ virtual sal_Int32 SAL_CALL getOrderIndex() override;
+ virtual void SAL_CALL setOrderIndex( const sal_Int32 newOrderIndex ) override;
+ virtual void SAL_CALL moveFirst() override;
+ virtual void SAL_CALL moveLast() override;
+ virtual void SAL_CALL moveUp() override;
+ virtual void SAL_CALL moveDown() override;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+ const OUString mDeckId;
+
+ sal_Int32 GetMaxOrderIndex(const sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer& rDecks);
+ sal_Int32 GetMinOrderIndex(const sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer& rDecks);
+
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/UnoDecks.hxx b/sfx2/inc/sidebar/UnoDecks.hxx
new file mode 100644
index 000000000..95ce0be62
--- /dev/null
+++ b/sfx2/inc/sidebar/UnoDecks.hxx
@@ -0,0 +1,54 @@
+/* -*- 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 <com/sun/star/ui/XDecks.hpp>
+
+#include <cppuhelper/implbase.hxx>
+
+namespace com::sun::star::frame { class XFrame; }
+namespace sfx2::sidebar { class SidebarController; }
+
+/** get the decks
+*/
+class SfxUnoDecks final : public cppu::WeakImplHelper<css::ui::XDecks>
+{
+
+public:
+
+ SfxUnoDecks(const css::uno::Reference<css::frame::XFrame>&);
+
+// XNameAccess
+
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
+
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
+
+// XIndexAccess
+
+ virtual sal_Int32 SAL_CALL getCount() override;
+
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
+
+// XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() override;
+ virtual sal_Bool SAL_CALL hasElements() override;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/UnoPanel.hxx b/sfx2/inc/sidebar/UnoPanel.hxx
new file mode 100644
index 000000000..4e148befd
--- /dev/null
+++ b/sfx2/inc/sidebar/UnoPanel.hxx
@@ -0,0 +1,69 @@
+/* -*- 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 <com/sun/star/ui/XPanel.hpp>
+
+
+#include <cppuhelper/implbase.hxx>
+
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/Deck.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+namespace com::sun::star::awt { class XWindow; }
+namespace com::sun::star::frame { class XFrame; }
+namespace sfx2::sidebar { class SidebarController; }
+
+
+/** get the Panel
+*/
+class SfxUnoPanel final : public cppu::WeakImplHelper<css::ui::XPanel>
+{
+
+public:
+
+ SfxUnoPanel(const css::uno::Reference<css::frame::XFrame>& , const OUString&, const OUString&);
+
+ virtual OUString SAL_CALL getId() override;
+
+ virtual OUString SAL_CALL getTitle() override;
+ virtual void SAL_CALL setTitle( const OUString& newTitle ) override;
+
+ virtual sal_Bool SAL_CALL isExpanded() override;
+ virtual void SAL_CALL expand( const sal_Bool bCollapseOther ) override;
+ virtual void SAL_CALL collapse( ) override;
+
+ virtual sal_Int32 SAL_CALL getOrderIndex() override;
+ virtual void SAL_CALL setOrderIndex( const sal_Int32 newOrderIndex ) override;
+ virtual void SAL_CALL moveFirst() override;
+ virtual void SAL_CALL moveLast() override;
+ virtual void SAL_CALL moveUp() override;
+ virtual void SAL_CALL moveDown() override;
+
+ virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getDialog() override;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+ const OUString mPanelId;
+ const OUString mDeckId;
+
+ VclPtr<sfx2::sidebar::Deck> mpDeck;
+ std::weak_ptr<sfx2::sidebar::Panel> mxPanel;
+
+ sal_Int32 GetMaxOrderIndex(const sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer& rPanels);
+ sal_Int32 GetMinOrderIndex(const sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer& rPanels);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/UnoPanels.hxx b/sfx2/inc/sidebar/UnoPanels.hxx
new file mode 100644
index 000000000..487043dee
--- /dev/null
+++ b/sfx2/inc/sidebar/UnoPanels.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/.
+ */
+#pragma once
+
+
+#include <com/sun/star/ui/XPanels.hpp>
+
+#include <cppuhelper/implbase.hxx>
+
+namespace com::sun::star::frame { class XFrame; }
+namespace sfx2::sidebar { class SidebarController; }
+
+/** get the decks
+*/
+class SfxUnoPanels final : public cppu::WeakImplHelper<css::ui::XPanels>
+{
+
+public:
+
+ SfxUnoPanels(const css::uno::Reference<css::frame::XFrame>& , const OUString&);
+
+// XPanels
+ virtual OUString SAL_CALL getDeckId() override;
+
+// XNameAccess
+
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
+
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
+
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
+
+// XIndexAccess
+
+ virtual sal_Int32 SAL_CALL getCount() override;
+
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
+
+// XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() override;
+ virtual sal_Bool SAL_CALL hasElements() override;
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+ const OUString& mDeckId;
+
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sidebar/UnoSidebar.hxx b/sfx2/inc/sidebar/UnoSidebar.hxx
new file mode 100644
index 000000000..20ffa22b1
--- /dev/null
+++ b/sfx2/inc/sidebar/UnoSidebar.hxx
@@ -0,0 +1,54 @@
+/* -*- 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_SIDEBAR_SIDEBAR_HXX
+#define INCLUDED_SFX2_SIDEBAR_SIDEBAR_HXX
+
+#include <com/sun/star/ui/XSidebarProvider.hpp>
+
+#include <cppuhelper/implbase.hxx>
+
+namespace com::sun::star::frame { class XFrame; }
+namespace com::sun::star::ui { class XDecks; }
+namespace com::sun::star::ui { class XSidebar; }
+namespace sfx2::sidebar { class SidebarController; }
+
+/** get the sidebar for a given frame
+*/
+class SfxUnoSidebar final : public cppu::WeakImplHelper<css::ui::XSidebarProvider>
+{
+
+private:
+
+ const css::uno::Reference<css::frame::XFrame> xFrame;
+ sfx2::sidebar::SidebarController* getSidebarController();
+
+public:
+
+ SfxUnoSidebar(const css::uno::Reference<css::frame::XFrame>&);
+
+ virtual void SAL_CALL showDecks (const sal_Bool bVisible) override;
+
+
+ virtual void SAL_CALL setVisible (const sal_Bool bVisible) override;
+
+ virtual sal_Bool SAL_CALL isVisible() override;
+
+ virtual css::uno::Reference<css::frame::XFrame> SAL_CALL getFrame() override;
+
+ virtual css::uno::Reference<css::ui::XDecks> SAL_CALL getDecks() override;
+
+ virtual css::uno::Reference<css::ui::XSidebar> SAL_CALL getSidebar() override;
+
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx
new file mode 100644
index 000000000..d67d89062
--- /dev/null
+++ b/sfx2/inc/sorgitm.hxx
@@ -0,0 +1,44 @@
+/* -*- 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_SORGITM_HXX
+#define INCLUDED_SFX2_INC_SORGITM_HXX
+
+#include <svl/stritem.hxx>
+
+// class SfxScriptOrganizerItem ---------------------------------------------
+
+class SfxScriptOrganizerItem final : public SfxStringItem
+{
+private:
+ OUString aLanguage;
+
+public:
+ static SfxPoolItem* CreateDefault();
+ SfxScriptOrganizerItem();
+
+ virtual SfxScriptOrganizerItem* 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;
+ const OUString& getLanguage() const { return aLanguage; };
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
new file mode 100644
index 000000000..3d8317477
--- /dev/null
+++ b/sfx2/inc/srchdlg.hxx
@@ -0,0 +1,73 @@
+/* -*- 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_SRCHDLG_HXX
+#define INCLUDED_SFX2_INC_SRCHDLG_HXX
+
+#include <vcl/weld.hxx>
+
+namespace sfx2 {
+
+
+// SearchDialog
+
+
+class SearchDialog final : public weld::GenericDialogController
+{
+private:
+ Link<SearchDialog&,void> m_aFindHdl;
+ Link<LinkParamNone*,void> m_aCloseHdl;
+
+ OUString m_sConfigName;
+
+ std::unique_ptr<weld::ComboBox> m_xSearchEdit;
+ std::unique_ptr<weld::CheckButton> m_xWholeWordsBox;
+ std::unique_ptr<weld::CheckButton> m_xMatchCaseBox;
+ std::unique_ptr<weld::CheckButton> m_xWrapAroundBox;
+ std::unique_ptr<weld::CheckButton> m_xBackwardsBox;
+ std::unique_ptr<weld::Button> m_xFindBtn;
+
+ void LoadConfig();
+ void SaveConfig();
+
+ DECL_LINK(FindHdl, weld::Button&, void);
+
+public:
+ SearchDialog(weld::Window* pWindow, const OUString& rConfigName);
+ static void runAsync(const std::shared_ptr<SearchDialog>& rController);
+ virtual ~SearchDialog() override;
+
+ void SetFindHdl( const Link<SearchDialog&,void>& rLink ) { m_aFindHdl = rLink; }
+ void SetCloseHdl( const Link<LinkParamNone*,void>& rLink ) { m_aCloseHdl = rLink; }
+
+ OUString GetSearchText() const { return m_xSearchEdit->get_active_text(); }
+ void SetSearchText( const OUString& _rText ) { m_xSearchEdit->set_entry_text( _rText ); }
+ bool IsOnlyWholeWords() const { return m_xWholeWordsBox->get_active(); }
+ bool IsMarchCase() const { return m_xMatchCaseBox->get_active(); }
+ bool IsWrapAround() const { return m_xWrapAroundBox->get_active(); }
+ bool IsSearchBackwards() const { return m_xBackwardsBox->get_active(); }
+
+ void SetFocusOnEdit();
+};
+
+} // namespace sfx2
+
+
+#endif // INCLUDED_SFX2_INC_SRCHDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/strings.hxx b/sfx2/inc/strings.hxx
new file mode 100644
index 000000000..67df9d7df
--- /dev/null
+++ b/sfx2/inc/strings.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include <rtl/ustring.hxx>
+
+inline constexpr OUStringLiteral STR_HTML_GENERATOR
+ = u"%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION (%1)";
+
+// Do not translate STR_TEMPLATE_NAME*_DEF names!!
+// STR_TEMPLATE_NAME*_DEF strings must EXACTLY fit dc:title tag in meta.xml of each template file
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME1_DEF = u"Grey Elegant";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME2_DEF = u"Beehive";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME3_DEF = u"Blue Curve";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME4_DEF = u"Blueprint Plans";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME5_DEF = u"Candy";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME6_DEF = u"Yellow Idea";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME7_DEF = u"DNA";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME8_DEF = u"Focus";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME9_DEF = u"Forestbird";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME10_DEF = u"Freshes";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME11_DEF = u"Inspiration";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME12_DEF = u"Lights";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME13_DEF = u"Growing Liberty";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME14_DEF = u"Metropolis";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME15_DEF = u"Midnightblue";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME16_DEF = u"Nature Illustration";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME17_DEF = u"Pencil";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME18_DEF = u"Piano";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME19_DEF = u"Portfolio";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME20_DEF = u"Progress";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME21_DEF = u"Sunset";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME22_DEF = u"Vintage";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME23_DEF = u"Vivid";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME24_DEF = u"CV";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME25_DEF = u"Resume";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME26_DEF = u"Default";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME27_DEF = u"Modern";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME28_DEF = u"Modern business letter sans-serif";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME29_DEF = u"Modern business letter serif";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME30_DEF = u"Businesscard with logo";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME31_DEF = u"Simple";
+inline constexpr OUStringLiteral STR_TEMPLATE_NAME32_DEF = u"BPMN";
+
+inline constexpr OUStringLiteral CMIS_TYPE_STRING = u"String";
+#define CMIS_TYPE_INTEGER "Integer"
+#define CMIS_TYPE_DECIMAL "Decimal"
+#define CMIS_TYPE_DATETIME "Datetime"
+#define CMIS_TYPE_BOOL "Bool"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/inc/templatecontaineritem.hxx b/sfx2/inc/templatecontaineritem.hxx
new file mode 100644
index 000000000..019c1b909
--- /dev/null
+++ b/sfx2/inc/templatecontaineritem.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 <sfx2/templateproperties.hxx>
+
+class TemplateContainerItem final
+{
+public:
+ sal_uInt16 mnId;
+ sal_uInt16 mnRegionId;
+ OUString maTitle;
+ std::vector<TemplateItemProperties> maTemplates;
+
+ TemplateContainerItem(sal_uInt16 nId);
+
+ ~TemplateContainerItem();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/templatedefaultview.hxx b/sfx2/inc/templatedefaultview.hxx
new file mode 100644
index 000000000..1771ad3d8
--- /dev/null
+++ b/sfx2/inc/templatedefaultview.hxx
@@ -0,0 +1,29 @@
+/* -*- 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 <sfx2/templatelocalview.hxx>
+
+class TemplateDefaultView final : public TemplateLocalView
+{
+public:
+ TemplateDefaultView(std::unique_ptr<weld::ScrolledWindow> xWindow,
+ std::unique_ptr<weld::Menu> xMenu);
+
+ virtual void showAllTemplates() override;
+
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
+
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
+
+ void createContextMenu();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/templateviewitem.hxx b/sfx2/inc/templateviewitem.hxx
new file mode 100644
index 000000000..25f73b9d8
--- /dev/null
+++ b/sfx2/inc/templateviewitem.hxx
@@ -0,0 +1,45 @@
+/* -*- 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 <sfx2/thumbnailviewitem.hxx>
+
+class TemplateViewItem final : public ThumbnailViewItem
+{
+public:
+
+ TemplateViewItem(ThumbnailView& rView, sal_uInt16 nId);
+
+ virtual ~TemplateViewItem () override;
+
+ void setPath (const OUString &rPath) { maPath = rPath; }
+
+ const OUString& getPath () const { return maPath; }
+
+ void showDefaultIcon(bool bVal) { mbIsDefaultTemplate = bVal; }
+
+ bool IsDefaultTemplate() const { return mbIsDefaultTemplate; }
+
+ tools::Rectangle getDefaultIconArea() const;
+
+ virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
+ const ThumbnailItemAttributes *pAttrs) override;
+
+ sal_uInt16 mnRegionId;
+ sal_uInt16 mnDocId;
+
+private:
+
+ OUString maPath;
+ BitmapEx maDefaultBitmap;
+ bool mbIsDefaultTemplate;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
new file mode 100644
index 000000000..5dc93943f
--- /dev/null
+++ b/sfx2/inc/unoctitm.hxx
@@ -0,0 +1,153 @@
+/* -*- 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 .
+ */
+#pragma once
+
+#include <memory>
+#include <com/sun/star/frame/XNotifyingDispatch.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/multiinterfacecontainer4.hxx>
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <svl/lstner.hxx>
+#include <sfx2/ctrlitem.hxx>
+#include <mutex>
+
+namespace com::sun::star::frame { class XFrame; }
+namespace com::sun::star::frame { class XNotifyingDispatch; }
+namespace com::sun::star::frame { class XStatusListener; }
+namespace com::sun::star::frame { struct FeatureStateEvent; }
+
+class SfxBindings;
+class SfxDispatcher;
+class SfxSlot;
+
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar4<OUString, css::frame::XStatusListener>
+ SfxStatusDispatcher_Impl_ListenerContainer;
+
+class SfxStatusDispatcher : public cppu::WeakImplHelper<css::frame::XNotifyingDispatch>
+{
+protected:
+ std::mutex maMutex;
+ SfxStatusDispatcher_Impl_ListenerContainer maListeners;
+
+public:
+
+ SfxStatusDispatcher();
+
+ // XDispatch
+ virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArgs,
+ const css::uno::Reference< css::frame::XDispatchResultListener >& rListener ) override;
+ virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
+ virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override;
+ virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override;
+
+ // Something else
+ void ReleaseAll();
+ void sendStatusChanged(const OUString& rURL, const css::frame::FeatureStateEvent& rEvent);
+ std::vector<OUString> getContainedTypes() { std::unique_lock g(maMutex); return maListeners.getContainedTypes(g); };
+};
+
+class SfxSlotServer;
+class SfxDispatchController_Impl;
+class SfxOfficeDispatch final : public cppu::ImplInheritanceHelper<SfxStatusDispatcher, css::lang::XUnoTunnel>
+{
+friend class SfxDispatchController_Impl;
+ std::unique_ptr<SfxDispatchController_Impl> pImpl;
+public:
+ SfxOfficeDispatch( SfxBindings& rBind,
+ SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const css::util::URL& rURL );
+ SfxOfficeDispatch( SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const css::util::URL& rURL );
+ virtual ~SfxOfficeDispatch() override;
+
+ virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArgs,
+ const css::uno::Reference< css::frame::XDispatchResultListener >& rListener ) override;
+ virtual void SAL_CALL dispatch( const css::util::URL& aURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArgs ) override;
+ virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener > & xControl,
+ const css::util::URL& aURL) override;
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override ;
+ static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+
+ static bool IsMasterUnoCommand( const css::util::URL& aURL );
+ static OUString GetMasterUnoCommand( const css::util::URL& aURL );
+
+ void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame);
+
+ void SetMasterUnoCommand( bool bSet );
+
+ SfxDispatcher* GetDispatcher_Impl();
+
+ sal_uInt16 GetId() const;
+};
+
+class SfxDispatchController_Impl final
+ : public SfxControllerItem
+ , public SfxListener
+{
+ css::util::URL aDispatchURL;
+ SfxDispatcher* pDispatcher;
+ SfxBindings* pBindings;
+ const SfxPoolItem* pLastState;
+ SfxOfficeDispatch* pDispatch;
+ bool bMasterSlave;
+ bool bVisible;
+ css::uno::WeakReference< css::frame::XFrame > xFrame;
+
+ static void addParametersToArgs( const css::util::URL& aURL,
+ css::uno::Sequence< css::beans::PropertyValue >& rArgs );
+ static MapUnit GetCoreMetric( SfxItemPool const & rPool, sal_uInt16 nSlot );
+
+ void sendStatusChanged(const OUString& rURL, const css::frame::FeatureStateEvent& rEvent);
+
+public:
+ SfxDispatchController_Impl( SfxOfficeDispatch* pDisp,
+ SfxBindings* pBind,
+ SfxDispatcher* pDispat,
+ const SfxSlot* pSlot,
+ const css::util::URL& rURL );
+ virtual ~SfxDispatchController_Impl() override;
+
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+
+ static OUString getSlaveCommand( const css::util::URL& rURL );
+
+ void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState, SfxSlotServer const * pServ );
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
+ void setMasterSlaveCommand( bool bSet );
+ /// @throws css::uno::RuntimeException
+ void dispatch( const css::util::URL& aURL,
+ const css::uno::Sequence< css::beans::PropertyValue >& aArgs,
+ const css::uno::Reference< css::frame::XDispatchResultListener >& rListener );
+ /// @throws css::uno::RuntimeException
+ void addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL);
+ void UnBindController();
+ SfxDispatcher* GetDispatcher();
+ void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */