1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SD_SlideShowImpl_HXX_
25cdf0e10cSrcweir #define _SD_SlideShowImpl_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp"
29cdf0e10cSrcweir #include "cppuhelper/compbase1.hxx"
30cdf0e10cSrcweir #include "cppuhelper/compbase2.hxx"
31cdf0e10cSrcweir #include "cppuhelper/basemutex.hxx"
32cdf0e10cSrcweir #include "cppuhelper/propertysetmixin.hxx"
33cdf0e10cSrcweir #include <com/sun/star/awt/XActivateListener.hpp>
34cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShow.hpp>
35cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShowView.hpp>
36cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShowListener.hpp>
37cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShowController.hpp>
38cdf0e10cSrcweir #include "com/sun/star/presentation/XShapeEventListener.hpp"
39cdf0e10cSrcweir #include <com/sun/star/awt/WindowEvent.hpp>
40cdf0e10cSrcweir #include <com/sun/star/awt/XWindowListener.hpp>
41cdf0e10cSrcweir #include <com/sun/star/awt/XWindow.hpp>
42cdf0e10cSrcweir #include <com/sun/star/awt/XWindowPeer.hpp>
43cdf0e10cSrcweir #include <com/sun/star/util/XModifyListener.hpp>
44cdf0e10cSrcweir #include <com/sun/star/awt/XPaintListener.hpp>
45cdf0e10cSrcweir #include <com/sun/star/awt/XPointer.hpp>
46cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
47cdf0e10cSrcweir #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
48cdf0e10cSrcweir #include <com/sun/star/presentation/ClickAction.hpp>
49cdf0e10cSrcweir #include <com/sun/star/media/XManager.hpp>
50cdf0e10cSrcweir #include <com/sun/star/media/XPlayer.hpp>
51cdf0e10cSrcweir 
52cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx>
55cdf0e10cSrcweir #include <basegfx/tools/canvastools.hxx>
56cdf0e10cSrcweir #include <vcl/help.hxx>
57cdf0e10cSrcweir #include <tools/urlobj.hxx>
58cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
59cdf0e10cSrcweir #include <unotools/saveopt.hxx>
60cdf0e10cSrcweir #include <sfx2/bindings.hxx>
61cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
62cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
63cdf0e10cSrcweir #include <basic/sbstar.hxx>
64cdf0e10cSrcweir #include <svx/svdpagv.hxx>
65cdf0e10cSrcweir #include <svx/fmshell.hxx>
66cdf0e10cSrcweir 
67cdf0e10cSrcweir #ifndef _SVX_SVXIDS_HRC
68cdf0e10cSrcweir #include <svx/svxids.hrc>
69cdf0e10cSrcweir #endif
70cdf0e10cSrcweir #include "sdmod.hxx"
71cdf0e10cSrcweir #include "cusshow.hxx"
72cdf0e10cSrcweir #include "ViewShellBase.hxx"
73cdf0e10cSrcweir #include "PresentationViewShell.hxx"
74cdf0e10cSrcweir #include "ViewShell.hxx"
75cdf0e10cSrcweir #include "drawview.hxx"
76cdf0e10cSrcweir #include "drawdoc.hxx"
77cdf0e10cSrcweir 
78cdf0e10cSrcweir #include "showwindow.hxx"
79cdf0e10cSrcweir 
80cdf0e10cSrcweir #include "optsitem.hxx"
81cdf0e10cSrcweir #include "FrameView.hxx"
82cdf0e10cSrcweir #include "DrawDocShell.hxx"
83cdf0e10cSrcweir 
84cdf0e10cSrcweir #ifndef _SD_APP_HRC_
85cdf0e10cSrcweir #include "app.hrc"
86cdf0e10cSrcweir #endif
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #include "slideshow.hxx"
89cdf0e10cSrcweir 
90cdf0e10cSrcweir class SfxViewFrame;
91cdf0e10cSrcweir class SfxRequest;
92cdf0e10cSrcweir 
93cdf0e10cSrcweir namespace css = ::com::sun::star;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir namespace sd
96cdf0e10cSrcweir {
97cdf0e10cSrcweir class SlideShowView;
98cdf0e10cSrcweir class AnimationSlideController;
99cdf0e10cSrcweir class PaneHider;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir // --------------------------------------------------------------------
102cdf0e10cSrcweir 
103cdf0e10cSrcweir struct PresentationSettingsEx : public PresentationSettings
104cdf0e10cSrcweir {
105cdf0e10cSrcweir 	sal_Bool mbRehearseTimings;
106cdf0e10cSrcweir 	sal_Bool mbPreview;
107cdf0e10cSrcweir 	::Window* mpParentWindow;
108cdf0e10cSrcweir 	css::uno::Reference< css::drawing::XDrawPage > mxStartPage;
109cdf0e10cSrcweir 	css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	PresentationSettingsEx( const PresentationSettingsEx& );
112cdf0e10cSrcweir 	PresentationSettingsEx( PresentationSettings& );
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	void SetArguments( const css::uno::Sequence< css::beans::PropertyValue >& rArguments ) throw (css::lang::IllegalArgumentException);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	void SetPropertyValue( const ::rtl::OUString& rProperty, const css::uno::Any& rValue ) throw (css::lang::IllegalArgumentException);
117cdf0e10cSrcweir };
118cdf0e10cSrcweir 
119cdf0e10cSrcweir // --------------------------------------------------------------------
120cdf0e10cSrcweir 
121cdf0e10cSrcweir struct WrappedShapeEventImpl
122cdf0e10cSrcweir {
123cdf0e10cSrcweir 	css::presentation::ClickAction meClickAction;
124cdf0e10cSrcweir 	sal_Int32 mnVerb;
125cdf0e10cSrcweir 	::rtl::OUString maStrBookmark;
WrappedShapeEventImplsd::WrappedShapeEventImpl126cdf0e10cSrcweir 	WrappedShapeEventImpl() : meClickAction( css::presentation::ClickAction_NONE ), mnVerb( 0 ) {};
127cdf0e10cSrcweir };
128cdf0e10cSrcweir 
129cdf0e10cSrcweir typedef boost::shared_ptr< WrappedShapeEventImpl > WrappedShapeEventImplPtr;
130cdf0e10cSrcweir typedef std::map< css::uno::Reference< css::drawing::XShape >, WrappedShapeEventImplPtr > WrappedShapeEventImplMap;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir // --------------------------------------------------------------------
133cdf0e10cSrcweir 
134cdf0e10cSrcweir class SlideShowListenerProxy : private ::cppu::BaseMutex,
135cdf0e10cSrcweir 		public ::cppu::WeakImplHelper2< css::presentation::XSlideShowListener, css::presentation::XShapeEventListener >
136cdf0e10cSrcweir {
137cdf0e10cSrcweir public:
138cdf0e10cSrcweir 	SlideShowListenerProxy( const rtl::Reference< SlideshowImpl >& xController, const css::uno::Reference< css::presentation::XSlideShow >& xSlideShow );
139cdf0e10cSrcweir 	virtual ~SlideShowListenerProxy();
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	void addAsSlideShowListener();
142cdf0e10cSrcweir 	void removeAsSlideShowListener();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     void addSlideShowListener( const css::uno::Reference< css::presentation::XSlideShowListener >& Listener );
145cdf0e10cSrcweir     void removeSlideShowListener( const css::uno::Reference< css::presentation::XSlideShowListener >& Listener );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 	void addShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape );
148cdf0e10cSrcweir 	void removeShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape );
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	// css::animations::XAnimationListener
151cdf0e10cSrcweir     virtual void SAL_CALL beginEvent( const css::uno::Reference< css::animations::XAnimationNode >& Node ) throw (css::uno::RuntimeException);
152cdf0e10cSrcweir     virtual void SAL_CALL endEvent( const css::uno::Reference< css::animations::XAnimationNode >& Node ) throw (css::uno::RuntimeException);
153cdf0e10cSrcweir     virtual void SAL_CALL repeat( const css::uno::Reference< css::animations::XAnimationNode >& Node, ::sal_Int32 Repeat ) throw (css::uno::RuntimeException);
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     // css::presentation::XSlideShowListener:
156cdf0e10cSrcweir     virtual void SAL_CALL paused() throw (css::uno::RuntimeException);
157cdf0e10cSrcweir     virtual void SAL_CALL resumed() throw (css::uno::RuntimeException);
158cdf0e10cSrcweir     virtual void SAL_CALL slideTransitionStarted() throw (css::uno::RuntimeException);
159cdf0e10cSrcweir     virtual void SAL_CALL slideTransitionEnded() throw (css::uno::RuntimeException);
160cdf0e10cSrcweir     virtual void SAL_CALL slideAnimationsEnded() throw (css::uno::RuntimeException);
161cdf0e10cSrcweir     virtual void SAL_CALL slideEnded(sal_Bool bReverse) throw (css::uno::RuntimeException);
162cdf0e10cSrcweir     virtual void SAL_CALL hyperLinkClicked(const ::rtl::OUString & hyperLink) throw (css::uno::RuntimeException);
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     // css::lang::XEventListener:
165cdf0e10cSrcweir     virtual void SAL_CALL disposing(const css::lang::EventObject & Source) throw (css::uno::RuntimeException);
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     // css::presentation::XShapeEventListener:
168cdf0e10cSrcweir     virtual void SAL_CALL click(const css::uno::Reference< css::drawing::XShape > & xShape, const css::awt::MouseEvent & aOriginalEvent) throw (css::uno::RuntimeException);
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 	::cppu::OInterfaceContainerHelper maListeners;
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 	rtl::Reference< SlideshowImpl > mxController;
173cdf0e10cSrcweir 	css::uno::Reference< css::presentation::XSlideShow > mxSlideShow;
174cdf0e10cSrcweir };
175cdf0e10cSrcweir 
176cdf0e10cSrcweir // --------------------------------------------------------------------
177cdf0e10cSrcweir 
178cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper2< css::presentation::XSlideShowController, css::container::XIndexAccess > SlideshowImplBase;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir class SlideshowImpl : private ::cppu::BaseMutex, public SlideshowImplBase
181cdf0e10cSrcweir {
182cdf0e10cSrcweir friend class SlideShow;
183cdf0e10cSrcweir friend class SlideShowView;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir public:
186cdf0e10cSrcweir 	explicit SlideshowImpl( const css::uno::Reference< css::presentation::XPresentation2 >& xPresentation, ViewShell* pViewSh, ::sd::View* pView, SdDrawDocument* pDoc, ::Window* pParentWindow);
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	// css::presentation::XSlideShowController:
189cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL getAlwaysOnTop() throw (css::uno::RuntimeException);
190cdf0e10cSrcweir     virtual void SAL_CALL setAlwaysOnTop( ::sal_Bool _alwaysontop ) throw (css::uno::RuntimeException);
191cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL getMouseVisible() throw (css::uno::RuntimeException);
192cdf0e10cSrcweir     virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException);
193cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException);
194cdf0e10cSrcweir     virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
195cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException);
196cdf0e10cSrcweir     virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException);
197cdf0e10cSrcweir     virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
198cdf0e10cSrcweir     virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException);
199cdf0e10cSrcweir     virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException);
200cdf0e10cSrcweir     virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException);
201cdf0e10cSrcweir     virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException);
202cdf0e10cSrcweir     virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException);
203cdf0e10cSrcweir     virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException);
204cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isRunning(  ) throw (css::uno::RuntimeException);
205cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getSlideCount(  ) throw (css::uno::RuntimeException);
206cdf0e10cSrcweir     virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException);
207cdf0e10cSrcweir     virtual void SAL_CALL addSlideShowListener( const css::uno::Reference< css::presentation::XSlideShowListener >& Listener ) throw (css::uno::RuntimeException);
208cdf0e10cSrcweir     virtual void SAL_CALL removeSlideShowListener( const css::uno::Reference< css::presentation::XSlideShowListener >& Listener ) throw (css::uno::RuntimeException);
209cdf0e10cSrcweir     virtual void SAL_CALL gotoNextEffect(  ) throw (css::uno::RuntimeException);
210cdf0e10cSrcweir     virtual void SAL_CALL gotoPreviousEffect(  ) throw (css::uno::RuntimeException);
211cdf0e10cSrcweir     virtual void SAL_CALL gotoFirstSlide(  ) throw (css::uno::RuntimeException);
212cdf0e10cSrcweir     virtual void SAL_CALL gotoNextSlide(  ) throw (css::uno::RuntimeException);
213cdf0e10cSrcweir     virtual void SAL_CALL gotoPreviousSlide(  ) throw (css::uno::RuntimeException);
214cdf0e10cSrcweir     virtual void SAL_CALL gotoLastSlide(  ) throw (css::uno::RuntimeException);
215cdf0e10cSrcweir     virtual void SAL_CALL gotoBookmark( const ::rtl::OUString& Bookmark ) throw (css::uno::RuntimeException);
216cdf0e10cSrcweir     virtual void SAL_CALL gotoSlide( const css::uno::Reference< css::drawing::XDrawPage >& Page ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
217cdf0e10cSrcweir     virtual void SAL_CALL gotoSlideIndex( ::sal_Int32 Index ) throw (css::uno::RuntimeException);
218cdf0e10cSrcweir     virtual void SAL_CALL stopSound(  ) throw (css::uno::RuntimeException);
219cdf0e10cSrcweir     virtual void SAL_CALL pause(  ) throw (css::uno::RuntimeException);
220cdf0e10cSrcweir     virtual void SAL_CALL resume(  ) throw (css::uno::RuntimeException);
221cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isPaused(  ) throw (css::uno::RuntimeException);
222cdf0e10cSrcweir     virtual void SAL_CALL blankScreen( ::sal_Int32 Color ) throw (css::uno::RuntimeException);
223cdf0e10cSrcweir     virtual void SAL_CALL activate(  ) throw (css::uno::RuntimeException);
224cdf0e10cSrcweir     virtual void SAL_CALL deactivate(  ) throw (css::uno::RuntimeException);
225cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isActive(  ) throw (css::uno::RuntimeException);
226cdf0e10cSrcweir     virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentSlide(  ) throw (css::uno::RuntimeException);
227cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getCurrentSlideIndex(  ) throw (css::uno::RuntimeException);
228cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getNextSlideIndex(  ) throw (css::uno::RuntimeException);
229cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isEndless(  ) throw (css::uno::RuntimeException);
230cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL isFullScreen(  ) throw (css::uno::RuntimeException);
231cdf0e10cSrcweir     virtual css::uno::Reference< css::presentation::XSlideShow > SAL_CALL getSlideShow(  ) throw (css::uno::RuntimeException);
232cdf0e10cSrcweir 
233cdf0e10cSrcweir     // XIndexAccess
234cdf0e10cSrcweir     virtual ::sal_Int32 SAL_CALL getCount(  ) throw (::com::sun::star::uno::RuntimeException);
235cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
236cdf0e10cSrcweir     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException);
237cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException);
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 	// will be called from the SlideShowListenerProxy when this event is fired from the XSlideShow
240cdf0e10cSrcweir     void slideEnded(const bool bReverse);
241cdf0e10cSrcweir     void hyperLinkClicked(const ::rtl::OUString & hyperLink) throw (css::uno::RuntimeException);
242cdf0e10cSrcweir 	void click(const css::uno::Reference< css::drawing::XShape > & xShape, const css::awt::MouseEvent & aOriginalEvent);
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	/// ends the presentation async
245cdf0e10cSrcweir 	void endPresentation();
246cdf0e10cSrcweir 
getViewShell() const247cdf0e10cSrcweir 	ViewShell* getViewShell() const { return mpViewShell; }
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	void paint( const Rectangle& rRect );
250cdf0e10cSrcweir 	bool keyInput(const KeyEvent& rKEvt);
251cdf0e10cSrcweir 	void mouseButtonUp(const MouseEvent& rMEvt);
252cdf0e10cSrcweir 
253cdf0e10cSrcweir private:
254cdf0e10cSrcweir     SlideshowImpl(SlideshowImpl &); // not defined
255cdf0e10cSrcweir     void operator =(SlideshowImpl &); // not defined
256cdf0e10cSrcweir 
257cdf0e10cSrcweir     virtual ~SlideshowImpl();
258cdf0e10cSrcweir 
259cdf0e10cSrcweir     // overload WeakComponentImplHelperBase::disposing()
260cdf0e10cSrcweir     // This function is called upon disposing the component,
261cdf0e10cSrcweir     // if your component needs special work when it becomes
262cdf0e10cSrcweir     // disposed, do it here.
263cdf0e10cSrcweir     virtual void SAL_CALL disposing();
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	// internal
266cdf0e10cSrcweir 	bool startShow( PresentationSettingsEx* pPresSettings );
267cdf0e10cSrcweir 	bool startPreview(
268cdf0e10cSrcweir 		const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
269cdf0e10cSrcweir 		const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode,
270cdf0e10cSrcweir 		::Window* pParent );
271cdf0e10cSrcweir 
getShowWindow() const272cdf0e10cSrcweir 	ShowWindow* getShowWindow() const { return mpShowWindow; }
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 		/** forces an async call to update in the main thread */
275cdf0e10cSrcweir 	void startUpdateTimer();
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 	double update();
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 	void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false);
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	void displaySlideNumber( sal_Int32 nSlide );
284cdf0e10cSrcweir 	void displaySlideIndex( sal_Int32 nIndex );
285cdf0e10cSrcweir 	sal_Int32 getCurrentSlideNumber();
286cdf0e10cSrcweir 	sal_Int32 getFirstSlideNumber();
287cdf0e10cSrcweir 	sal_Int32 getLastSlideNumber();
isInputFreezed() const288cdf0e10cSrcweir 	inline bool isInputFreezed() const { return mbInputFreeze; }
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	void jumpToBookmark( const String& sBookmark );
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	void hideChildWindows();
293cdf0e10cSrcweir 	void showChildWindows();
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 	void resize( const Size& rSize );
296cdf0e10cSrcweir 
297cdf0e10cSrcweir     void setActiveXToolbarsVisible( sal_Bool bVisible );
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	DECL_LINK( updateHdl, Timer* );
300cdf0e10cSrcweir     DECL_LINK( PostYieldListener, void* );
301cdf0e10cSrcweir 	DECL_LINK( ReadyForNextInputHdl, Timer* );
302cdf0e10cSrcweir 	DECL_LINK( endPresentationHdl, void* );
303cdf0e10cSrcweir 	DECL_LINK( ContextMenuSelectHdl, Menu * );
304cdf0e10cSrcweir 	DECL_LINK( ContextMenuHdl, void* );
305cdf0e10cSrcweir 	DECL_LINK( deactivateHdl, Timer* );
306cdf0e10cSrcweir 	DECL_LINK( EventListenerHdl, VclSimpleEvent* );
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 	// helper
309cdf0e10cSrcweir 	void receiveRequest(SfxRequest& rReq);
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	/** called only by the slideshow view when the first paint event occurs.
312cdf0e10cSrcweir 		This actually starts the slideshow. */
313cdf0e10cSrcweir 	void onFirstPaint();
314cdf0e10cSrcweir 
getRestoreSlide() const315cdf0e10cSrcweir 	long getRestoreSlide() const { return mnRestoreSlide; }
316cdf0e10cSrcweir 
317cdf0e10cSrcweir private:
318cdf0e10cSrcweir 	bool startShowImpl(
319cdf0e10cSrcweir 		const css::uno::Sequence< css::beans::PropertyValue >& aProperties );
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	SfxViewFrame* getViewFrame() const;
322cdf0e10cSrcweir 	SfxDispatcher* getDispatcher() const;
323cdf0e10cSrcweir 	SfxBindings* getBindings() const;
324cdf0e10cSrcweir 
325cdf0e10cSrcweir 	sal_Int32 getSlideNumberForBookmark( const rtl::OUString& rStrBookmark );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 	void removeShapeEvents();
328cdf0e10cSrcweir 	void registerShapeEvents( sal_Int32 nSlideNumber );
329cdf0e10cSrcweir 	void registerShapeEvents( css::uno::Reference< css::drawing::XShapes >& xShapes ) throw (css::uno::Exception);
330cdf0e10cSrcweir 
331cdf0e10cSrcweir     css::uno::Reference< css::presentation::XSlideShow > createSlideShow() const;
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 	void setAutoSaveState( bool bOn );
334cdf0e10cSrcweir     void gotoPreviousSlide (const bool bSkipAllMainSequenceEffects);
335cdf0e10cSrcweir 
336cdf0e10cSrcweir     /** Called by PostYieldListener and updateHdl handlers this method is
337cdf0e10cSrcweir         responsible to call the slideshow update() method and, depending on
338cdf0e10cSrcweir         its return value, wait for a certain amount of time before another
339cdf0e10cSrcweir         call to update() is scheduled.
340cdf0e10cSrcweir     */
341cdf0e10cSrcweir     sal_Int32 updateSlideShow (void);
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	css::uno::Reference< css::presentation::XSlideShow > mxShow;
344cdf0e10cSrcweir 	comphelper::ImplementationReference< ::sd::SlideShowView, css::presentation::XSlideShowView > mxView;
345cdf0e10cSrcweir 	css::uno::Reference< css::frame::XModel > mxModel;
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 	Timer maUpdateTimer;
348cdf0e10cSrcweir 	Timer maInputFreezeTimer;
349cdf0e10cSrcweir 	Timer maDeactivateTimer;
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	::sd::View* mpView;
352cdf0e10cSrcweir 	ViewShell* mpViewShell;
353cdf0e10cSrcweir 	DrawDocShell* mpDocSh;
354cdf0e10cSrcweir 	SdDrawDocument* mpDoc;
355cdf0e10cSrcweir 
356cdf0e10cSrcweir 	SfxItemSet*     mpNewAttr;
357cdf0e10cSrcweir     ::Window*       mpParentWindow;
358cdf0e10cSrcweir 	ShowWindow*		mpShowWindow;
359cdf0e10cSrcweir 	PushButton* 	mpTimeButton;
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	boost::shared_ptr< AnimationSlideController > mpSlideController;
362cdf0e10cSrcweir 
363cdf0e10cSrcweir 	long			mnRestoreSlide;
364cdf0e10cSrcweir 	Point			maSlideOrigin;
365cdf0e10cSrcweir 	Point			maPopupMousePos;
366cdf0e10cSrcweir 	Size			maSlideSize;
367cdf0e10cSrcweir     Size			maPresSize;
368cdf0e10cSrcweir 	AnimationMode   meAnimationMode;
369cdf0e10cSrcweir 	String			maCharBuffer;
370cdf0e10cSrcweir 	Pointer 		maOldPointer;
371cdf0e10cSrcweir 	Pointer 		maPencil;
372cdf0e10cSrcweir 	std::vector< ::sd::Window* > maDrawModeWindows;
373cdf0e10cSrcweir 	::sd::Window*	mpOldActiveWindow;
374cdf0e10cSrcweir 	Link			maStarBASICGlobalErrorHdl;
375cdf0e10cSrcweir 	unsigned long	mnChildMask;
376cdf0e10cSrcweir 	bool			mbGridVisible;
377cdf0e10cSrcweir     bool            mbBordVisible;
378cdf0e10cSrcweir     bool            mbSlideBorderVisible;
379cdf0e10cSrcweir 	bool            mbSetOnlineSpelling;
380cdf0e10cSrcweir 	bool			mbDisposed;
381cdf0e10cSrcweir 	bool			mbMouseIsDrawing;
382cdf0e10cSrcweir 	bool			mbAutoSaveWasOn;
383cdf0e10cSrcweir 	bool			mbRehearseTimings;
384cdf0e10cSrcweir 	bool			mbDesignMode;
385cdf0e10cSrcweir 	bool			mbIsPaused;
386cdf0e10cSrcweir 	bool			mbWasPaused;		// used to cache pause state during context menu
387cdf0e10cSrcweir 	bool			mbInputFreeze;
388cdf0e10cSrcweir 	sal_Bool		mbActive;
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 	PresentationSettings maPresSettings;
391cdf0e10cSrcweir 	sal_Int32		mnUserPaintColor;
392cdf0e10cSrcweir 
393cdf0e10cSrcweir     bool			mbUsePen;
394cdf0e10cSrcweir     double			mdUserPaintStrokeWidth;
395cdf0e10cSrcweir 
396cdf0e10cSrcweir 	/// used in updateHdl to prevent recursive calls
397cdf0e10cSrcweir 	sal_Int32		mnEntryCounter;
398cdf0e10cSrcweir 
399cdf0e10cSrcweir 	sal_Int32		mnLastSlideNumber;
400cdf0e10cSrcweir 	WrappedShapeEventImplMap	maShapeEventMap;
401cdf0e10cSrcweir 
402cdf0e10cSrcweir 	::rtl::OUString msOnClick;
403cdf0e10cSrcweir 	::rtl::OUString msBookmark;
404cdf0e10cSrcweir 	::rtl::OUString msVerb;
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 	css::uno::Reference< css::drawing::XDrawPage > mxPreviewDrawPage;
407cdf0e10cSrcweir 	css::uno::Reference< css::animations::XAnimationNode > mxPreviewAnimationNode;
408cdf0e10cSrcweir 
409cdf0e10cSrcweir 	css::uno::Reference< css::media::XPlayer > mxPlayer;
410cdf0e10cSrcweir 
411cdf0e10cSrcweir     ::std::auto_ptr<PaneHider> mpPaneHider;
412cdf0e10cSrcweir 
413cdf0e10cSrcweir 	sal_uLong	mnEndShowEvent;
414cdf0e10cSrcweir 	sal_uLong	mnContextMenuEvent;
415cdf0e10cSrcweir 	sal_Int32 mnUpdateEvent;
416cdf0e10cSrcweir 
417cdf0e10cSrcweir 	css::uno::Reference< css::presentation::XPresentation2 > mxPresentation;
418cdf0e10cSrcweir 	::rtl::Reference< SlideShowListenerProxy > mxListenerProxy;
419cdf0e10cSrcweir };
420cdf0e10cSrcweir 
421cdf0e10cSrcweir } // namespace ::sd
422cdf0e10cSrcweir 
423cdf0e10cSrcweir #endif
424