CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / inc / sdmod.hxx
blobef673fdea0c75ae4b47df8f583950e9b2bfc1018
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 ************************************************************************/
28 #ifndef _SDMOD_HXX
29 #define _SDMOD_HXX
32 #ifndef _SDDLL_HXX
33 #define _SD_DLL // fuer SD_MOD()
34 #include "sddll.hxx" // fuer SdModuleDummy
35 #endif
36 #include "glob.hxx"
37 #include "pres.hxx"
39 #include <sot/storage.hxx>
40 #include <tools/shl.hxx>
41 #include "sddllapi.h"
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
48 #include <memory>
49 #define INCLUDED_MEMORY
50 #endif
52 class SdOptions;
53 class BasicIDE;
54 class SvxSearchItem;
55 class SdAppLinkHdl;
56 class SvxErrorHandler;
57 class EditFieldInfo;
58 class SvFactory;
59 class SdTransferable;
60 class SvNumberFormatter;
61 class SfxErrorHandler;
62 class OutputDevice;
63 class SdPage;
64 class SdDrawDocument;
65 class SfxFrame;
67 namespace sd {
68 class DrawDocShell;
69 class SdGlobalResourceContainer;
72 namespace com { namespace sun { namespace star { namespace frame {
73 class XFrame;
74 } } } }
77 // ----------------------
78 // - SdOptionStreamMode -
79 // ----------------------
81 enum SdOptionStreamMode
83 SD_OPTION_LOAD = 0,
84 SD_OPTION_STORE = 1
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
91 |* loaded.
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
101 public:
103 TYPEINFO();
104 SFX_DECL_INTERFACE(SD_IF_SDAPP)
105 DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
107 SdModule(SfxObjectFactory* pDrawObjFact, SfxObjectFactory* pGraphicObjFact);
108 virtual ~SdModule();
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
127 layout.
128 @return
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>.
135 @param rDocShell
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 );
147 protected:
149 SdOptions* pImpressOptions;
150 SdOptions* pDrawOptions;
151 SvxSearchItem* pSearchItem;
152 SvNumberFormatter* pNumberFormatter;
153 SvStorageRef xOptionStorage;
154 sal_Bool bAutoSave;
155 sal_Bool bWaterCan;
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 );
165 private:
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.
179 @param pViewFrame
180 The view frame that is used to execute the slot for creating the
181 summary page.
182 @param pDocument
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.
190 @param rRequest
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
198 portability
199 @EventListenerHdl
200 The event listener handler
201 @VclSimpleEvent *
202 a poiter to a VCLSimpleEvent (see vcl/vclevent.hxx )
204 DECL_LINK( EventListenerHdl, VclSimpleEvent* );
211 #ifndef SD_MOD
212 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )
213 #endif
215 #endif // _SDMOD_HXX