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 .
26 #include <sot/storage.hxx>
27 #include <tools/shl.hxx>
29 #include <svl/lstner.hxx>
30 #include <com/sun/star/text/WritingMode.hpp>
31 #include <sfx2/module.hxx>
32 #include <vcl/vclevent.hxx>
40 class SvNumberFormatter
;
41 class SfxErrorHandler
;
48 class SdGlobalResourceContainer
;
51 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{
56 // ----------------------
57 // - SdOptionStreamMode -
58 // ----------------------
60 enum SdOptionStreamMode
66 /*************************************************************************
68 |* This subclass of <SfxModule> (which is a subclass of <SfxShell>) is
69 |* linked to the DLL. One instance of this class exists while the DLL is
72 |* SdModule is like to be compared with the <SfxApplication>-subclass.
74 |* Remember: Don`t export this class! It uses DLL-internal symbols.
76 \************************************************************************/
78 class SdModule
: public SfxModule
, public SfxListener
83 SFX_DECL_INTERFACE(SD_IF_SDAPP
)
84 DECL_LINK( CalcFieldValueHdl
, EditFieldInfo
* );
86 SdModule(SfxObjectFactory
* pDrawObjFact
, SfxObjectFactory
* pGraphicObjFact
);
89 SdTransferable
* pTransferClip
;
90 SdTransferable
* pTransferDrag
;
91 SdTransferable
* pTransferSelection
;
93 void Execute(SfxRequest
& rReq
);
94 void GetState(SfxItemSet
&);
96 SdOptions
* GetSdOptions(DocumentType eDocType
);
97 SD_DLLPUBLIC SvStorageStreamRef
GetOptionStream( const String
& rOptionName
, SdOptionStreamMode eMode
);
99 sal_Bool
GetWaterCan() const { return bWaterCan
; }
100 void SetWaterCan( sal_Bool bWC
) { bWaterCan
= bWC
; }
102 SvxSearchItem
* GetSearchItem() { return (pSearchItem
); }
103 void SetSearchItem(SvxSearchItem
* pItem
) { pSearchItem
= pItem
; }
105 /** Return the virtual device that can be used for printer independent
108 The returned pointer is NULL when the device could not be
109 created when this modules was instantiated.
111 OutputDevice
* GetVirtualRefDevice (void);
113 /** Deprecated alias to <member>GetVirtualRefDevice</member>.
115 Unused dummy parameter.
117 OutputDevice
* GetRefDevice (::sd::DrawDocShell
& rDocShell
);
119 SD_DLLPUBLIC SvNumberFormatter
* GetNumberFormatter();
121 // virtual methods for the option dialog
122 virtual SfxItemSet
* CreateItemSet( sal_uInt16 nId
);
123 virtual void ApplyItemSet( sal_uInt16 nId
, const SfxItemSet
& rSet
);
124 virtual SfxTabPage
* CreateTabPage( sal_uInt16 nId
, Window
* pParent
, const SfxItemSet
& rSet
);
128 SdOptions
* pImpressOptions
;
129 SdOptions
* pDrawOptions
;
130 SvxSearchItem
* pSearchItem
;
131 SvNumberFormatter
* pNumberFormatter
;
132 SvStorageRef xOptionStorage
;
135 SfxErrorHandler
* mpErrorHdl
;
136 /** This device is used for printer independent layout. It is virtual
137 in the sense that it does not represent a printer. The pointer may
138 be NULL when the virtual device could not be created.
140 OutputDevice
* mpVirtualRefDevice
;
142 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
145 SfxFrame
* ExecuteNewDocument( SfxRequest
& rReq
);
147 static void ChangeMedium( ::sd::DrawDocShell
* pDocShell
, SfxViewFrame
* pViewFrame
, const sal_Int32 eMedium
);
148 static SfxFrame
* CreateEmptyDocument( DocumentType eDocType
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rFrame
);
149 static SfxFrame
* CreateFromTemplate( const String
& rTemplatePath
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rFrame
);
151 /** The resource container controls the lifetime of some singletons.
153 ::std::auto_ptr
< ::sd::SdGlobalResourceContainer
> mpResourceContainer
;
155 /** Create a new summary page. When the document has been created in
156 the kiosk mode with automatical transitions then this method adds
157 this kind of transition to the new summary page.
159 The view frame that is used to execute the slot for creating the
162 The document which will contain the summary page and from which
163 the information about the default transition is retrieved.
165 void AddSummaryPage (SfxViewFrame
* pViewFrame
, SdDrawDocument
* pDocument
);
167 /** Take an outline from a text document and create a new impress
168 document according to the structure of the outline.
170 This typically is the unmodified request from a execute()
171 function from where this function is called.
173 void OutlineToImpress (SfxRequest
& rRequest
);
175 /** Add an eventlistener as soon as possible in sd, allows to use
176 remote devices to start the slideshow elegantly, and respecting
179 The event listener handler
181 a poiter to a VCLSimpleEvent (see vcl/vclevent.hxx )
183 DECL_LINK( EventListenerHdl
, VclSimpleEvent
* );
187 #define SD_MOD() ( *(SdModule**) GetAppData(SHL_DRAW) )
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */