1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_INC_SDMOD_HXX
21 #define INCLUDED_SD_INC_SDMOD_HXX
26 #include <sot/storage.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>
41 class SvNumberFormatter
;
42 class SfxErrorHandler
;
44 struct SfxItemPropertyMapEntry
;
45 namespace svtools
{ class ColorConfig
; }
47 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
51 enum SdOptionStreamMode
57 typedef std::map
< SfxItemPropertyMapEntry
const * , css::uno::Reference
<css::beans::XPropertySetInfo
> > SdExtPropertySetInfoCache
;
58 typedef std::map
< sal_uInt32
, css::uno::Sequence
< css::uno::Type
> > SdTypesCache
;
62 This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
63 linked to the DLL. One instance of this class exists while the DLL is
66 SdModule is like to be compared with the <SfxApplication>-subclass.
68 Remember: Don`t export this class! It uses DLL-internal symbols.
72 class SAL_DLLPUBLIC_RTTI SdModule final
: public SfxModule
, public SfxListener
75 SFX_DECL_INTERFACE(SD_IF_SDAPP
)
76 DECL_LINK( CalcFieldValueHdl
, EditFieldInfo
*, void );
79 /// SfxInterface initializer.
80 static void InitInterface_Impl();
83 SdModule(SfxObjectFactory
* pDrawObjFact
, SfxObjectFactory
* pGraphicObjFact
);
84 virtual ~SdModule() override
;
86 SdTransferable
* pTransferClip
;
87 SdTransferable
* pTransferDrag
;
88 SdTransferable
* pTransferSelection
;
90 void Execute(SfxRequest
& rReq
);
91 void GetState(SfxItemSet
&);
93 SdOptions
* GetSdOptions(DocumentType eDocType
);
94 SD_DLLPUBLIC
tools::SvRef
<SotStorageStream
> GetOptionStream( const OUString
& rOptionName
, SdOptionStreamMode eMode
);
96 bool GetWaterCan() const { return bWaterCan
; }
97 void SetWaterCan( bool bWC
) { bWaterCan
= bWC
; }
99 SvxSearchItem
* GetSearchItem() { return pSearchItem
.get(); }
100 void SetSearchItem(std::unique_ptr
<SvxSearchItem
> pItem
);
102 /** Return the virtual device that can be used for printer independent
105 The returned pointer is NULL when the device could not be
106 created when this modules was instantiated.
108 OutputDevice
* GetVirtualRefDevice() { return mpVirtualRefDevice
;}
110 SD_DLLPUBLIC SvNumberFormatter
* GetNumberFormatter();
112 // virtual methods for the option dialog
113 virtual std::unique_ptr
<SfxItemSet
> CreateItemSet( sal_uInt16 nId
) override
;
114 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
) override
;
115 virtual VclPtr
<SfxTabPage
> CreateTabPage( sal_uInt16 nId
, TabPageParent pParent
, const SfxItemSet
& rSet
) override
;
116 virtual std::unique_ptr
<SfxStyleFamilies
> CreateStyleFamilies() override
;
118 SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache
;
119 SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache
;
120 SdTypesCache gImplTypesCache
;
122 svtools::ColorConfig
& GetColorConfig();
126 SdOptions
* pImpressOptions
;
127 SdOptions
* pDrawOptions
;
128 std::unique_ptr
<SvxSearchItem
> pSearchItem
;
129 std::unique_ptr
<SvNumberFormatter
> pNumberFormatter
;
130 tools::SvRef
<SotStorage
> xOptionStorage
;
132 std::unique_ptr
<SfxErrorHandler
> mpErrorHdl
;
133 /** This device is used for printer independent layout. It is virtual
134 in the sense that it does not represent a printer. The pointer may
135 be NULL when the virtual device could not be created.
137 VclPtr
< VirtualDevice
> mpVirtualRefDevice
;
139 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
141 SfxFrame
* ExecuteNewDocument( SfxRequest
const & rReq
);
143 static SfxFrame
* CreateEmptyDocument( const css::uno::Reference
< css::frame::XFrame
>& i_rFrame
);
144 static SfxFrame
* CreateFromTemplate( const OUString
& rTemplatePath
, const css::uno::Reference
< css::frame::XFrame
>& i_rFrame
);
146 bool mbEventListenerAdded
;
148 /** Take an outline from a text document and create a new impress
149 document according to the structure of the outline.
151 This typically is the unmodified request from a execute()
152 function from where this function is called.
154 static bool OutlineToImpress(SfxRequest
const & rRequest
);
156 /** Add an eventlistener as soon as possible in sd, allows to use
157 remote devices to start the slideshow elegantly, and respecting
160 The event listener handler
162 a pointer to a VCLSimpleEvent (see vcl/vclevent.hxx )
164 DECL_STATIC_LINK( SdModule
, EventListenerHdl
, VclSimpleEvent
&, void );
166 std::unique_ptr
<svtools::ColorConfig
> mpColorConfig
;
169 #define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) )
171 #endif // INCLUDED_SD_INC_SDMOD_HXX
173 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */