update dev300-m58
[ooovba.git] / sdext / source / presenter / PresenterCurrentSlideObserver.hxx
blob7a289cb3f205f4778d30f7edfcb8ce143bfdf93e
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: PresenterCurrentSlideObserver.hxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SDEXT_PRESENTER_CURRENT_SLIDE_OBSERVER
33 #define SDEXT_PRESENTER_CURRENT_SLIDE_OBSERVER
35 #include "PresenterController.hxx"
36 #include <com/sun/star/presentation/XSlideShow.hpp>
37 #include <com/sun/star/presentation/XSlideShowController.hpp>
38 #include <com/sun/star/frame/XController.hpp>
39 #include <cppuhelper/compbase1.hxx>
40 #include <cppuhelper/basemutex.hxx>
41 #include <rtl/ref.hxx>
42 #include <vos/timer.hxx>
44 namespace css = ::com::sun::star;
46 namespace sdext { namespace presenter {
48 namespace {
49 typedef ::cppu::WeakComponentImplHelper1 <
50 css::presentation::XSlideShowListener
51 > PresenterCurrentSlideObserverInterfaceBase;
54 /** Check periodically the slide show controller and the
55 frame::XController whether the current slide has changed. If so,
56 then inform the presenter controller about it.
58 Objects of this class have their own lifetime control and destroy
59 themselves when the presenter controller is diposed.
61 class PresenterCurrentSlideObserver
62 : protected ::cppu::BaseMutex,
63 public PresenterCurrentSlideObserverInterfaceBase
65 public:
66 PresenterCurrentSlideObserver (
67 const ::rtl::Reference<PresenterController>& rxPresenterController,
68 const css::uno::Reference<css::presentation::XSlideShowController>& rxSlideShowController);
69 virtual ~PresenterCurrentSlideObserver (void);
71 virtual void SAL_CALL disposing (void);
73 // XSlideShowListener
74 virtual void SAL_CALL paused( ) throw (::com::sun::star::uno::RuntimeException);
75 virtual void SAL_CALL resumed( ) throw (::com::sun::star::uno::RuntimeException);
76 virtual void SAL_CALL slideTransitionStarted( ) throw (::com::sun::star::uno::RuntimeException);
77 virtual void SAL_CALL slideTransitionEnded( ) throw (::com::sun::star::uno::RuntimeException);
78 virtual void SAL_CALL slideAnimationsEnded( ) throw (::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL slideEnded(sal_Bool bReverse) throw (::com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL hyperLinkClicked( const ::rtl::OUString& hyperLink ) throw (::com::sun::star::uno::RuntimeException);
82 // XAnimationListener
83 virtual void SAL_CALL beginEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& Node ) throw (::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL endEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& Node ) throw (::com::sun::star::uno::RuntimeException);
85 virtual void SAL_CALL repeat( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& Node, ::sal_Int32 Repeat ) throw (::com::sun::star::uno::RuntimeException);
87 // XEventListener
88 virtual void SAL_CALL disposing (
89 const com::sun::star::lang::EventObject& rEvent)
90 throw (com::sun::star::uno::RuntimeException);
92 private:
93 ::rtl::Reference<PresenterController> mpPresenterController;
94 css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
97 } } // end of namespace ::sdext::presenter
99 #endif