1*06bcd5d2SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*06bcd5d2SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*06bcd5d2SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*06bcd5d2SAndrew Rist  * distributed with this work for additional information
6*06bcd5d2SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*06bcd5d2SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*06bcd5d2SAndrew Rist  * "License"); you may not use this file except in compliance
9*06bcd5d2SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*06bcd5d2SAndrew Rist  *
11*06bcd5d2SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*06bcd5d2SAndrew Rist  *
13*06bcd5d2SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*06bcd5d2SAndrew Rist  * software distributed under the License is distributed on an
15*06bcd5d2SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*06bcd5d2SAndrew Rist  * KIND, either express or implied.  See the License for the
17*06bcd5d2SAndrew Rist  * specific language governing permissions and limitations
18*06bcd5d2SAndrew Rist  * under the License.
19*06bcd5d2SAndrew Rist  *
20*06bcd5d2SAndrew Rist  *************************************************************/
21*06bcd5d2SAndrew Rist 
22*06bcd5d2SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SDEXT_PRESENTER_CURRENT_SLIDE_OBSERVER
25cdf0e10cSrcweir #define SDEXT_PRESENTER_CURRENT_SLIDE_OBSERVER
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "PresenterController.hxx"
28cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShow.hpp>
29cdf0e10cSrcweir #include <com/sun/star/presentation/XSlideShowController.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
31cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx>
32cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx>
33cdf0e10cSrcweir #include <rtl/ref.hxx>
34cdf0e10cSrcweir #include <vos/timer.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace css = ::com::sun::star;
37cdf0e10cSrcweir 
38cdf0e10cSrcweir namespace sdext { namespace presenter {
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace {
41cdf0e10cSrcweir     typedef ::cppu::WeakComponentImplHelper1 <
42cdf0e10cSrcweir         css::presentation::XSlideShowListener
43cdf0e10cSrcweir     > PresenterCurrentSlideObserverInterfaceBase;
44cdf0e10cSrcweir }
45cdf0e10cSrcweir 
46cdf0e10cSrcweir /** Check periodically the slide show controller and the
47cdf0e10cSrcweir     frame::XController whether the current slide has changed.  If so,
48cdf0e10cSrcweir     then inform the presenter controller about it.
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     Objects of this class have their own lifetime control and destroy
51cdf0e10cSrcweir     themselves when the presenter controller is diposed.
52cdf0e10cSrcweir */
53cdf0e10cSrcweir class PresenterCurrentSlideObserver
54cdf0e10cSrcweir     : protected ::cppu::BaseMutex,
55cdf0e10cSrcweir       public PresenterCurrentSlideObserverInterfaceBase
56cdf0e10cSrcweir {
57cdf0e10cSrcweir public:
58cdf0e10cSrcweir     PresenterCurrentSlideObserver (
59cdf0e10cSrcweir         const ::rtl::Reference<PresenterController>& rxPresenterController,
60cdf0e10cSrcweir         const css::uno::Reference<css::presentation::XSlideShowController>& rxSlideShowController);
61cdf0e10cSrcweir     virtual ~PresenterCurrentSlideObserver (void);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     virtual void SAL_CALL disposing (void);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     // XSlideShowListener
66cdf0e10cSrcweir     virtual void SAL_CALL paused(  ) throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir     virtual void SAL_CALL resumed(  ) throw (::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir     virtual void SAL_CALL slideTransitionStarted(  ) throw (::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir     virtual void SAL_CALL slideTransitionEnded(  ) throw (::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir     virtual void SAL_CALL slideAnimationsEnded(  ) throw (::com::sun::star::uno::RuntimeException);
71cdf0e10cSrcweir     virtual void SAL_CALL slideEnded(sal_Bool bReverse) throw (::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir     virtual void SAL_CALL hyperLinkClicked( const ::rtl::OUString& hyperLink ) throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	// XAnimationListener
75cdf0e10cSrcweir     virtual void SAL_CALL beginEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& Node ) throw (::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir     virtual void SAL_CALL endEvent( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& Node ) throw (::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir     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);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     // XEventListener
80cdf0e10cSrcweir     virtual void SAL_CALL disposing (
81cdf0e10cSrcweir         const com::sun::star::lang::EventObject& rEvent)
82cdf0e10cSrcweir         throw (com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir private:
85cdf0e10cSrcweir     ::rtl::Reference<PresenterController> mpPresenterController;
86cdf0e10cSrcweir     css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir } } // end of namespace ::sdext::presenter
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif
92