1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdmod.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
36 #define _SD_DLL // fuer SD_MOD()
37 #include "sddll.hxx" // fuer SdModuleDummy
42 #include <sot/storage.hxx>
43 #include <tools/shl.hxx>
45 #include <svtools/lstner.hxx>
46 #include <com/sun/star/text/WritingMode.hpp>
47 #include <sfx2/module.hxx>
48 #include <vcl/vclevent.hxx>
50 #ifndef INCLUDED_MEMORY
52 #define INCLUDED_MEMORY
59 class SvxErrorHandler
;
63 class SvNumberFormatter
;
64 class SfxErrorHandler
;
72 class SdGlobalResourceContainer
;
75 // ----------------------
76 // - SdOptionStreamMode -
77 // ----------------------
79 enum SdOptionStreamMode
85 /*************************************************************************
87 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
88 |* linked to the DLL. One instance of this class exists while the DLL is
91 |* SdModule is like to be compared with the <SfxApplication>-subclass.
93 |* Remember: Don`t export this class! It uses DLL-internal symbols.
95 \************************************************************************/
97 class SdModule
: public SfxModule
, public SfxListener
102 SFX_DECL_INTERFACE(SD_IF_SDAPP
)
103 DECL_LINK( CalcFieldValueHdl
, EditFieldInfo
* );
105 SdModule(SfxObjectFactory
* pDrawObjFact
, SfxObjectFactory
* pGraphicObjFact
);
108 SdTransferable
* pTransferClip
;
109 SdTransferable
* pTransferDrag
;
110 SdTransferable
* pTransferSelection
;
112 void Execute(SfxRequest
& rReq
);
113 void GetState(SfxItemSet
&);
115 virtual void FillStatusBar(StatusBar
& rBar
);
117 SdOptions
* GetSdOptions(DocumentType eDocType
);
118 SD_DLLPUBLIC SvStorageStreamRef
GetOptionStream( const String
& rOptionName
, SdOptionStreamMode eMode
);
120 BOOL
GetWaterCan() const { return bWaterCan
; }
121 void SetWaterCan( 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 ::com::sun::star::text::WritingMode
GetDefaultWritingMode() const;
144 //virtuelle Methoden fuer den Optionendialog
145 virtual SfxItemSet
* CreateItemSet( USHORT nId
);
146 virtual void ApplyItemSet( USHORT nId
, const SfxItemSet
& rSet
);
147 virtual SfxTabPage
* CreateTabPage( USHORT nId
, Window
* pParent
, const SfxItemSet
& rSet
);
151 SdOptions
* pImpressOptions
;
152 SdOptions
* pDrawOptions
;
153 SvxSearchItem
* pSearchItem
;
154 SvNumberFormatter
* pNumberFormatter
;
155 SvStorageRef xOptionStorage
;
158 SfxErrorHandler
* mpErrorHdl
;
159 /** This device is used for printer independent layout. It is virtual
160 in the sense that it does not represent a printer. The pointer may
161 be NULL when the virtual device could not be created.
163 OutputDevice
* mpVirtualRefDevice
;
165 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
168 SfxFrame
* ExecuteNewDocument( SfxRequest
& rReq
);
170 static void ChangeMedium( ::sd::DrawDocShell
* pDocShell
, SfxViewFrame
* pViewFrame
, const sal_Int32 eMedium
);
171 static SfxFrame
* CreateEmptyDocument( DocumentType eDocType
, SfxFrame
* pTargetFrame
= 0 );
172 static SfxFrame
* CreateFromTemplate( const String
& rTemplatePath
, SfxFrame
* pTargetFrame
= 0 );
174 /** The resource container controls the lifetime of some singletons.
176 ::std::auto_ptr
< ::sd::SdGlobalResourceContainer
> mpResourceContainer
;
178 /** Create a new summary page. When the document has been created in
179 the kiosk mode with automatical transitions then this method adds
180 this kind of transition to the new summary page.
182 The view frame that is used to execute the slot for creating the
185 The document which will contain the summary page and from which
186 the information about the default transition is retrieved.
188 void AddSummaryPage (SfxViewFrame
* pViewFrame
, SdDrawDocument
* pDocument
);
190 /** Take an outline from a text document and create a new impress
191 document according to the structure of the outline.
193 This typically is the unmodified request from a execute()
194 function from where this function is called.
196 void OutlineToImpress (SfxRequest
& rRequest
);
198 /** Add an eventlistener as soon as possible in sd, allows to use
199 remote devices to start the slideshow elegantly, and respecting
202 The event listener handler
204 a poiter to a VCLSimpleEvent (see vcl/vclevent.hxx )
206 DECL_LINK( EventListenerHdl
, VclSimpleEvent
* );
214 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )