1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
33 #define _SD_DLL // fuer SD_MOD()
34 #include "sddll.hxx" // fuer SdModuleDummy
39 #include <sot/storage.hxx>
40 #include <tools/shl.hxx>
42 #include <svl/lstner.hxx>
43 #include <com/sun/star/text/WritingMode.hpp>
44 #include <sfx2/module.hxx>
45 #include <vcl/vclevent.hxx>
47 #ifndef INCLUDED_MEMORY
49 #define INCLUDED_MEMORY
56 class SvxErrorHandler
;
60 class SvNumberFormatter
;
61 class SfxErrorHandler
;
69 class SdGlobalResourceContainer
;
72 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
77 // ----------------------
78 // - SdOptionStreamMode -
79 // ----------------------
81 enum SdOptionStreamMode
87 /*************************************************************************
89 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
90 |* linked to the DLL. One instance of this class exists while the DLL is
93 |* SdModule is like to be compared with the <SfxApplication>-subclass.
95 |* Remember: Don`t export this class! It uses DLL-internal symbols.
97 \************************************************************************/
99 class SdModule
: public SfxModule
, public SfxListener
104 SFX_DECL_INTERFACE(SD_IF_SDAPP
)
105 DECL_LINK( CalcFieldValueHdl
, EditFieldInfo
* );
107 SdModule(SfxObjectFactory
* pDrawObjFact
, SfxObjectFactory
* pGraphicObjFact
);
110 SdTransferable
* pTransferClip
;
111 SdTransferable
* pTransferDrag
;
112 SdTransferable
* pTransferSelection
;
114 void Execute(SfxRequest
& rReq
);
115 void GetState(SfxItemSet
&);
117 SdOptions
* GetSdOptions(DocumentType eDocType
);
118 SD_DLLPUBLIC SvStorageStreamRef
GetOptionStream( const String
& rOptionName
, SdOptionStreamMode eMode
);
120 sal_Bool
GetWaterCan() const { return bWaterCan
; }
121 void SetWaterCan( sal_Bool bWC
) { bWaterCan
= bWC
; }
123 SvxSearchItem
* GetSearchItem() { return (pSearchItem
); }
124 void SetSearchItem(SvxSearchItem
* pItem
) { pSearchItem
= pItem
; }
126 /** Return the virtual device that can be used for printer independent
129 The returned pointer is NULL when the device could not be
130 created when this modules was instantiated.
132 OutputDevice
* GetVirtualRefDevice (void);
134 /** Deprecated alias to <member>GetVirtualRefDevice</member>.
136 Unused dummy parameter.
138 OutputDevice
* GetRefDevice (::sd::DrawDocShell
& rDocShell
);
140 SD_DLLPUBLIC SvNumberFormatter
* GetNumberFormatter();
142 //virtuelle Methoden fuer den Optionendialog
143 virtual SfxItemSet
* CreateItemSet( sal_uInt16 nId
);
144 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
);
145 virtual SfxTabPage
* CreateTabPage( sal_uInt16 nId
, Window
* pParent
, const SfxItemSet
& rSet
);
149 SdOptions
* pImpressOptions
;
150 SdOptions
* pDrawOptions
;
151 SvxSearchItem
* pSearchItem
;
152 SvNumberFormatter
* pNumberFormatter
;
153 SvStorageRef xOptionStorage
;
156 SfxErrorHandler
* mpErrorHdl
;
157 /** This device is used for printer independent layout. It is virtual
158 in the sense that it does not represent a printer. The pointer may
159 be NULL when the virtual device could not be created.
161 OutputDevice
* mpVirtualRefDevice
;
163 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
166 SfxFrame
* ExecuteNewDocument( SfxRequest
& rReq
);
168 static void ChangeMedium( ::sd::DrawDocShell
* pDocShell
, SfxViewFrame
* pViewFrame
, const sal_Int32 eMedium
);
169 static SfxFrame
* CreateEmptyDocument( DocumentType eDocType
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rFrame
);
170 static SfxFrame
* CreateFromTemplate( const String
& rTemplatePath
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rFrame
);
172 /** The resource container controls the lifetime of some singletons.
174 ::std::auto_ptr
< ::sd::SdGlobalResourceContainer
> mpResourceContainer
;
176 /** Create a new summary page. When the document has been created in
177 the kiosk mode with automatical transitions then this method adds
178 this kind of transition to the new summary page.
180 The view frame that is used to execute the slot for creating the
183 The document which will contain the summary page and from which
184 the information about the default transition is retrieved.
186 void AddSummaryPage (SfxViewFrame
* pViewFrame
, SdDrawDocument
* pDocument
);
188 /** Take an outline from a text document and create a new impress
189 document according to the structure of the outline.
191 This typically is the unmodified request from a execute()
192 function from where this function is called.
194 void OutlineToImpress (SfxRequest
& rRequest
);
196 /** Add an eventlistener as soon as possible in sd, allows to use
197 remote devices to start the slideshow elegantly, and respecting
200 The event listener handler
202 a poiter to a VCLSimpleEvent (see vcl/vclevent.hxx )
204 DECL_LINK( EventListenerHdl
, VclSimpleEvent
* );
212 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )