sync master with lastest vba changes
[ooovba.git] / sd / inc / sdmod.hxx
blob4ed2b6a64f49dbc5afaae705fd54e3ff07c82012
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdmod.hxx,v $
10 * $Revision: 1.27 $
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 ************************************************************************/
31 #ifndef _SDMOD_HXX
32 #define _SDMOD_HXX
35 #ifndef _SDDLL_HXX
36 #define _SD_DLL // fuer SD_MOD()
37 #include "sddll.hxx" // fuer SdModuleDummy
38 #endif
39 #include "glob.hxx"
40 #include "pres.hxx"
42 #include <sot/storage.hxx>
43 #include <tools/shl.hxx>
44 #include "sddllapi.h"
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
51 #include <memory>
52 #define INCLUDED_MEMORY
53 #endif
55 class SdOptions;
56 class BasicIDE;
57 class SvxSearchItem;
58 class SdAppLinkHdl;
59 class SvxErrorHandler;
60 class EditFieldInfo;
61 class SvFactory;
62 class SdTransferable;
63 class SvNumberFormatter;
64 class SfxErrorHandler;
65 class OutputDevice;
66 class SdPage;
67 class SdDrawDocument;
68 class SfxFrame;
70 namespace sd {
71 class DrawDocShell;
72 class SdGlobalResourceContainer;
75 // ----------------------
76 // - SdOptionStreamMode -
77 // ----------------------
79 enum SdOptionStreamMode
81 SD_OPTION_LOAD = 0,
82 SD_OPTION_STORE = 1
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
89 |* loaded.
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
99 public:
101 TYPEINFO();
102 SFX_DECL_INTERFACE(SD_IF_SDAPP)
103 DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
105 SdModule(SfxObjectFactory* pDrawObjFact, SfxObjectFactory* pGraphicObjFact);
106 virtual ~SdModule();
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
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 ::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 );
149 protected:
151 SdOptions* pImpressOptions;
152 SdOptions* pDrawOptions;
153 SvxSearchItem* pSearchItem;
154 SvNumberFormatter* pNumberFormatter;
155 SvStorageRef xOptionStorage;
156 BOOL bAutoSave;
157 BOOL bWaterCan;
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 );
167 private:
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.
181 @param pViewFrame
182 The view frame that is used to execute the slot for creating the
183 summary page.
184 @param pDocument
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.
192 @param rRequest
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
200 portability
201 @EventListenerHdl
202 The event listener handler
203 @VclSimpleEvent *
204 a poiter to a VCLSimpleEvent (see vcl/vclevent.hxx )
206 DECL_LINK( EventListenerHdl, VclSimpleEvent* );
213 #ifndef SD_MOD
214 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )
215 #endif
217 #endif // _SDMOD_HXX