summaryrefslogtreecommitdiffstats
path: root/sfx2/source/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/inc')
-rw-r--r--sfx2/source/inc/alienwarn.hxx39
-rw-r--r--sfx2/source/inc/appbaslib.hxx98
-rw-r--r--sfx2/source/inc/appdata.hxx148
-rw-r--r--sfx2/source/inc/appopen.hxx37
-rw-r--r--sfx2/source/inc/asyncfunc.hxx36
-rw-r--r--sfx2/source/inc/childwinimpl.hxx63
-rw-r--r--sfx2/source/inc/ctrlfactoryimpl.hxx58
-rw-r--r--sfx2/source/inc/documentfontsdialog.hxx46
-rw-r--r--sfx2/source/inc/docundomanager.hxx159
-rw-r--r--sfx2/source/inc/eventsupplier.hxx85
-rw-r--r--sfx2/source/inc/fltoptint.hxx62
-rw-r--r--sfx2/source/inc/helper.hxx42
-rw-r--r--sfx2/source/inc/helpids.h48
-rw-r--r--sfx2/source/inc/hintpost.hxx59
-rw-r--r--sfx2/source/inc/itemdel.hxx30
-rw-r--r--sfx2/source/inc/macroloader.hxx86
-rw-r--r--sfx2/source/inc/nochaos.hxx35
-rw-r--r--sfx2/source/inc/objshimp.hxx153
-rw-r--r--sfx2/source/inc/openflag.hxx34
-rw-r--r--sfx2/source/inc/openuriexternally.hxx34
-rw-r--r--sfx2/source/inc/openurlhint.hxx38
-rw-r--r--sfx2/source/inc/partwnd.hxx76
-rw-r--r--sfx2/source/inc/preview.hxx41
-rw-r--r--sfx2/source/inc/recfloat.hxx55
-rw-r--r--sfx2/source/inc/sfxpicklist.hxx42
-rw-r--r--sfx2/source/inc/sfxtypes.hxx53
-rw-r--r--sfx2/source/inc/sfxurlrelocator.hxx52
-rw-r--r--sfx2/source/inc/shellimpl.hxx96
-rw-r--r--sfx2/source/inc/slotserv.hxx59
-rw-r--r--sfx2/source/inc/splitwin.hxx127
-rw-r--r--sfx2/source/inc/statcach.hxx154
-rw-r--r--sfx2/source/inc/templatesearchview.hxx68
-rw-r--r--sfx2/source/inc/templatesearchviewitem.hxx27
-rw-r--r--sfx2/source/inc/templdgi.hxx313
-rw-r--r--sfx2/source/inc/tplcitem.hxx45
-rw-r--r--sfx2/source/inc/versdlg.hxx94
-rw-r--r--sfx2/source/inc/workwin.hxx302
37 files changed, 2994 insertions, 0 deletions
diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx
new file mode 100644
index 000000000..eeda0fedf
--- /dev/null
+++ b/sfx2/source/inc/alienwarn.hxx
@@ -0,0 +1,39 @@
+/* -*- 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_SOURCE_INC_ALIENWARN_HXX
+#define INCLUDED_SFX2_SOURCE_INC_ALIENWARN_HXX
+
+#include <vcl/weld.hxx>
+
+class SfxAlienWarningDialog : public weld::MessageDialogController
+{
+private:
+ std::unique_ptr<weld::Button> m_xKeepCurrentBtn;
+ std::unique_ptr<weld::Button> m_xUseDefaultFormatBtn;
+ std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
+
+public:
+ SfxAlienWarningDialog(weld::Window* pParent, const OUString& _rFormatName,
+ const OUString& _rDefaultExtension, bool rDefaultIsAlien);
+ virtual ~SfxAlienWarningDialog() override;
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_ALIENWARN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx
new file mode 100644
index 000000000..f1ca81d29
--- /dev/null
+++ b/sfx2/source/inc/appbaslib.hxx
@@ -0,0 +1,98 @@
+/* -*- 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_SOURCE_INC_APPBASLIB_HXX
+#define INCLUDED_SFX2_SOURCE_INC_APPBASLIB_HXX
+
+#include <svl/lstner.hxx>
+
+#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <vector>
+
+class BasicManager;
+
+/** helper class which holds and manipulates a BasicManager
+*/
+class SfxBasicManagerHolder
+ : public SfxListener
+{
+private:
+ BasicManager* mpBasicManager;
+ css::uno::Reference< css::script::XStorageBasedLibraryContainer >
+ mxBasicContainer;
+ css::uno::Reference< css::script::XStorageBasedLibraryContainer >
+ mxDialogContainer;
+
+public:
+ SfxBasicManagerHolder();
+
+ enum ContainerType
+ {
+ SCRIPTS, DIALOGS
+ };
+
+ /** returns <TRUE/> if and only if the instance is currently bound to a non-<NULL/>
+ BasicManager.
+ */
+ bool isValid() const { return mpBasicManager != nullptr; }
+
+ /** returns the BasicManager which this instance is currently bound to
+ */
+ BasicManager*
+ get() const { return mpBasicManager; }
+
+ /** binds the instance to the given BasicManager
+ */
+ void reset( BasicManager* _pBasicManager );
+
+ css::script::XLibraryContainer *
+ getLibraryContainer( ContainerType _eType );
+
+ /** calls the storeLibraries at both our script and basic library container
+ */
+ void storeAllLibraries();
+
+ /** calls the setStorage at all our XStorageBasedLibraryContainer.
+ */
+ void setStorage(
+ const css::uno::Reference< css::embed::XStorage >& _rxStorage
+ );
+
+ /** calls the storeLibrariesToStorage at all our XStorageBasedLibraryContainer.
+ */
+ void storeLibrariesToStorage(
+ const css::uno::Reference< css::embed::XStorage >& _rxStorage
+ );
+
+
+ /** checks if any modules in the SfxLibraryContainer exceed the binary
+ limits.
+ */
+ bool LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& sModules );
+
+ virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override;
+
+private:
+ void impl_releaseContainers();
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_APPBASLIB_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
new file mode 100644
index 000000000..b22c59a7d
--- /dev/null
+++ b/sfx2/source/inc/appdata.hxx
@@ -0,0 +1,148 @@
+/* -*- 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_SOURCE_INC_APPDATA_HXX
+#define INCLUDED_SFX2_SOURCE_INC_APPDATA_HXX
+
+#include <config_features.h>
+
+#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <svl/svdde.hxx>
+#include <svtools/ehdl.hxx>
+#include <sfx2/app.hxx>
+#include <o3tl/enumarray.hxx>
+
+#include <bitset.hxx>
+#include <memory>
+#include <vector>
+
+class SfxApplication;
+class SfxPickList;
+class SfxProgress;
+class SfxDdeDocTopic_Impl;
+class DdeService;
+class SfxItemPool;
+class SfxFilterMatcher;
+class ISfxTemplateCommon;
+class SfxFilterMatcher;
+class SfxStatusDispatcher;
+class SfxDdeTriggerTopic_Impl;
+class SfxDocumentTemplates;
+class SfxFrame;
+class SvtSaveOptions;
+class SvtHelpOptions;
+class SfxViewFrame;
+class SfxSlotPool;
+class SfxDispatcher;
+class SfxInterface;
+class BasicManager;
+class SfxBasicManagerHolder;
+class SfxBasicManagerCreationListener;
+
+namespace sfx2 {
+ namespace sidebar { class Theme; }
+}
+
+
+typedef std::vector<SfxDdeDocTopic_Impl*> SfxDdeDocTopics_Impl;
+
+class SfxAppData_Impl
+{
+public:
+ IndexBitSet aIndexBitSet; // for counting noname documents
+ OUString aLastDir; // for IO dialog
+
+ // DDE stuff
+ std::unique_ptr<DdeService> pDdeService;
+ std::unique_ptr<SfxDdeDocTopics_Impl> pDocTopics;
+ std::unique_ptr<SfxDdeTriggerTopic_Impl> pTriggerTopic;
+ std::unique_ptr<DdeService> pDdeService2;
+
+ // single instance classes
+ SfxChildWinFactArr_Impl* pFactArr;
+ std::vector<SfxFrame*> vTopFrames;
+
+ // application members
+ SfxFilterMatcher* pMatcher;
+ SfxErrorHandler *m_pToolsErrorHdl;
+ SfxErrorHandler *m_pSoErrorHdl;
+#if HAVE_FEATURE_SCRIPTING
+ SfxErrorHandler *m_pSbxErrorHdl;
+#endif
+ rtl::Reference<SfxStatusDispatcher> mxAppDispatch;
+ std::unique_ptr<SfxPickList> mxAppPickList;
+ SfxDocumentTemplates* pTemplates;
+
+ // global pointers
+ SfxItemPool* pPool;
+
+ // "current" functionality
+ SfxProgress* pProgress;
+
+ sal_uInt16 nDocModalMode; // counts documents in modal mode
+ sal_uInt16 nRescheduleLocks;
+
+ SfxTbxCtrlFactArr_Impl* pTbxCtrlFac;
+ SfxStbCtrlFactArr_Impl* pStbCtrlFac;
+ SfxViewFrameArr_Impl* pViewFrames;
+ SfxViewShellArr_Impl* pViewShells;
+ SfxObjectShellArr_Impl* pObjShells;
+ std::unique_ptr<SfxBasicManagerHolder>
+ pBasicManager;
+ std::unique_ptr<SfxBasicManagerCreationListener>
+ pBasMgrListener;
+ SfxViewFrame* pViewFrame;
+ SfxSlotPool* pSlotPool;
+ SfxDispatcher* pAppDispat; // Dispatcher if no document
+ ::rtl::Reference<sfx2::sidebar::Theme> m_pSidebarTheme;
+
+ bool bDowning:1; // sal_True on Exit and afterwards
+ bool bInQuit : 1;
+
+ SfxAppData_Impl();
+ ~SfxAppData_Impl();
+
+ SfxDocumentTemplates* GetDocumentTemplates();
+ void DeInitDDE();
+
+ o3tl::enumarray<SfxToolsModule, std::unique_ptr<SfxModule>> aModules;
+
+ /** called when the Application's BasicManager has been created. This can happen
+ explicitly in SfxApplication::GetBasicManager, or implicitly if a document's
+ BasicManager is created before the application's BasicManager exists.
+ */
+ void OnApplicationBasicManagerCreated( BasicManager& _rManager );
+};
+
+class SfxDdeTriggerTopic_Impl : public DdeTopic
+{
+#if defined(_WIN32)
+public:
+ SfxDdeTriggerTopic_Impl()
+ : DdeTopic( "TRIGGER" )
+ {}
+
+ virtual bool Execute( const OUString* ) override { return true; }
+#endif
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_APPDATA_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appopen.hxx b/sfx2/source/inc/appopen.hxx
new file mode 100644
index 000000000..858f14ef8
--- /dev/null
+++ b/sfx2/source/inc/appopen.hxx
@@ -0,0 +1,37 @@
+/* -*- 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_SOURCE_INC_APPOPEN_HXX
+#define INCLUDED_SFX2_SOURCE_INC_APPOPEN_HXX
+
+#include <sal/config.h>
+#include <vcl/errcode.hxx>
+
+class SfxItemPool;
+class SfxMedium;
+class SfxObjectShell;
+
+ErrCode CheckPasswd_Impl( SfxObjectShell* pDoc, SfxMedium* pFile );
+
+void SetTemplate_Impl( const OUString&, const OUString&, SfxObjectShell* );
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/asyncfunc.hxx b/sfx2/source/inc/asyncfunc.hxx
new file mode 100644
index 000000000..708750baa
--- /dev/null
+++ b/sfx2/source/inc/asyncfunc.hxx
@@ -0,0 +1,36 @@
+/* -*- 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_ASYNCFUNC_HXX
+#define INCLUDED_SFX2_ASYNCFUNC_HXX
+
+#include <functional>
+
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/implbase.hxx>
+
+class AsyncFunc final : public cppu::WeakImplHelper<css::lang::XUnoTunnel>
+{
+private:
+ std::function<void()> m_pAsyncFunc;
+
+public:
+ AsyncFunc(const std::function<void()>&);
+ virtual ~AsyncFunc() override;
+
+ void Execute();
+
+ //XUnoTunnel
+ UNO3_GETIMPLEMENTATION_DECL(AsyncFunc)
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx
new file mode 100644
index 000000000..c9211edac
--- /dev/null
+++ b/sfx2/source/inc/childwinimpl.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SFX2_CHILDWINIMPL_HXX
+#define INCLUDED_SFX2_CHILDWINIMPL_HXX
+
+#include <sfx2/childwin.hxx>
+
+#include <vector>
+#include <memory>
+
+class SfxFrame;
+
+class SfxChildWinContextArr_Impl
+{
+ typedef std::vector<std::unique_ptr<SfxChildWinContextFactory> > DataType;
+ DataType maData;
+
+public:
+ size_t size() const;
+ const SfxChildWinContextFactory& operator []( size_t i ) const;
+ SfxChildWinContextFactory& operator []( size_t i );
+ void push_back( std::unique_ptr<SfxChildWinContextFactory> p );
+};
+
+class SfxChildWinFactArr_Impl
+{
+ typedef std::vector<std::unique_ptr<SfxChildWinFactory> > DataType;
+ DataType maData;
+
+public:
+ typedef DataType::iterator iterator;
+ typedef DataType::const_iterator const_iterator;
+
+ size_t size() const;
+ const SfxChildWinFactory& operator []( size_t i ) const;
+ SfxChildWinFactory& operator []( size_t i );
+ void push_back( std::unique_ptr<SfxChildWinFactory> p );
+ void erase( const iterator& it );
+
+ iterator begin();
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/ctrlfactoryimpl.hxx b/sfx2/source/inc/ctrlfactoryimpl.hxx
new file mode 100644
index 000000000..7b91aed7a
--- /dev/null
+++ b/sfx2/source/inc/ctrlfactoryimpl.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/.
+ *
+ * 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_CTRLFACTORYIMPL_HXX
+#define INCLUDED_SFX2_CTRLFACTORYIMPL_HXX
+
+#include <sfx2/stbitem.hxx>
+#include <sfx2/tbxctrl.hxx>
+
+#include <vector>
+
+class SfxStbCtrlFactArr_Impl
+{
+ typedef std::vector<SfxStbCtrlFactory> DataType;
+ DataType maData;
+
+public:
+ const SfxStbCtrlFactory& operator []( size_t i ) const;
+ SfxStbCtrlFactory& operator []( size_t i );
+
+ void push_back( const SfxStbCtrlFactory& );
+
+ size_t size() const;
+};
+
+class SfxTbxCtrlFactArr_Impl
+{
+ typedef std::vector<SfxTbxCtrlFactory> DataType;
+ DataType maData;
+
+public:
+ const SfxTbxCtrlFactory& operator []( size_t i ) const;
+ SfxTbxCtrlFactory& operator []( size_t i );
+
+ void push_back( const SfxTbxCtrlFactory& );
+
+ size_t size() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/documentfontsdialog.hxx b/sfx2/source/inc/documentfontsdialog.hxx
new file mode 100644
index 000000000..408c93ae6
--- /dev/null
+++ b/sfx2/source/inc/documentfontsdialog.hxx
@@ -0,0 +1,46 @@
+/* -*- 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_SOURCE_INC_DOCUMENTFONTSDIALOG_HXX
+#define INCLUDED_SFX2_SOURCE_INC_DOCUMENTFONTSDIALOG_HXX
+
+#include <sfx2/tabdlg.hxx>
+
+/**
+ Tab page for document font settings in the document properties dialog.
+*/
+class SfxDocumentFontsPage: public SfxTabPage
+{
+public:
+ SfxDocumentFontsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& set);
+ virtual ~SfxDocumentFontsPage() override;
+ static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* set);
+protected:
+ virtual bool FillItemSet( SfxItemSet* set ) override;
+ virtual void Reset( const SfxItemSet* set ) override;
+private:
+ std::unique_ptr<weld::CheckButton> embedFontsCheckbox;
+ std::unique_ptr<weld::CheckButton> embedUsedFontsCheckbox;
+ std::unique_ptr<weld::CheckButton> embedLatinScriptFontsCheckbox;
+ std::unique_ptr<weld::CheckButton> embedAsianScriptFontsCheckbox;
+ std::unique_ptr<weld::CheckButton> embedComplexScriptFontsCheckbox;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/docundomanager.hxx b/sfx2/source/inc/docundomanager.hxx
new file mode 100644
index 000000000..ce38680e2
--- /dev/null
+++ b/sfx2/source/inc/docundomanager.hxx
@@ -0,0 +1,159 @@
+/* -*- 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_SOURCE_INC_DOCUNDOMANAGER_HXX
+#define INCLUDED_SFX2_SOURCE_INC_DOCUNDOMANAGER_HXX
+
+#include <sfx2/sfxbasemodel.hxx>
+
+#include <com/sun/star/document/XUndoManager.hpp>
+
+#include <cppuhelper/implbase.hxx>
+#include <vcl/svapp.hxx>
+
+#include <memory>
+
+/** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
+*/
+class SfxModelSubComponent
+{
+public:
+ /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
+ */
+ void MethodEntryCheck()
+ {
+ m_rModel.MethodEntryCheck( true );
+ }
+
+protected:
+ SfxModelSubComponent( SfxBaseModel& i_model )
+ :m_rModel( i_model )
+ {
+ }
+ virtual ~SfxModelSubComponent();
+
+ void acquireModel() { m_rModel.acquire(); }
+ void releaseModel() { m_rModel.release(); }
+
+protected:
+ const SfxBaseModel& getBaseModel() const { return m_rModel; }
+ SfxBaseModel& getBaseModel() { return m_rModel; }
+
+private:
+ SfxBaseModel& m_rModel;
+};
+
+class SfxModelGuard
+{
+public:
+ enum AllowedModelState
+ {
+ // not yet initialized
+ E_INITIALIZING,
+ // fully alive, i.e. initialized, and not yet disposed
+ E_FULLY_ALIVE
+ };
+
+ SfxModelGuard( SfxBaseModel const & i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
+ : m_aGuard()
+ {
+ i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
+ }
+ SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
+ :m_aGuard()
+ {
+ i_rSubComponent.MethodEntryCheck();
+ }
+
+ void clear()
+ {
+ m_aGuard.clear();
+ }
+
+private:
+ SolarMutexClearableGuard m_aGuard;
+};
+
+namespace sfx2
+{
+ //= DocumentUndoManager
+
+ struct DocumentUndoManager_Impl;
+ class DocumentUndoManager :public ::cppu::WeakImplHelper<css::document::XUndoManager>
+ ,public SfxModelSubComponent
+ {
+ friend struct DocumentUndoManager_Impl;
+
+ public:
+ DocumentUndoManager( SfxBaseModel& i_document );
+ virtual ~DocumentUndoManager() override;
+ DocumentUndoManager(const DocumentUndoManager&) = delete;
+ DocumentUndoManager& operator=(const DocumentUndoManager&) = delete;
+
+ void disposing();
+
+ // non-UNO API for our owner
+ /** determines whether we have an open Undo context. No mutex locking within this method, no disposal check - this
+ is the responsibility of the owner.
+ */
+ bool isInContext() const;
+
+ // XInterface
+ virtual void SAL_CALL acquire( ) throw () override;
+ virtual void SAL_CALL release( ) throw () override;
+
+ // XUndoManager
+ virtual void SAL_CALL enterUndoContext( const OUString& i_title ) override;
+ virtual void SAL_CALL enterHiddenUndoContext( ) override;
+ virtual void SAL_CALL leaveUndoContext( ) override;
+ virtual void SAL_CALL addUndoAction( const css::uno::Reference< css::document::XUndoAction >& i_action ) override;
+ virtual void SAL_CALL undo( ) override;
+ virtual void SAL_CALL redo( ) override;
+ virtual sal_Bool SAL_CALL isUndoPossible( ) override;
+ virtual sal_Bool SAL_CALL isRedoPossible( ) override;
+ virtual OUString SAL_CALL getCurrentUndoActionTitle( ) override;
+ virtual OUString SAL_CALL getCurrentRedoActionTitle( ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getAllUndoActionTitles( ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getAllRedoActionTitles( ) override;
+ virtual void SAL_CALL clear( ) override;
+ virtual void SAL_CALL clearRedo( ) override;
+ virtual void SAL_CALL reset( ) override;
+ virtual void SAL_CALL addUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
+ virtual void SAL_CALL removeUndoManagerListener( const css::uno::Reference< css::document::XUndoManagerListener >& i_listener ) override;
+
+ // XLockable, base of XUndoManager
+ virtual void SAL_CALL lock( ) override;
+ virtual void SAL_CALL unlock( ) override;
+ virtual sal_Bool SAL_CALL isLocked( ) override;
+
+ // XChild, base of XUndoManager
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
+ virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
+
+ private:
+ std::unique_ptr< DocumentUndoManager_Impl > m_pImpl;
+ };
+
+
+} // namespace sfx2
+
+
+#endif // INCLUDED_SFX2_SOURCE_INC_DOCUNDOMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx
new file mode 100644
index 000000000..b6d63a09e
--- /dev/null
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -0,0 +1,85 @@
+/* -*- 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_SOURCE_INC_EVENTSUPPLIER_HXX
+#define INCLUDED_SFX2_SOURCE_INC_EVENTSUPPLIER_HXX
+
+#include <sal/types.h>
+
+#include <com/sun/star/document/DocumentEvent.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Type.hxx>
+#include <cppuhelper/implbase.hxx>
+
+namespace comphelper
+{
+ class NamedValueCollection;
+}
+
+class SfxObjectShell;
+class SvxMacro;
+
+
+class SfxEvents_Impl : public ::cppu::WeakImplHelper< css::container::XNameReplace, css::document::XEventListener >
+{
+ css::uno::Sequence< OUString > maEventNames;
+ css::uno::Sequence< css::uno::Any > maEventData;
+ css::uno::Reference< css::document::XEventBroadcaster > mxBroadcaster;
+ ::osl::Mutex maMutex;
+ SfxObjectShell *mpObjShell;
+
+public:
+ SfxEvents_Impl( SfxObjectShell* pShell,
+ css::uno::Reference< css::document::XEventBroadcaster > const & xBroadcaster );
+ virtual ~SfxEvents_Impl() override;
+
+ // --- XNameReplace ---
+ virtual void SAL_CALL replaceByName( const OUString & aName, const css::uno::Any & aElement ) override;
+
+ // --- XNameAccess ( parent of XNameReplace ) ---
+ 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;
+
+ // --- XElementAccess ( parent of XNameAccess ) ---
+ virtual css::uno::Type SAL_CALL getElementType() override;
+ virtual sal_Bool SAL_CALL hasElements() override;
+
+ // --- ::document::XEventListener ---
+ virtual void SAL_CALL notifyEvent( const css::document::EventObject& aEvent ) override;
+
+ // --- ::lang::XEventListener ---
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // convert and normalize
+ static std::unique_ptr<SvxMacro> ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc );
+ static void NormalizeMacro( const css::uno::Any& rIn, css::uno::Any& rOut, SfxObjectShell* pDoc );
+ static void NormalizeMacro(
+ const ::comphelper::NamedValueCollection& i_eventDescriptor,
+ ::comphelper::NamedValueCollection& o_normalizedDescriptor,
+ SfxObjectShell* i_document );
+ static void Execute( css::uno::Any const & aEventData, const css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/fltoptint.hxx b/sfx2/source/inc/fltoptint.hxx
new file mode 100644
index 000000000..624ecd073
--- /dev/null
+++ b/sfx2/source/inc/fltoptint.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/.
+ *
+ * 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_SOURCE_INC_FLTOPTINT_HXX
+#define INCLUDED_SFX2_SOURCE_INC_FLTOPTINT_HXX
+
+#include <com/sun/star/document/XInteractionFilterOptions.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <comphelper/interaction.hxx>
+#include <cppuhelper/implbase.hxx>
+#include <rtl/ref.hxx>
+
+class FilterOptionsContinuation : public comphelper::OInteraction< css::document::XInteractionFilterOptions >
+{
+ css::uno::Sequence< css::beans::PropertyValue > rProperties;
+
+public:
+ virtual void SAL_CALL setFilterOptions( const css::uno::Sequence< css::beans::PropertyValue >& rProp ) override;
+ virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getFilterOptions( ) override;
+};
+
+class RequestFilterOptions : public ::cppu::WeakImplHelper< css::task::XInteractionRequest >
+{
+ css::uno::Any m_aRequest;
+
+ rtl::Reference<comphelper::OInteractionAbort> m_xAbort;
+ rtl::Reference<FilterOptionsContinuation> m_xOptions;
+
+public:
+ RequestFilterOptions( css::uno::Reference< css::frame::XModel > const & rModel,
+ const css::uno::Sequence< css::beans::PropertyValue >& rProperties );
+
+ bool isAbort() const { return m_xAbort->wasSelected(); }
+
+ css::uno::Sequence< css::beans::PropertyValue > getFilterOptions()
+ {
+ return m_xOptions->getFilterOptions();
+ }
+
+ virtual css::uno::Any SAL_CALL getRequest() override;
+
+ virtual css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation >
+ > SAL_CALL getContinuations() override;
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx
new file mode 100644
index 000000000..6abb5a4fc
--- /dev/null
+++ b/sfx2/source/inc/helper.hxx
@@ -0,0 +1,42 @@
+/* -*- 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_SOURCE_INC_HELPER_HXX
+#define INCLUDED_SFX2_SOURCE_INC_HELPER_HXX
+
+#include <rtl/ustring.hxx>
+
+#include <vector>
+
+// class SfxContentHelper ------------------------------------------------
+
+class SfxContentHelper
+{
+public:
+ static std::vector< OUString > GetResultSet( const OUString& rURL );
+ static std::vector< OUString > GetHelpTreeViewContents( const OUString& rURL );
+ static OUString GetActiveHelpString( const OUString& rURL );
+ static bool IsHelpErrorDocument( const OUString& rURL );
+
+ static sal_Int64 GetSize( const OUString& rContent );
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_HELPER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/helpids.h b/sfx2/source/inc/helpids.h
new file mode 100644
index 000000000..4a18af690
--- /dev/null
+++ b/sfx2/source/inc/helpids.h
@@ -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/.
+ *
+ * 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_SOURCE_INC_HELPIDS_H
+#define INCLUDED_SFX2_SOURCE_INC_HELPIDS_H
+
+#define HID_TEMPLATE_FMT "SFX2_HID_TEMPLATE_FMT"
+#define HID_TEMPLATE_FILTER "SFX2_HID_TEMPLATE_FILTER"
+#define HID_TEMPLDLG_NEWBYEXAMPLE "SFX2_HID_TEMPLDLG_NEWBYEXAMPLE"
+#define HID_TEMPLDLG_UPDATEBYEXAMPLE "SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE"
+#define HID_TEMPLDLG_WATERCAN "SFX2_HID_TEMPLDLG_WATERCAN"
+#define HID_NAVIGATOR_WINDOW "SFX2_HID_NAVIGATOR_WINDOW"
+#define HID_TABDLG_RESET_BTN "SFX2_HID_TABDLG_RESET_BTN"
+#define HID_TABDLG_STANDARD_BTN "SFX2_HID_TABDLG_STANDARD_BTN"
+#define HID_TEMPLDLG_TOOLBOX_LEFT "SFX2_HID_TEMPLDLG_TOOLBOX_LEFT"
+#define HID_HELP_WINDOW "SFX2_HID_HELP_WINDOW"
+#define HID_HELP_TOOLBOX "SFX2_HID_HELP_TOOLBOX"
+#define HID_HELP_TOOLBOXITEM_INDEX "SFX2_HID_HELP_TOOLBOXITEM_INDEX"
+#define HID_HELP_TOOLBOXITEM_START "SFX2_HID_HELP_TOOLBOXITEM_START"
+#define HID_HELP_TOOLBOXITEM_BACKWARD "SFX2_HID_HELP_TOOLBOXITEM_BACKWARD"
+#define HID_HELP_TOOLBOXITEM_FORWARD "SFX2_HID_HELP_TOOLBOXITEM_FORWARD"
+#define HID_HELP_TOOLBOXITEM_PRINT "SFX2_HID_HELP_TOOLBOXITEM_PRINT"
+#define HID_HELP_TOOLBOXITEM_BOOKMARKS "SFX2_HID_HELP_TOOLBOXITEM_BOOKMARKS"
+#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG "SFX2_HID_HELP_TOOLBOXITEM_SEARCHDIALOG"
+#define HID_HELP_TEXT_SELECTION_MODE "SFX2_HID_HELP_TEXT_SELECTION_MODE"
+
+#define HID_QUERY_LOAD_TEMPLATE "SFX2_HID_QUERY_LOAD_TEMPLATE"
+
+#define HID_SIDEBAR_WINDOW "SFX2_HID_SIDEBAR_WINDOW"
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/hintpost.hxx b/sfx2/source/inc/hintpost.hxx
new file mode 100644
index 000000000..0a72aa661
--- /dev/null
+++ b/sfx2/source/inc/hintpost.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * 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_HINTPOST_HXX
+#define INCLUDED_SFX2_HINTPOST_HXX
+
+#include <tools/link.hxx>
+#include <tools/ref.hxx>
+#include <functional>
+#include <memory>
+
+
+class SfxRequest;
+
+/** [Description]
+
+ This class allows sending unique events via VCL's
+ Application::PostUserEvent(). When the User-Event is dispatched,
+ the handler <Event()> is called, which calls the Link provided with
+ SetEventHdl().
+
+ The instances are held via Ref-Count until a possibly sent
+ event has arrived. If the target dies before delivery,
+ the connection must be severed with SetEventHdl(Link()).
+*/
+class SfxHintPoster final : public SvRefBase
+{
+private:
+ std::function<void (std::unique_ptr<SfxRequest>)> m_Link;
+
+ DECL_LINK( DoEvent_Impl, void*, void );
+
+ virtual ~SfxHintPoster() override;
+
+public:
+ SfxHintPoster(const std::function<void (std::unique_ptr<SfxRequest>)>& rLink);
+
+ void Post( std::unique_ptr<SfxRequest> pHint );
+ void SetEventHdl(const std::function<void (std::unique_ptr<SfxRequest>)>& rLink);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/itemdel.hxx b/sfx2/source/inc/itemdel.hxx
new file mode 100644
index 000000000..b8ea32501
--- /dev/null
+++ b/sfx2/source/inc/itemdel.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_ITEMDEL_HXX
+#define INCLUDED_SFX2_ITEMDEL_HXX
+
+#include <memory>
+
+class SfxPoolItem;
+
+void DeleteItemOnIdle(std::unique_ptr<SfxPoolItem> pItem);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/macroloader.hxx b/sfx2/source/inc/macroloader.hxx
new file mode 100644
index 000000000..051486c09
--- /dev/null
+++ b/sfx2/source/inc/macroloader.hxx
@@ -0,0 +1,86 @@
+/* -*- 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_SOURCE_INC_MACROLOADER_HXX
+#define INCLUDED_SFX2_SOURCE_INC_MACROLOADER_HXX
+
+#include <sal/config.h>
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XNotifyingDispatch.hpp>
+#include <com/sun/star/frame/XDispatchResultListener.hpp>
+#include <com/sun/star/frame/XSynchronousDispatch.hpp>
+#include <com/sun/star/util/URL.hpp>
+
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <vcl/errcode.hxx>
+
+class SfxObjectShell;
+
+class SfxMacroLoader : public cppu::WeakImplHelper<
+ css::frame::XDispatchProvider,
+ css::frame::XNotifyingDispatch,
+ css::frame::XSynchronousDispatch,
+ css::lang::XServiceInfo>
+{
+ css::uno::WeakReference < css::frame::XFrame > m_xFrame;
+ SfxObjectShell* GetObjectShell_Impl();
+
+public:
+ /// @throws css::uno::Exception
+ /// @throws css::uno::RuntimeException
+ SfxMacroLoader(const css::uno::Sequence< css::uno::Any >& aArguments);
+
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ /// @throws css::uno::RuntimeException
+ /// @throws css::ucb::ContentCreationException
+ static ErrCode loadMacro( const OUString& aURL, css::uno::Any& rRetval, SfxObjectShell* pDoc );
+
+ virtual css::uno::Reference < css::frame::XDispatch > SAL_CALL queryDispatch(
+ const css::util::URL& aURL, const OUString& sTargetFrameName,
+ sal_Int32 eSearchFlags ) override;
+
+ virtual css::uno::Sequence< css::uno::Reference < css::frame::XDispatch > > SAL_CALL queryDispatches(
+ const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescriptor ) override;
+
+ virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArgs, const css::uno::Reference< css::frame::XDispatchResultListener >& Listener ) override;
+
+ virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArgs ) override;
+
+ virtual css::uno::Any SAL_CALL dispatchWithReturnValue( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArgs ) 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;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/nochaos.hxx b/sfx2/source/inc/nochaos.hxx
new file mode 100644
index 000000000..5468eee92
--- /dev/null
+++ b/sfx2/source/inc/nochaos.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/.
+ *
+ * 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_SOURCE_INC_NOCHAOS_HXX
+#define INCLUDED_SFX2_SOURCE_INC_NOCHAOS_HXX
+
+#include <sal/types.h>
+
+class SfxItemPool;
+
+class NoChaos
+{
+public:
+ static SfxItemPool* GetItemPool();
+ static sal_uInt16 ReleaseItemPool();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
new file mode 100644
index 000000000..ae0d1ed24
--- /dev/null
+++ b/sfx2/source/inc/objshimp.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 .
+ */
+#ifndef INCLUDED_SFX2_SOURCE_INC_OBJSHIMP_HXX
+#define INCLUDED_SFX2_SOURCE_INC_OBJSHIMP_HXX
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
+#include <tools/datetime.hxx>
+
+#include <sfx2/objsh.hxx>
+#include <sfx2/docmacromode.hxx>
+#include <bitset.hxx>
+#include <vcl/timer.hxx>
+
+#include "appbaslib.hxx"
+
+namespace svtools { class AsynchronLink; }
+
+class SfxViewFrame;
+
+class SfxBasicManagerHolder;
+
+class AutoReloadTimer_Impl : public Timer
+{
+ OUString aUrl;
+ SfxObjectShell* pObjSh;
+
+public:
+ AutoReloadTimer_Impl( const OUString& rURL, sal_uInt32 nTime,
+ SfxObjectShell* pSh );
+ virtual void Invoke() override;
+};
+
+struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
+{
+ ::comphelper::EmbeddedObjectContainer* mpObjectContainer;
+ SfxBasicManagerHolder aBasicManager;
+ SfxObjectShell& rDocShell;
+ css::uno::Reference< css::script::XLibraryContainer >
+ xBasicLibraries;
+ css::uno::Reference< css::script::XLibraryContainer >
+ xDialogLibraries;
+ ::sfx2::DocumentMacroMode
+ aMacroMode;
+ SfxProgress* pProgress;
+ OUString aTitle;
+ OUString aTempName;
+ DateTime nTime;
+ sal_uInt16 nVisualDocumentNumber;
+ SignatureState nDocumentSignatureState;
+ SignatureState nScriptingSignatureState;
+ bool bClosing:1, // sal_True while Close(), to prevent recurrences Notification
+ bIsSaving:1,
+ bIsNamedVisible:1,
+ bIsAbortingImport:1, // Import operation should be canceled.
+ bInPrepareClose : 1,
+ bPreparedForClose : 1,
+ bForbidReload : 1,
+ bBasicInitialized :1,
+ bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
+ bOwnsStorage:1,
+ bInitialized:1,
+ bModelInitialized:1, // whether the related model is initialized
+ bPreserveVersions:1,
+ m_bMacroSignBroken:1, // whether the macro signature was explicitly broken
+ m_bNoBasicCapabilities:1,
+ m_bDocRecoverySupport:1,
+ bQueryLoadTemplate:1,
+ bLoadReadonly:1,
+ bUseUserData:1,
+ bUseThumbnailSave:1,
+ bSaveVersionOnClose:1,
+ m_bSharedXMLFlag:1, // whether the document should be edited in shared mode
+ m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file
+ m_bConfigOptionsChecked:1, // whether or not the user options are checked after the Options dialog is closed.
+ m_bMacroCallsSeenWhileLoading:1; // whether or not the user options are checked after the Options dialog is closed.
+
+ IndexBitSet aBitSet;
+ ErrCode lErr;
+ SfxEventHintId nEventId; // If Open/Create as to be sent
+ // before Activate
+ std::unique_ptr<AutoReloadTimer_Impl> pReloadTimer;
+ SfxLoadedFlags nLoadedFlags;
+ SfxLoadedFlags nFlagsInProgress;
+ bool bModalMode;
+ bool bRunningMacro;
+ bool bReadOnlyUI;
+ tools::SvRef<SvRefBase> xHeaderAttributes;
+ ::rtl::Reference< SfxBaseModel >
+ pBaseModel;
+ sal_uInt16 nStyleFilter;
+
+ bool m_bEnableSetModified;
+ bool m_bIsModified;
+
+ tools::Rectangle m_aVisArea;
+ MapUnit m_nMapUnit;
+
+ bool m_bCreateTempStor;
+ css::uno::Reference< css::embed::XStorage > m_xDocStorage;
+
+ bool m_bIsInit;
+
+ OUString m_aSharedFileURL;
+
+ bool m_bIncomplEncrWarnShown;
+
+ // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
+ sal_uInt32 m_nModifyPasswordHash;
+ css::uno::Sequence< css::beans::PropertyValue > m_aModifyPasswordInfo;
+ bool m_bModifyPasswordEntered;
+ /// If true, then this is not a real save, just the signatures change.
+ bool m_bSavingForSigning;
+ bool m_bAllowModifiedBackAfterSigning;
+
+ /// Holds Infobars until View is fully loaded
+ std::vector<InfobarData> m_aPendingInfobars;
+
+ SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
+ virtual ~SfxObjectShell_Impl();
+
+ // IMacroDocumentAccess overridables
+ virtual sal_Int16 getCurrentMacroExecMode() const override;
+ virtual void setCurrentMacroExecMode( sal_uInt16 nMacroMode ) override;
+ virtual OUString getDocumentLocation() const override;
+ virtual bool documentStorageHasMacros() const override;
+ virtual bool macroCallsSeenWhileLoading() const override;
+ virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override;
+ virtual SignatureState getScriptingSignatureState() override;
+
+ virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx
new file mode 100644
index 000000000..3bdfb3428
--- /dev/null
+++ b/sfx2/source/inc/openflag.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * 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_SOURCE_INC_OPENFLAG_HXX
+#define INCLUDED_SFX2_SOURCE_INC_OPENFLAG_HXX
+
+// Open file for editing, then only the third option (reading a copy) works
+#define SFX_STREAM_READWRITE (StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE)
+// I work on the original, not a copy
+// -> file then can not be opened for editing
+#define SFX_STREAM_READONLY (StreamMode::READ | StreamMode::SHARE_DENYWRITE) // + !bDirect
+// Someone else is editing the file, a copy it created
+// -> the file can then be opened for editing
+#define SFX_STREAM_READONLY_MAKECOPY (StreamMode::READ | StreamMode::SHARE_DENYNONE)
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/openuriexternally.hxx b/sfx2/source/inc/openuriexternally.hxx
new file mode 100644
index 000000000..df2528558
--- /dev/null
+++ b/sfx2/source/inc/openuriexternally.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SFX2_SOURCE_INC_OPENURIEXTERNALLY_HXX
+#define INCLUDED_SFX2_SOURCE_INC_OPENURIEXTERNALLY_HXX
+
+#include <sal/config.h>
+
+#include <rtl/ustring.hxx>
+
+namespace sfx2
+{
+/** Open a URI via com.sun.star.system.SystemShellExecute
+
+ Handles XSystemShellExecute.execute's IllegalArgumentException (throwing a
+ RuntimeException if it is unexpected, i.e., not caused by the given uri not
+ being an absolute URI reference).
+
+ Handles XSystemShellExecute.execute's SystemShellExecuteException unless the
+ given handleSystemShellExecuteException is false (in which case the
+ exception is re-thrown).
+*/
+void openUriExternally(const OUString& sURI, bool bHandleSystemShellExecuteException);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/openurlhint.hxx b/sfx2/source/inc/openurlhint.hxx
new file mode 100644
index 000000000..026d72636
--- /dev/null
+++ b/sfx2/source/inc/openurlhint.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * 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_STRINGHINT_HXX
+#define INCLUDED_SFX2_STRINGHINT_HXX
+
+#include <svl/hint.hxx>
+#include <rtl/ustring.hxx>
+
+class SfxOpenUrlHint: public SfxHint
+{
+ OUString msDocumentURL;
+
+public:
+ SfxOpenUrlHint(const OUString& sDocumentURL);
+ const OUString& GetDocumentURL() const;
+ virtual ~SfxOpenUrlHint() override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/partwnd.hxx b/sfx2/source/inc/partwnd.hxx
new file mode 100644
index 000000000..c8bfad2d5
--- /dev/null
+++ b/sfx2/source/inc/partwnd.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/.
+ *
+ * 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_SOURCE_INC_PARTWND_HXX
+#define INCLUDED_SFX2_SOURCE_INC_PARTWND_HXX
+
+#include <sfx2/childwin.hxx>
+#include <sfx2/dockwin.hxx>
+
+
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace frame
+ {
+ class XFrame;
+ }
+ }
+ }
+}
+
+// forward ---------------------------------------------------------------
+
+// class SfxPartChildWnd_Impl -----------------------------------
+
+class SfxPartChildWnd_Impl : public SfxChildWindow
+{
+public:
+ SfxPartChildWnd_Impl( vcl::Window* pParent, sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxPartChildWnd_Impl);
+ virtual ~SfxPartChildWnd_Impl() override;
+
+ virtual bool QueryClose() override;
+};
+
+// class SfxExplorerDockWnd_Impl -----------------------------------------
+
+class SfxPartDockWnd_Impl : public SfxDockingWindow
+{
+protected:
+ virtual bool EventNotify( NotifyEvent& rNEvt ) override;
+
+public:
+ SfxPartDockWnd_Impl( SfxBindings* pBindings,
+ SfxChildWindow* pChildWin,
+ vcl::Window* pParent,
+ WinBits nBits );
+
+ bool QueryClose();
+ virtual void FillInfo(SfxChildWinInfo&) const override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/preview.hxx b/sfx2/source/inc/preview.hxx
new file mode 100644
index 000000000..b30658319
--- /dev/null
+++ b/sfx2/source/inc/preview.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 .
+ */
+#ifndef INCLUDED_SFX2_SOURCE_INC_PREVIEW_HXX
+#define INCLUDED_SFX2_SOURCE_INC_PREVIEW_HXX
+
+#include <vcl/customweld.hxx>
+
+class SfxObjectShell;
+class GDIMetaFile;
+
+class SfxPreviewWin_Impl : public weld::CustomWidgetController
+{
+private:
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ std::shared_ptr<GDIMetaFile> xMetaFile;
+
+public:
+ SfxPreviewWin_Impl();
+ void SetObjectShell(SfxObjectShell const* pObj);
+ static void ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFile* pFile);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx
new file mode 100644
index 000000000..b7aa71668
--- /dev/null
+++ b/sfx2/source/inc/recfloat.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SFX2_SOURCE_INC_RECFLOAT_HXX
+#define INCLUDED_SFX2_SOURCE_INC_RECFLOAT_HXX
+
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/weldutils.hxx>
+
+class SfxRecordingFloatWrapper_Impl : public SfxChildWindow
+{
+ SfxBindings* pBindings;
+public:
+ SfxRecordingFloatWrapper_Impl( vcl::Window* pParent ,
+ sal_uInt16 nId ,
+ SfxBindings* pBindings ,
+ SfxChildWinInfo const * pInfo );
+ virtual ~SfxRecordingFloatWrapper_Impl() override;
+
+ SFX_DECL_CHILDWINDOW(SfxRecordingFloatWrapper_Impl);
+ virtual bool QueryClose() override;
+};
+
+class SfxRecordingFloat_Impl : public SfxModelessDialogController
+{
+ std::unique_ptr<weld::Toolbar> m_xToolbar;
+ std::unique_ptr<ToolbarUnoDispatcher> m_xDispatcher;
+public:
+ SfxRecordingFloat_Impl(SfxBindings* pBindings,
+ SfxChildWindow* pChildWin,
+ weld::Window* pParent);
+ virtual ~SfxRecordingFloat_Impl() override;
+ virtual void FillInfo(SfxChildWinInfo& rInfo) const override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
new file mode 100644
index 000000000..b8af2310d
--- /dev/null
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -0,0 +1,42 @@
+/* -*- 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_SOURCE_INC_SFXPICKLIST_HXX
+#define INCLUDED_SFX2_SOURCE_INC_SFXPICKLIST_HXX
+
+#include <memory>
+
+#define PICKLIST_MAXSIZE 100
+
+class SfxApplication;
+class SfxPickListImpl;
+
+class SfxPickList
+{
+private:
+ std::unique_ptr<SfxPickListImpl> mxImpl;
+
+public:
+ SfxPickList(SfxApplication& rApp);
+ ~SfxPickList();
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_SFXPICKLIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx
new file mode 100644
index 000000000..3ee9a1084
--- /dev/null
+++ b/sfx2/source/inc/sfxtypes.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 .
+ */
+#ifndef INCLUDED_SFX2_SOURCE_INC_SFXTYPES_HXX
+#define INCLUDED_SFX2_SOURCE_INC_SFXTYPES_HXX
+
+#include <sal/config.h>
+#include <sal/log.hxx>
+
+#if defined(DBG_UTIL)
+
+class SfxStack
+{
+ static unsigned nLevel;
+
+public:
+ SfxStack( const char *pName )
+ {
+ ++nLevel;
+ SAL_INFO("sfx.control", "STACK: enter " << nLevel << " " << pName);
+ }
+ ~SfxStack()
+ {
+ SAL_INFO("sfx.control", "STACK: leave " << nLevel);
+ --nLevel;
+ }
+};
+
+#define SFX_STACK(s) SfxStack aSfxStack_( #s )
+#else
+#define SFX_STACK(s)
+#endif
+
+
+#endif // INCLUDED_SFX2_SOURCE_INC_SFXTYPES_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/sfxurlrelocator.hxx b/sfx2/source/inc/sfxurlrelocator.hxx
new file mode 100644
index 000000000..1d5b26bec
--- /dev/null
+++ b/sfx2/source/inc/sfxurlrelocator.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * 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_SOURCE_INC_SFXURLRELOCATOR_HXX
+#define INCLUDED_SFX2_SOURCE_INC_SFXURLRELOCATOR_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
+
+#include <rtl/ustring.hxx>
+#include <osl/mutex.hxx>
+
+class SfxURLRelocator_Impl
+{
+ ::osl::Mutex maMutex;
+ css::uno::Reference< css::uno::XComponentContext > mxContext;
+ css::uno::Reference< css::util::XOfficeInstallationDirectories > mxOfficeInstDirs;
+ css::uno::Reference< css::util::XMacroExpander > mxMacroExpander;
+
+public:
+ static bool propertyCanContainOfficeDir( const OUString & rPropName );
+ void initOfficeInstDirs();
+ void makeRelocatableURL( OUString & rURL );
+ void makeAbsoluteURL( OUString & rURL );
+
+ SfxURLRelocator_Impl( const css::uno::Reference< css::uno::XComponentContext > & xContext );
+ ~SfxURLRelocator_Impl();
+
+private:
+ void implExpandURL( OUString& io_url );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/shellimpl.hxx b/sfx2/source/inc/shellimpl.hxx
new file mode 100644
index 000000000..5e11bf1ef
--- /dev/null
+++ b/sfx2/source/inc/shellimpl.hxx
@@ -0,0 +1,96 @@
+/* -*- 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_SHELLIMPL_HXX
+#define INCLUDED_SFX2_SHELLIMPL_HXX
+
+#include <cstdlib>
+#include <vector>
+
+class SfxObjectShell;
+class SfxViewFrame;
+class SfxViewShell;
+
+class SfxObjectShellArr_Impl
+{
+ typedef std::vector<SfxObjectShell*> DataType;
+ DataType maData;
+
+public:
+ typedef DataType::iterator iterator;
+
+ iterator begin();
+ iterator end();
+
+ const SfxObjectShell* operator[] ( size_t i ) const;
+ SfxObjectShell* operator[] ( size_t i );
+
+ void erase( const iterator& it );
+
+ void push_back( SfxObjectShell* p );
+
+ size_t size() const;
+};
+
+class SfxViewFrameArr_Impl
+{
+ typedef std::vector<SfxViewFrame*> DataType;
+ DataType maData;
+
+public:
+
+ typedef DataType::iterator iterator;
+ iterator begin();
+ iterator end();
+
+ const SfxViewFrame* operator[] ( size_t i ) const;
+ SfxViewFrame* operator[] ( size_t i );
+
+ void erase( const iterator& it );
+
+ void push_back( SfxViewFrame* p );
+
+ size_t size() const;
+};
+
+class SfxViewShellArr_Impl
+{
+ typedef std::vector<SfxViewShell*> DataType;
+ DataType maData;
+
+public:
+
+ typedef DataType::iterator iterator;
+
+ iterator begin();
+ iterator end();
+
+ const SfxViewShell* operator[] ( size_t i ) const;
+ SfxViewShell* operator[] ( size_t i );
+
+ void erase( const iterator& it );
+
+ void push_back( SfxViewShell* p );
+
+ size_t size() const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx
new file mode 100644
index 000000000..e5bd07dce
--- /dev/null
+++ b/sfx2/source/inc/slotserv.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * 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_SOURCE_INC_SLOTSERV_HXX
+#define INCLUDED_SFX2_SOURCE_INC_SLOTSERV_HXX
+
+#include <sal/types.h>
+
+class SfxSlot;
+
+class SfxSlotServer
+{
+private:
+ const SfxSlot* _pSlot;
+ sal_uInt16 _nShellLevel;
+
+public:
+ SfxSlotServer();
+
+ sal_uInt16 GetShellLevel() const;
+ void SetShellLevel(sal_uInt16 nLevel) { _nShellLevel = nLevel; }
+ void SetSlot(const SfxSlot* pSlot) { _pSlot = pSlot; }
+ const SfxSlot* GetSlot() const;
+};
+
+inline SfxSlotServer::SfxSlotServer():
+ _pSlot(nullptr),
+ _nShellLevel(0)
+{
+}
+
+inline sal_uInt16 SfxSlotServer::GetShellLevel() const
+{
+ return _nShellLevel;
+}
+
+inline const SfxSlot* SfxSlotServer::GetSlot() const
+{
+ return _pSlot;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx
new file mode 100644
index 000000000..5c861e291
--- /dev/null
+++ b/sfx2/source/inc/splitwin.hxx
@@ -0,0 +1,127 @@
+/* -*- 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_SOURCE_INC_SPLITWIN_HXX
+#define INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
+
+#include <vcl/splitwin.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/dockwin.hxx>
+
+#include <vector>
+#include <memory>
+
+class SfxWorkWindow;
+class SfxDockingWindow;
+class SfxEmptySplitWin_Impl;
+
+struct SfxDock_Impl
+{
+ sal_uInt16 nType;
+ VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
+ bool bNewLine;
+ bool bHide; // SplitWindow had this window
+};
+
+class SfxSplitWindow : public SplitWindow
+{
+friend class SfxEmptySplitWin_Impl;
+
+private:
+ SfxChildAlignment eAlign;
+ SfxWorkWindow* pWorkWin;
+ std::vector<std::unique_ptr<SfxDock_Impl> >
+ maDockArr;
+ bool bPinned;
+ VclPtr<SfxEmptySplitWin_Impl> pEmptyWin;
+ VclPtr<SfxDockingWindow> pActive;
+
+ void InsertWindow_Impl( SfxDock_Impl const * pDockWin,
+ const Size& rSize,
+ sal_uInt16 nLine,
+ sal_uInt16 nPos,
+ bool bNewLine );
+
+ DECL_LINK( TimerHdl, Timer*, void );
+ bool CursorIsOverRect() const;
+ void SetPinned_Impl( bool );
+ void SetFadeIn_Impl( bool );
+ void SaveConfig_Impl();
+ void FadeOut_Impl();
+
+protected:
+
+ virtual void StartSplit() override;
+ virtual void SplitResize() override;
+ virtual void Split() override;
+ virtual void MouseButtonDown ( const MouseEvent& ) override;
+
+public:
+ SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
+ SfxWorkWindow *pW, bool bWithButtons );
+
+ virtual ~SfxSplitWindow() override;
+ virtual void dispose() override;
+
+ void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true);
+
+ void InsertWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize);
+
+ void InsertWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize,
+ sal_uInt16 nLine,
+ sal_uInt16 nPos,
+ bool bNewLine );
+
+ void MoveWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize,
+ sal_uInt16 nLine,
+ sal_uInt16 nPos,
+ bool bNewLine );
+
+ void RemoveWindow( SfxDockingWindow const * pDockWin, bool bHide=true);
+
+ void Lock( bool bLock=true )
+ {
+ SetUpdateMode( !bLock );
+ }
+
+ bool GetWindowPos( const SfxDockingWindow* pWindow,
+ sal_uInt16& rLine, sal_uInt16& rPos ) const;
+ bool GetWindowPos( const Point& rTestPos,
+ sal_uInt16& rLine, sal_uInt16& rPos ) const;
+ sal_uInt16 GetLineCount() const;
+ long GetLineSize( sal_uInt16 ) const;
+ sal_uInt16 GetWindowCount(sal_uInt16 nLine) const;
+ sal_uInt16 GetWindowCount() const;
+
+ bool IsPinned() const { return bPinned; }
+ bool IsFadeIn() const;
+ bool IsAutoHide( bool bSelf ) const;
+ SplitWindow* GetSplitWindow();
+
+ virtual void FadeOut() override;
+ virtual void FadeIn() override;
+ void SetActiveWindow_Impl( SfxDockingWindow* pWin );
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx
new file mode 100644
index 000000000..c831fa4c7
--- /dev/null
+++ b/sfx2/source/inc/statcach.hxx
@@ -0,0 +1,154 @@
+/* -*- 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_SOURCE_INC_STATCACH_HXX
+#define INCLUDED_SFX2_SOURCE_INC_STATCACH_HXX
+
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <cppuhelper/implbase.hxx>
+#include <tools/debug.hxx>
+#include <rtl/ref.hxx>
+
+#include <sfx2/bindings.hxx>
+
+#include "slotserv.hxx"
+
+class SfxControllerItem;
+class SfxDispatcher;
+class BindDispatch_Impl : public ::cppu::WeakImplHelper< css::frame::XStatusListener >
+{
+friend class SfxStateCache;
+ css::uno::Reference< css::frame::XDispatch > xDisp;
+ css::util::URL aURL;
+ css::frame::FeatureStateEvent aStatus;
+ SfxStateCache* pCache;
+ const SfxSlot* pSlot;
+
+public:
+ BindDispatch_Impl(
+ const css::uno::Reference< css::frame::XDispatch > & rDisp,
+ const css::util::URL& rURL,
+ SfxStateCache* pStateCache, const SfxSlot* pSlot );
+
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ const css::frame::FeatureStateEvent& GetStatus() const { return aStatus;}
+ sal_Int16 Dispatch( const css::uno::Sequence < css::beans::PropertyValue >& aProps, bool bForceSynchron );
+ void Release();
+};
+
+class SfxStateCache
+{
+friend class BindDispatch_Impl;
+ rtl::Reference<BindDispatch_Impl>
+ mxDispatch;
+ sal_uInt16 nId; // Slot-Id
+ SfxControllerItem* pInternalController;
+ css::uno::Reference < css::frame::XDispatch > xMyDispatch;
+ SfxControllerItem* pController; // Pointer to first bound Controller (interlinked with each other)
+ SfxSlotServer aSlotServ; // SlotServer, SlotPtr = 0 -> not on Stack
+ SfxPoolItem* pLastItem; // Last sent Item, never -1
+ SfxItemState eLastState; // Last sent State
+ bool bCtrlDirty:1; // Update Controller?
+ bool bSlotDirty:1; // Present Function, must be updated
+ bool bItemVisible:1; // item visibility
+ bool bItemDirty; // Validity of pLastItem
+
+private:
+ SfxStateCache( const SfxStateCache& rOrig ) = delete;
+ void SetState_Impl( SfxItemState, const SfxPoolItem*, bool bMaybeDirty );
+
+public:
+ SfxStateCache( sal_uInt16 nFuncId );
+ ~SfxStateCache();
+
+ sal_uInt16 GetId() const;
+
+ const SfxSlotServer* GetSlotServer( SfxDispatcher &rDispat, const css::uno::Reference< css::frame::XDispatchProvider > & xProv );
+ const SfxSlotServer* GetSlotServer( SfxDispatcher &rDispat )
+ { return GetSlotServer( rDispat, css::uno::Reference< css::frame::XDispatchProvider > () ); }
+ css::uno::Reference< css::frame::XDispatch > GetDispatch() const;
+ sal_Int16 Dispatch( const SfxItemSet* pSet, bool bForceSynchron );
+ bool IsControllerDirty() const
+ { return bCtrlDirty; }
+ void ClearCache();
+
+ void SetState( SfxItemState, const SfxPoolItem*, bool bMaybeDirty=false );
+ void SetCachedState(bool bAlways);
+ void Invalidate( bool bWithSlot );
+ void SetVisibleState( bool bShow );
+ void GetState( boost::property_tree::ptree& );
+
+ SfxControllerItem* ChangeItemLink( SfxControllerItem* pNewBinding );
+ SfxControllerItem* GetItemLink() const;
+ void SetInternalController( SfxControllerItem* pCtrl )
+ { DBG_ASSERT( !pInternalController, "Only one internal controller allowed!" ); pInternalController = pCtrl; }
+ void ReleaseInternalController() { pInternalController = nullptr; }
+ SfxControllerItem* GetInternalController() const { return pInternalController; }
+ const css::uno::Reference < css::frame::XDispatch >&
+ GetInternalDispatch() const
+ { return xMyDispatch; }
+ void SetInternalDispatch( const css::uno::Reference < css::frame::XDispatch >& rDisp )
+ { xMyDispatch = rDisp; }
+};
+
+
+// clears Cached-Item
+
+inline void SfxStateCache::ClearCache()
+{
+ bItemDirty = true;
+}
+
+
+// registers an item representing this function
+
+inline SfxControllerItem* SfxStateCache::ChangeItemLink( SfxControllerItem* pNewBinding )
+{
+ SfxControllerItem* pOldBinding = pController;
+ pController = pNewBinding;
+ if ( pNewBinding )
+ {
+ bCtrlDirty = true;
+ bItemDirty = true;
+ }
+ return pOldBinding;
+}
+
+
+// returns the func binding which becomes called on spreading states
+
+inline SfxControllerItem* SfxStateCache::GetItemLink() const
+{
+ return pController;
+}
+
+
+inline sal_uInt16 SfxStateCache::GetId() const
+{
+ return nId;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/templatesearchview.hxx b/sfx2/source/inc/templatesearchview.hxx
new file mode 100644
index 000000000..69073653b
--- /dev/null
+++ b/sfx2/source/inc/templatesearchview.hxx
@@ -0,0 +1,68 @@
+/* -*- 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_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
+#define INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
+
+#include <sfx2/thumbnailview.hxx>
+
+class TemplateViewItem;
+class PopupMenu;
+class Menu;
+
+class TemplateSearchView final : public SfxThumbnailView
+{
+public:
+
+ TemplateSearchView(std::unique_ptr<weld::ScrolledWindow> xWindow,
+ std::unique_ptr<weld::Menu> xMenu);
+
+ void setOpenTemplateHdl (const Link<ThumbnailViewItem*, void> &rLink);
+
+ void ContextMenuSelectHdl(const OString& rIdent);
+
+ void setCreateContextMenuHdl(const Link<ThumbnailViewItem*,void> &rLink);
+
+ void setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
+
+ void setDeleteTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
+
+ void setDefaultTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
+
+ void createContextMenu(const bool bIsDefault);
+
+ void AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
+ const OUString &rTitle, const OUString &rSubtitle,
+ const OUString &rPath, const BitmapEx &rImage );
+
+ static BitmapEx getDefaultThumbnail( const OUString& rPath );
+
+private:
+ virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
+
+ virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
+
+ virtual bool Command(const CommandEvent& rPos) override;
+
+ virtual bool KeyInput( const KeyEvent& rKEvt ) override;
+
+ TemplateViewItem *maSelectedItem;
+
+ Point maPosition;
+
+ Link<ThumbnailViewItem*, void> maOpenTemplateHdl;
+ Link<ThumbnailViewItem*, void> maCreateContextMenuHdl;
+ Link<ThumbnailViewItem*,void> maEditTemplateHdl;
+ Link<ThumbnailViewItem*,void> maDeleteTemplateHdl;
+ Link<ThumbnailViewItem*,void> maDefaultTemplateHdl;
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/templatesearchviewitem.hxx b/sfx2/source/inc/templatesearchviewitem.hxx
new file mode 100644
index 000000000..0f681cbdd
--- /dev/null
+++ b/sfx2/source/inc/templatesearchviewitem.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/.
+ */
+
+#ifndef INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEWITEM_HXX
+#define INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEWITEM_HXX
+
+#include <templateviewitem.hxx>
+
+struct TemplateSearchViewItem : public TemplateViewItem
+{
+ TemplateSearchViewItem (ThumbnailViewBase &rView, sal_uInt16 nId)
+ : TemplateViewItem(rView, nId)
+ , mnAssocId(0)
+ {}
+
+ sal_uInt16 mnAssocId; //Associated item id to the TemplateViews
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEWITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
new file mode 100644
index 000000000..57b95edf9
--- /dev/null
+++ b/sfx2/source/inc/templdgi.hxx
@@ -0,0 +1,313 @@
+/* -*- 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_SOURCE_INC_TEMPLDGI_HXX
+#define INCLUDED_SFX2_SOURCE_INC_TEMPLDGI_HXX
+
+class SfxTemplateControllerItem;
+
+#include <sal/config.h>
+
+#include <array>
+#include <memory>
+
+#include <vcl/toolbox.hxx>
+#include <vcl/transfer.hxx>
+#include <vcl/weld.hxx>
+#include <svl/lstner.hxx>
+#include <svl/eitem.hxx>
+
+#include <svl/style.hxx>
+
+#include <sfx2/childwin.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/styfitem.hxx>
+#include <sfx2/templdlg.hxx>
+
+class SfxStyleFamilyItem;
+class SfxTemplateItem;
+class SfxBindings;
+class SfxStyleSheetBase;
+class SfxStyleSheetBasePool;
+class SvTreeListBox ;
+class StyleTreeListBox_Impl;
+class SfxTemplateDialog_Impl;
+class SfxCommonTemplateDialog_Impl;
+
+namespace com::sun::star::frame {
+ class XModuleManager2;
+}
+
+enum class StyleFlags {
+ NONE=0, UpdateFamilyList=1, UpdateFamily=2
+};
+namespace o3tl {
+ template<> struct typed_flags<StyleFlags> : is_typed_flags<StyleFlags, 3> {};
+}
+
+class TreeViewDropTarget;
+
+class SfxCommonTemplateDialog_Impl : public SfxListener
+{
+private:
+ class DeletionWatcher;
+ friend class DeletionWatcher;
+
+ void ReadResource();
+ void ClearResource();
+ void impl_clear();
+ DeletionWatcher* impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
+ OUString getDefaultStyleName( const SfxStyleFamily eFam );
+
+protected:
+#define MAX_FAMILIES 6
+#define COUNT_BOUND_FUNC 14
+
+ friend class SfxTemplateControllerItem;
+
+ SfxBindings* pBindings;
+ std::array<std::unique_ptr<SfxTemplateControllerItem>, COUNT_BOUND_FUNC> pBoundItems;
+
+ VclPtr<vcl::Window> pWindow;
+ std::unique_ptr<weld::Builder> mxMenuBuilder;
+ std::unique_ptr<weld::Menu> mxMenu;
+ OString sLastItemIdent;
+ SfxModule* pModule;
+ std::unique_ptr<Idle> pIdle;
+
+ std::unique_ptr<SfxStyleFamilies> pStyleFamilies;
+ std::array<std::unique_ptr<SfxTemplateItem>, MAX_FAMILIES> pFamilyState;
+ SfxStyleSheetBasePool* pStyleSheetPool;
+ SfxObjectShell* pCurObjShell;
+ css::uno::Reference<css::frame::XModuleManager2> xModuleManager;
+ DeletionWatcher* m_pDeletionWatcher;
+
+ std::unique_ptr<weld::TreeView> mxFmtLb;
+ std::unique_ptr<weld::TreeView> mxTreeBox;
+ std::unique_ptr<weld::CheckButton> mxPreviewCheckbox;
+ std::unique_ptr<weld::ComboBox> mxFilterLb;
+ std::unique_ptr<TreeViewDropTarget> m_xTreeView1DropTargetHelper;
+ std::unique_ptr<TreeViewDropTarget> m_xTreeView2DropTargetHelper;
+
+ sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
+ sal_uInt16 nActFilter; // FilterIdx
+ SfxStyleSearchBits nAppFilter; // Filter, which has set the application (for automatic)
+
+ sal_uInt16 m_nModifier;
+ bool bDontUpdate :1;
+ bool bIsWater :1;
+ bool bUpdate :1;
+ bool bUpdateFamily :1;
+ bool bCanEdit :1;
+ bool bCanDel :1;
+ bool bCanNew :1;
+ bool bCanHide :1;
+ bool bCanShow :1;
+ bool bWaterDisabled :1;
+ bool bNewByExampleDisabled :1;
+ bool bUpdateByExampleDisabled :1;
+ bool bTreeDrag :1;
+ bool bAllowReParentDrop:1;
+ bool bHierarchical :1;
+ bool m_bWantHierarchical :1;
+ bool bBindingUpdate :1;
+
+ void FmtSelect(weld::TreeView* pTreeView, bool bIsCallback);
+
+ DECL_LINK(FilterSelectHdl, weld::ComboBox&, void );
+ DECL_LINK(FmtSelectHdl, weld::TreeView&, void);
+ DECL_LINK(TreeListApplyHdl, weld::TreeView&, bool);
+ DECL_LINK(MousePressHdl, const MouseEvent&, bool);
+ DECL_LINK(TimeOut, Timer*, void );
+ DECL_LINK(PreviewHdl, weld::Button&, void);
+ DECL_LINK(PopupFlatMenuHdl, const CommandEvent&, bool);
+ DECL_LINK(PopupTreeMenuHdl, const CommandEvent&, bool);
+ DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
+ DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
+ DECL_LINK(OnAsyncExecuteDrop, void *, void);
+ DECL_LINK(DragBeginHdl, bool&, bool);
+ DECL_LINK(CustomRenderHdl, weld::TreeView::render_args, void);
+ DECL_STATIC_LINK(SfxCommonTemplateDialog_Impl, CustomGetSizeHdl, weld::TreeView::get_size_args, Size);
+
+ void DropHdl(const OUString& rStyle, const OUString& rParent);
+
+ virtual void EnableItem(const OString& /*rMesId*/, bool /*bCheck*/ = true)
+ {}
+ virtual void CheckItem(const OString& /*rMesId*/, bool /*bCheck*/ = true)
+ {}
+ virtual bool IsCheckedItem(const OString& /*rMesId*/ )
+ {
+ return true;
+ }
+
+ void InvalidateBindings();
+ virtual void InsertFamilyItem(sal_uInt16 nId, const SfxStyleFamilyItem& rItem) = 0;
+ virtual void EnableFamilyItem(sal_uInt16 nId, bool bEnabled) = 0;
+ virtual void ClearFamilyList() = 0;
+ virtual void ReplaceUpdateButtonByMenu();
+
+ void NewHdl();
+ void EditHdl();
+ void DeleteHdl();
+ void HideHdl();
+ void ShowHdl();
+
+ bool Execute_Impl(sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr,
+ sal_uInt16 nFamily, SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto,
+ sal_uInt16* pIdx = nullptr, const sal_uInt16* pModifier = nullptr );
+
+ void UpdateStyles_Impl(StyleFlags nFlags);
+ const SfxStyleFamilyItem* GetFamilyItem_Impl() const;
+ bool IsInitialized() const
+ {
+ return nActFamily != 0xffff;
+ }
+ void EnableDelete();
+ void Initialize();
+ void EnableHierarchical(bool);
+
+ void FilterSelect( sal_uInt16 nFilterIdx, bool bForce );
+ void SetFamilyState( sal_uInt16 nSlotId, const SfxTemplateItem* );
+ void SetWaterCanState( const SfxBoolItem* pItem );
+ bool IsSafeForWaterCan() const;
+
+ void SelectStyle(const OUString& rStyle, bool bIsCallback);
+ bool HasSelectedStyle() const;
+ void GetSelectedStyle() const;
+ void FillTreeBox();
+ void Update_Impl();
+ void UpdateFamily_Impl();
+
+ // In which FamilyState do I have to look, in order to get the
+ // information of the ith Family in the pStyleFamilies.
+ sal_uInt16 StyleNrToInfoOffset( sal_uInt16 i );
+
+ void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
+
+ void FamilySelect( sal_uInt16 nId, bool bPreviewRefresh = false );
+ void SetFamily(SfxStyleFamily nFamily);
+ void ActionSelect(const OString& rId);
+
+ sal_Int32 LoadFactoryStyleFilter( SfxObjectShell const * i_pObjSh );
+ void SaveFactoryStyleFilter( SfxObjectShell const * i_pObjSh, sal_Int32 i_nFilter );
+ SfxObjectShell* SaveSelection();
+
+ void PrepareMenu(const Point& rPos);
+ void ShowMenu(const CommandEvent& rCEvt);
+
+public:
+
+ SfxCommonTemplateDialog_Impl(SfxBindings* pB, vcl::Window*, weld::Builder* pBuilder);
+ virtual ~SfxCommonTemplateDialog_Impl() override;
+
+ void MenuSelect(const OString& rIdent);
+ DECL_LINK( MenuSelectAsyncHdl, void*, void );
+
+ virtual void EnableEdit( bool b )
+ {
+ bCanEdit = b;
+ }
+ void EnableDel( bool b )
+ {
+ bCanDel = b;
+ }
+ void EnableNew( bool b )
+ {
+ bCanNew = b;
+ }
+ void EnableHide( bool b )
+ {
+ bCanHide = b;
+ }
+ void EnableShow( bool b )
+ {
+ bCanShow = b;
+ }
+
+ vcl::Window* GetWindow()
+ {
+ return pWindow;
+ }
+
+ weld::Widget* GetFrameWeld()
+ {
+ return pWindow ? pWindow->GetFrameWeld() : nullptr;
+ }
+
+ void EnableTreeDrag(bool b);
+ void EnableExample_Impl(sal_uInt16 nId, bool bEnable);
+ SfxStyleFamily GetActualFamily() const;
+ OUString GetSelectedEntry() const;
+
+ SfxObjectShell* GetObjectShell() const
+ {
+ return pCurObjShell;
+ }
+
+ sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt, const DropTargetHelper& rHelper);
+ sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt);
+
+ void CreateContextMenu();
+};
+
+class ToolbarDropTarget;
+class DropTargetHelper;
+
+class SfxTemplateDialog_Impl : public SfxCommonTemplateDialog_Impl
+{
+private:
+ friend class SfxTemplateControllerItem;
+ friend class SfxTemplatePanelControl;
+
+ std::unique_ptr<ToolbarDropTarget> m_xToolbarDropTargetHelper;
+ std::unique_ptr<weld::Toolbar> m_xActionTbL;
+ std::unique_ptr<weld::Toolbar> m_xActionTbR;
+ std::unique_ptr<weld::Menu> m_xToolMenu;
+ int m_nActionTbLVisible;
+
+ void FillToolMenu();
+
+ DECL_LINK(ToolBoxLSelect, const OString&, void);
+ DECL_LINK(ToolBoxRSelect, const OString&, void);
+ DECL_LINK(ToolMenuSelectHdl, const OString&, void);
+
+protected:
+ virtual void EnableEdit( bool ) override;
+ virtual void EnableItem(const OString& rMesId, bool bCheck = true) override;
+ virtual void CheckItem(const OString& rMesId, bool bCheck = true) override;
+ virtual bool IsCheckedItem(const OString& rMesId) override;
+ virtual void InsertFamilyItem(sal_uInt16 nId, const SfxStyleFamilyItem& rItem) override;
+ virtual void EnableFamilyItem(sal_uInt16 nId, bool bEnabled) override;
+ virtual void ClearFamilyList() override;
+ virtual void ReplaceUpdateButtonByMenu() override;
+
+public:
+ friend class SfxTemplateDialog;
+
+ SfxTemplateDialog_Impl( SfxBindings*, SfxTemplatePanelControl* pDlgWindow );
+ virtual ~SfxTemplateDialog_Impl() override;
+
+ sal_Int8 AcceptToolbarDrop(const AcceptDropEvent& rEvt, const DropTargetHelper& rHelper);
+
+ void Initialize();
+};
+
+#endif // INCLUDED_SFX2_SOURCE_INC_TEMPLDGI_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/tplcitem.hxx b/sfx2/source/inc/tplcitem.hxx
new file mode 100644
index 000000000..9b13f8ce3
--- /dev/null
+++ b/sfx2/source/inc/tplcitem.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/.
+ *
+ * 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_SOURCE_INC_TPLCITEM_HXX
+#define INCLUDED_SFX2_SOURCE_INC_TPLCITEM_HXX
+
+#include <sfx2/ctrlitem.hxx>
+#include <tools/link.hxx>
+
+struct ImplSVEvent;
+class SfxCommonTemplateDialog_Impl;
+
+class SfxTemplateControllerItem : public SfxControllerItem {
+ SfxCommonTemplateDialog_Impl &rTemplateDlg;
+ sal_uInt8 nWaterCanState;
+ ImplSVEvent* nUserEventId;
+
+ DECL_LINK(SetWaterCanStateHdl_Impl, void*, void);
+
+protected:
+ virtual void StateChanged(sal_uInt16, SfxItemState, const SfxPoolItem* pState) override;
+
+public:
+ SfxTemplateControllerItem(sal_uInt16 nId, SfxCommonTemplateDialog_Impl& rDialog, SfxBindings& rBindings);
+ virtual ~SfxTemplateControllerItem() override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx
new file mode 100644
index 000000000..d486692e7
--- /dev/null
+++ b/sfx2/source/inc/versdlg.hxx
@@ -0,0 +1,94 @@
+/* -*- 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_SOURCE_INC_VERSDLG_HXX
+#define INCLUDED_SFX2_SOURCE_INC_VERSDLG_HXX
+
+#include <sfx2/basedlgs.hxx>
+#include <vcl/weld.hxx>
+
+class SfxViewFrame;
+struct SfxVersionInfo;
+
+class SfxVersionTableDtor;
+class SfxVersionDialog : public SfxDialogController
+{
+ SfxViewFrame* m_pViewFrame;
+ bool m_bIsSaveVersionOnClose;
+ std::unique_ptr<SfxVersionTableDtor> m_pTable;
+ std::unique_ptr<weld::Button> m_xSaveButton;
+ std::unique_ptr<weld::CheckButton> m_xSaveCheckBox;
+ std::unique_ptr<weld::Button> m_xOpenButton;
+ std::unique_ptr<weld::Button> m_xViewButton;
+ std::unique_ptr<weld::Button> m_xDeleteButton;
+ std::unique_ptr<weld::Button> m_xCompareButton;
+ std::unique_ptr<weld::Button> m_xCmisButton;
+ std::unique_ptr<weld::TreeView> m_xVersionBox;
+
+ DECL_LINK(DClickHdl_Impl, weld::TreeView&, bool);
+ DECL_LINK(SelectHdl_Impl, weld::TreeView&, void);
+ DECL_LINK(ButtonHdl_Impl, weld::Button&, void );
+ void Init_Impl();
+ void Open_Impl();
+
+public:
+ SfxVersionDialog(weld::Window* pParent, SfxViewFrame* pFrame, bool);
+ virtual ~SfxVersionDialog() override;
+ bool IsSaveVersionOnClose() const { return m_bIsSaveVersionOnClose; }
+};
+
+class SfxViewVersionDialog_Impl : public SfxDialogController
+{
+private:
+ SfxVersionInfo& m_rInfo;
+
+ std::unique_ptr<weld::Label> m_xDateTimeText;
+ std::unique_ptr<weld::Label> m_xSavedByText;
+ std::unique_ptr<weld::TextView> m_xEdit;
+ std::unique_ptr<weld::Button> m_xOKButton;
+ std::unique_ptr<weld::Button> m_xCancelButton;
+ std::unique_ptr<weld::Button> m_xCloseButton;
+
+ DECL_LINK(ButtonHdl, weld::Button&, void);
+
+public:
+ SfxViewVersionDialog_Impl(weld::Window *pParent, SfxVersionInfo& rInfo, bool bEdit);
+};
+
+class SfxCmisVersionsDialog : public SfxDialogController
+{
+ SfxViewFrame* m_pViewFrame;
+ std::unique_ptr<SfxVersionTableDtor> m_pTable;
+
+ std::unique_ptr<weld::Button> m_xOpenButton;
+ std::unique_ptr<weld::Button> m_xViewButton;
+ std::unique_ptr<weld::Button> m_xDeleteButton;
+ std::unique_ptr<weld::Button> m_xCompareButton;
+ std::unique_ptr<weld::TreeView> m_xVersionBox;
+
+ void LoadVersions();
+
+public:
+ SfxCmisVersionsDialog(weld::Window *pParent, SfxViewFrame* pFrame);
+ virtual ~SfxCmisVersionsDialog() override;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
new file mode 100644
index 000000000..4be765721
--- /dev/null
+++ b/sfx2/source/inc/workwin.hxx
@@ -0,0 +1,302 @@
+/* -*- 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_SOURCE_INC_WORKWIN_HXX
+#define INCLUDED_SFX2_SOURCE_INC_WORKWIN_HXX
+
+#include <vector>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/frame/XLayoutManagerListener.hpp>
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <o3tl/typed_flags_set.hxx>
+
+#include <sfx2/basedlgs.hxx>
+#include <sfx2/childwin.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/objface.hxx>
+#include <sfx2/shell.hxx>
+#include <sfx2/toolbarids.hxx>
+
+class SfxSplitWindow;
+class SfxWorkWindow;
+
+
+// This struct makes all relevant Information available of Toolboxes
+struct SfxObjectBar_Impl
+{
+ ToolbarId eId; // ConfigId of Toolbox
+ SfxVisibilityFlags nMode; // special visibility flags
+ bool bDestroy;
+
+ SfxObjectBar_Impl() :
+ eId(ToolbarId::None),
+ nMode(SfxVisibilityFlags::Invisible),
+ bDestroy(false)
+ {}
+};
+
+// This struct makes all relevant Information available of the status bar
+
+struct SfxStatBar_Impl
+{
+ StatusBarId eId;
+
+ SfxStatBar_Impl() :
+ eId(StatusBarId::None)
+ {}
+};
+
+enum class SfxChildVisibility
+{
+ NOT_VISIBLE = 0,
+ ACTIVE = 1, // not disabled through HidePopups
+ NOT_HIDDEN = 2, // not disabled through HideChildWindow
+ FITS_IN = 4, // not too large for output size of the parent
+ VISIBLE = 7, // NOT_HIDDEN | ACTIVE | FITS_IN)
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SfxChildVisibility> : is_typed_flags<SfxChildVisibility, 0x07> {};
+}
+
+
+struct SfxChild_Impl
+{
+ VclPtr<vcl::Window> pWin;
+ std::shared_ptr<SfxDialogController> xController;
+ Size aSize;
+ SfxChildAlignment eAlign;
+ SfxChildVisibility nVisible;
+ bool bResize;
+ bool bSetFocus;
+
+ SfxChild_Impl( vcl::Window& rChild, const Size& rSize,
+ SfxChildAlignment eAlignment, bool bIsVisible ):
+ pWin(&rChild), aSize(rSize), eAlign(eAlignment), bResize(false),
+ bSetFocus( false )
+ {
+ nVisible = bIsVisible ? SfxChildVisibility::VISIBLE : SfxChildVisibility::NOT_VISIBLE;
+ }
+
+ SfxChild_Impl(const std::shared_ptr<SfxDialogController>& rChild,
+ SfxChildAlignment eAlignment):
+ pWin(nullptr), xController(rChild), eAlign(eAlignment), bResize(false),
+ bSetFocus( false )
+ {
+ nVisible = xController->getDialog()->get_visible() ? SfxChildVisibility::VISIBLE : SfxChildVisibility::NOT_VISIBLE;
+ }
+};
+
+struct SfxChildWin_Impl
+{
+ sal_uInt16 nSaveId; // the ChildWindow-Id
+ sal_uInt16 nInterfaceId; // the current context
+ sal_uInt16 nId; // current Id
+ SfxChildWindow* pWin;
+ bool bCreate;
+ SfxChildWinInfo aInfo;
+ SfxChild_Impl* pCli; // != 0 at direct Children
+ SfxVisibilityFlags nVisibility;
+ bool bEnable;
+
+ SfxChildWin_Impl( sal_uInt32 nID ) :
+ nSaveId(static_cast<sal_uInt16>(nID & 0xFFFF) ),
+ nInterfaceId(static_cast<sal_uInt16>(nID >> 16)),
+ nId(nSaveId),
+ pWin(nullptr),
+ bCreate(false),
+ pCli(nullptr),
+ nVisibility( SfxVisibilityFlags::Invisible ),
+ bEnable( true )
+ {}
+};
+
+enum class SfxChildIdentifier
+{
+ DOCKINGWINDOW,
+ SPLITWINDOW
+};
+
+enum class SfxDockingConfig
+{
+ SETDOCKINGRECTS,
+ ALIGNDOCKINGWINDOW,
+ TOGGLEFLOATMODE
+};
+
+
+#define SFX_SPLITWINDOWS_LEFT 0
+#define SFX_SPLITWINDOWS_TOP 2
+#define SFX_SPLITWINDOWS_RIGHT 1
+#define SFX_SPLITWINDOWS_MAX 4
+
+
+class LayoutManagerListener : public ::cppu::WeakImplHelper<
+ css::frame::XLayoutManagerListener,
+ css::lang::XComponent >
+{
+ public:
+ LayoutManagerListener( SfxWorkWindow* pWrkWin );
+ virtual ~LayoutManagerListener() override;
+
+ void setFrame( const css::uno::Reference< css::frame::XFrame >& rFrame );
+
+
+ // XComponent
+
+ virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
+ virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
+ virtual void SAL_CALL dispose() override;
+
+
+ // XEventListener
+
+ virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override;
+
+
+ // XLayoutManagerEventListener
+
+ virtual void SAL_CALL layoutEvent( const css::lang::EventObject& aSource, ::sal_Int16 eLayoutEvent, const css::uno::Any& aInfo ) override;
+
+ private:
+ bool m_bHasFrame;
+ SfxWorkWindow* m_pWrkWin;
+ css::uno::WeakReference< css::frame::XFrame > m_xFrame;
+};
+
+class SfxWorkWindow final
+{
+ friend class LayoutManagerListener;
+
+ std::vector<sal_uInt16> aSortedList;
+ SfxStatBar_Impl aStatBar;
+ std::vector< SfxObjectBar_Impl > aObjBarList;
+ tools::Rectangle aClientArea;
+ tools::Rectangle aUpperClientArea;
+ VclPtr<SfxSplitWindow> pSplit[SFX_SPLITWINDOWS_MAX];
+ std::vector<std::unique_ptr<SfxChild_Impl>>
+ aChildren;
+ std::vector<std::unique_ptr<SfxChildWin_Impl>>
+ aChildWins;
+ SfxBindings* pBindings;
+ VclPtr<vcl::Window> pWorkWin;
+ VclPtr<vcl::Window> pActiveChild;
+ SfxVisibilityFlags nUpdateMode;
+ sal_uInt16 nChildren;
+ SfxVisibilityFlags nOrigMode;
+ bool bSorted : 1;
+ bool bDockingAllowed : 1;
+ bool bInternalDockingAllowed : 1;
+ bool bAllChildrenVisible : 1;
+ bool bIsFullScreen : 1;
+ bool bShowStatusBar : 1;
+ sal_Int32 m_nLock;
+ css::uno::Reference< css::lang::XComponent > m_xLayoutManagerListener;
+ SfxFrame* pMasterFrame;
+ SfxFrame* pFrame;
+
+ void CreateChildWin_Impl(SfxChildWin_Impl*,bool);
+ void RemoveChildWin_Impl(SfxChildWin_Impl*);
+ void Sort_Impl();
+ SfxChild_Impl* FindChild_Impl( const vcl::Window* rWindow ) const;
+ bool RequestTopToolSpacePixel_Impl( SvBorder aBorder );
+ tools::Rectangle GetTopRect_Impl() const;
+ SvBorder Arrange_Impl();
+ void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&);
+ static bool IsPluginMode( SfxObjectShell const * pObjShell );
+
+ void FlushPendingChildSizes();
+
+public:
+ SfxWorkWindow( vcl::Window* pWin, SfxFrame* pFrm, SfxFrame* pMaster );
+ ~SfxWorkWindow();
+ SfxBindings& GetBindings()
+ { return *pBindings; }
+ vcl::Window* GetWindow() const
+ { return pWorkWin; }
+ tools::Rectangle GetFreeArea( bool bAutoHide ) const;
+ void SetDockingAllowed(bool bSet)
+ { bDockingAllowed = bSet; }
+ void SetInternalDockingAllowed(bool bSet)
+ { bInternalDockingAllowed = bSet; }
+ bool IsDockingAllowed() const
+ { return bDockingAllowed; }
+ bool IsInternalDockingAllowed() const
+ { return bInternalDockingAllowed; }
+
+ // Methods for all Child windows
+ void DataChanged_Impl();
+ void ReleaseChild_Impl( vcl::Window& rWindow );
+ void ReleaseChild_Impl(SfxDialogController&);
+ SfxChild_Impl* RegisterChild_Impl( vcl::Window& rWindow, SfxChildAlignment eAlign );
+ SfxChild_Impl* RegisterChild_Impl(std::shared_ptr<SfxDialogController>& rController, SfxChildAlignment eAlign);
+ void ShowChildren_Impl();
+ void HideChildren_Impl();
+ bool PrepareClose_Impl();
+ void ArrangeChildren_Impl( bool bForce = true );
+ void DeleteControllers_Impl();
+ void HidePopups_Impl(bool bHide, sal_uInt16 nId=0);
+ void ConfigChild_Impl(SfxChildIdentifier,
+ SfxDockingConfig, sal_uInt16);
+ void MakeChildrenVisible_Impl( bool bVis );
+ void ArrangeAutoHideWindows( SfxSplitWindow *pSplit );
+ bool IsAutoHideMode( const SfxSplitWindow *pSplit );
+ void EndAutoShow_Impl( Point aPos );
+ void SetFullScreen_Impl( bool bSet ) { bIsFullScreen = bSet; }
+
+ // Methods for Objectbars
+ void UpdateObjectBars_Impl();
+ void UpdateObjectBars_Impl2();
+ void ResetObjectBars_Impl();
+ void SetObjectBar_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, ToolbarId eId);
+ bool IsVisible_Impl() const;
+ void MakeVisible_Impl( bool );
+ void Lock_Impl( bool );
+
+ // Methods for ChildWindows
+ void UpdateChildWindows_Impl();
+ void ResetChildWindows_Impl();
+ void SetChildWindowVisible_Impl( sal_uInt32, bool, SfxVisibilityFlags );
+ void ToggleChildWindow_Impl(sal_uInt16,bool);
+ bool HasChildWindow_Impl(sal_uInt16);
+ bool KnowsChildWindow_Impl(sal_uInt16);
+ void ShowChildWindow_Impl(sal_uInt16, bool bVisible, bool bSetFocus);
+ void SetChildWindow_Impl(sal_uInt16, bool bOn, bool bSetFocus);
+ SfxChildWindow* GetChildWindow_Impl(sal_uInt16);
+ void InitializeChild_Impl(SfxChildWin_Impl*);
+ SfxSplitWindow* GetSplitWindow_Impl(SfxChildAlignment);
+
+ bool IsVisible_Impl( SfxVisibilityFlags nMode ) const;
+ bool IsFloating( sal_uInt16 nId );
+ void SetActiveChild_Impl( vcl::Window *pChild );
+ const VclPtr<vcl::Window>& GetActiveChild_Impl() const { return pActiveChild; }
+
+ // Methods for StatusBar
+ void ResetStatusBar_Impl();
+ void SetStatusBar_Impl(StatusBarId eResId);
+ void UpdateStatusBar_Impl();
+ css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator();
+ css::uno::Reference< css::frame::XFrame > GetFrameInterface();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */