1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef TOOLKIT_ANIMATEDIMAGEPEER_HXX
25 #define TOOLKIT_ANIMATEDIMAGEPEER_HXX
26 
27 #include "toolkit/awt/vclxwindow.hxx"
28 
29 /** === begin UNO includes === **/
30 #include <com/sun/star/awt/XAnimation.hpp>
31 #include <com/sun/star/util/XModifyListener.hpp>
32 /** === end UNO includes === **/
33 
34 #include <cppuhelper/implbase3.hxx>
35 
36 #include <boost/scoped_ptr.hpp>
37 #include <boost/noncopyable.hpp>
38 
39 //......................................................................................................................
40 namespace toolkit
41 {
42 //......................................................................................................................
43 
44 	//==================================================================================================================
45 	//= AnimatedImagesPeer
46 	//==================================================================================================================
47     struct AnimatedImagesPeer_Data;
48     typedef ::cppu::ImplInheritanceHelper3  <   VCLXWindow
49                                             ,   ::com::sun::star::awt::XAnimation
50                                             ,   ::com::sun::star::container::XContainerListener
51                                             ,   ::com::sun::star::util::XModifyListener
52                                             >   AnimatedImagesPeer_Base;
53 
54     class AnimatedImagesPeer    :public AnimatedImagesPeer_Base
55                                 ,public ::boost::noncopyable
56 	{
57     public:
58         AnimatedImagesPeer();
59 
60     protected:
61         ~AnimatedImagesPeer();
62 
63     public:
64         // XAnimation
65         virtual void SAL_CALL startAnimation(  ) throw (::com::sun::star::uno::RuntimeException);
66         virtual void SAL_CALL stopAnimation(  ) throw (::com::sun::star::uno::RuntimeException);
67         virtual ::sal_Bool SAL_CALL isAnimationRunning(  ) throw (::com::sun::star::uno::RuntimeException);
68 
69         // VclWindowPeer
70         virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
71         virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
72 
73         // XContainerListener
74         virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
75         virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
76         virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
77 
78         // XEventListener
79         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
80 
81         // XModifyListener
82         virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
83 
84         // XComponent
85         void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException);
86 
87     protected:
88         void ProcessWindowEvent( const VclWindowEvent& i_windowEvent );
89 
90     private:
91         /** updates our images with the ones from the givem XAnimatedImages component
92         */
93         void    impl_updateImages_nolck( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_animatedImages );
94 
95     private:
96         ::boost::scoped_ptr< AnimatedImagesPeer_Data >   m_pData;
97 	};
98 
99 //......................................................................................................................
100 } // namespace toolkit
101 //......................................................................................................................
102 
103 #endif // TOOLKIT_ANIMATEDIMAGEPEER_HXX
104