LibreOffice Module sd (master) 1
sdmod.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include "glob.hxx"
23#include "pres.hxx"
24
25#include <sot/storage.hxx>
26#include "sddllapi.h"
27#include <svl/itemprop.hxx>
28#include <svl/lstner.hxx>
29#include <com/sun/star/beans/XPropertySetInfo.hpp>
30#include <sfx2/app.hxx>
31#include <sfx2/module.hxx>
32#include <sal/types.h>
33#include <vcl/virdev.hxx>
34#include <o3tl/span.hxx>
35#include <map>
36#include <memory>
37#include <string_view>
38
39class SdOptions;
40class SvxSearchItem;
41class EditFieldInfo;
42class SdTransferable;
44class SfxErrorHandler;
45class SfxFrame;
46class VclSimpleEvent;
47namespace svtools { class ColorConfig; }
48enum class SdrObjKind : sal_uInt16;
49
50namespace com::sun::star::frame {
51 class XFrame;
52}
53
55{
56 Load = 0,
57 Store = 1
58};
59
61{
63 {
64 return lhs.data() < rhs.data();
65 }
66};
67typedef std::map<
69 css::uno::Reference<css::beans::XPropertySetInfo>,
71typedef std::map< SdrObjKind, css::uno::Sequence< css::uno::Type> > SdTypesCache;
72
73/*
74
75 This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
76 linked to the DLL. One instance of this class exists while the DLL is
77 loaded.
78
79 SdModule is like to be compared with the <SfxApplication>-subclass.
80
81 Remember: Don`t export this class! It uses DLL-internal symbols.
82
83*/
84
85class SAL_DLLPUBLIC_RTTI SdModule final : public SfxModule, public SfxListener
86{
87public:
89 DECL_DLLPRIVATE_LINK( CalcFieldValueHdl, EditFieldInfo*, void );
90
91private:
93 static void InitInterface_Impl();
94
95public:
96 SdModule(SfxObjectFactory* pDrawObjFact, SfxObjectFactory* pGraphicObjFact);
97 virtual ~SdModule() override;
98
99 SdTransferable* pTransferClip;
100 SdTransferable* pTransferDrag;
101 SdTransferable* pTransferSelection;
102
103 void Execute(SfxRequest& rReq);
104 void GetState(SfxItemSet&);
105
106 SdOptions* GetSdOptions(DocumentType eDocType);
107 SD_DLLPUBLIC tools::SvRef<SotStorageStream> GetOptionStream( std::u16string_view rOptionName, SdOptionStreamMode eMode );
108
109 bool GetWaterCan() const { return bWaterCan; }
110 void SetWaterCan( bool bWC ) { bWaterCan = bWC; }
111
112 SvxSearchItem* GetSearchItem() { return pSearchItem.get(); }
113 void SetSearchItem(std::unique_ptr<SvxSearchItem> pItem);
114
121 OutputDevice* GetVirtualRefDevice() { return mpVirtualRefDevice;}
122
123 SD_DLLPUBLIC SvNumberFormatter* GetNumberFormatter();
124
125 // virtual methods for the option dialog
126 virtual std::optional<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
127 virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
128 virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet ) override;
129 virtual std::optional<SfxStyleFamilies> CreateStyleFamilies() override;
130
134
135 svtools::ColorConfig& GetColorConfig();
136
137private:
138
141 std::unique_ptr<SvxSearchItem> pSearchItem;
142 std::unique_ptr<SvNumberFormatter> pNumberFormatter;
145 std::unique_ptr<SfxErrorHandler> mpErrorHdl;
151
152 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
153
154 SfxFrame* ExecuteNewDocument( SfxRequest const & rReq );
155
156 static SfxFrame* CreateEmptyDocument( const css::uno::Reference< css::frame::XFrame >& i_rFrame );
157 static SfxFrame* CreateFromTemplate(const OUString& rTemplatePath,
158 const css::uno::Reference<css::frame::XFrame>& i_rFrame,
159 const bool bReplaceable);
160
162
169 static bool OutlineToImpress(SfxRequest const & rRequest);
170
180
181 std::unique_ptr<svtools::ColorConfig> mpColorConfig;
182};
183
184#define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) )
185
186/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxSearchItem * GetSearchItem()
Definition: sdmod.hxx:112
std::unique_ptr< SvNumberFormatter > pNumberFormatter
Definition: sdmod.hxx:142
bool bWaterCan
Definition: sdmod.hxx:144
SdOptions * pDrawOptions
Definition: sdmod.hxx:140
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache
Definition: sdmod.hxx:132
SdTypesCache gImplTypesCache
Definition: sdmod.hxx:133
DECL_DLLPRIVATE_STATIC_LINK(SdModule, EventListenerHdl, VclSimpleEvent &, void)
Add an eventlistener as soon as possible in sd, allows to use remote devices to start the slideshow e...
VclPtr< VirtualDevice > mpVirtualRefDevice
This device is used for printer independent layout.
Definition: sdmod.hxx:150
OutputDevice * GetVirtualRefDevice()
Return the virtual device that can be used for printer independent layout.
Definition: sdmod.hxx:121
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache
Definition: sdmod.hxx:131
tools::SvRef< SotStorage > xOptionStorage
Definition: sdmod.hxx:143
bool mbEventListenerAdded
Definition: sdmod.hxx:161
std::unique_ptr< SfxErrorHandler > mpErrorHdl
Definition: sdmod.hxx:145
void SetWaterCan(bool bWC)
Definition: sdmod.hxx:110
std::unique_ptr< svtools::ColorConfig > mpColorConfig
Definition: sdmod.hxx:181
SdOptions * pImpressOptions
Definition: sdmod.hxx:139
std::unique_ptr< SvxSearchItem > pSearchItem
Definition: sdmod.hxx:141
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
virtual std::optional< SfxStyleFamilies > CreateStyleFamilies()
virtual std::unique_ptr< SfxTabPage > CreateTabPage(sal_uInt16 nId, weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet)
virtual std::optional< SfxItemSet > CreateItemSet(sal_uInt16 nId)
constexpr pointer data() const noexcept
#define SD_IF_SDAPP
Definition: glob.hxx:24
@ ColorConfig
DocumentType
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
std::map< SdrObjKind, css::uno::Sequence< css::uno::Type > > SdTypesCache
Definition: sdmod.hxx:71
std::map< o3tl::span< SfxItemPropertyMapEntry const >, css::uno::Reference< css::beans::XPropertySetInfo >, SdExtPropertySetInfoCacheCompare > SdExtPropertySetInfoCache
Definition: sdmod.hxx:70
SdOptionStreamMode
Definition: sdmod.hxx:55
#define SFX_DECL_INTERFACE(nId)
bool operator()(const o3tl::span< SfxItemPropertyMapEntry const > &lhs, const o3tl::span< SfxItemPropertyMapEntry const > &rhs) const
Definition: sdmod.hxx:62
SdrObjKind