1*50e6b072SAndrew Rist /**************************************************************
2*50e6b072SAndrew Rist  *
3*50e6b072SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*50e6b072SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*50e6b072SAndrew Rist  * distributed with this work for additional information
6*50e6b072SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*50e6b072SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*50e6b072SAndrew Rist  * "License"); you may not use this file except in compliance
9*50e6b072SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*50e6b072SAndrew Rist  *
11*50e6b072SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*50e6b072SAndrew Rist  *
13*50e6b072SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*50e6b072SAndrew Rist  * software distributed under the License is distributed on an
15*50e6b072SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*50e6b072SAndrew Rist  * KIND, either express or implied.  See the License for the
17*50e6b072SAndrew Rist  * specific language governing permissions and limitations
18*50e6b072SAndrew Rist  * under the License.
19*50e6b072SAndrew Rist  *
20*50e6b072SAndrew Rist  *************************************************************/
21*50e6b072SAndrew Rist 
22*50e6b072SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef TOOLKIT_ANIMATEDIMAGES_HXX
25cdf0e10cSrcweir #define TOOLKIT_ANIMATEDIMAGES_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "toolkit/controls/unocontrolbase.hxx"
28cdf0e10cSrcweir #include "toolkit/controls/unocontrolmodel.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /** === begin UNO includes === **/
31cdf0e10cSrcweir #include <com/sun/star/awt/XAnimation.hpp>
32cdf0e10cSrcweir #include <com/sun/star/awt/XAnimatedImages.hpp>
33cdf0e10cSrcweir #include <com/sun/star/container/XContainerListener.hpp>
34cdf0e10cSrcweir /** === end UNO includes === **/
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
37cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #include <boost/scoped_ptr.hpp>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //......................................................................................................................
42cdf0e10cSrcweir namespace toolkit
43cdf0e10cSrcweir {
44cdf0e10cSrcweir //......................................................................................................................
45cdf0e10cSrcweir 
46cdf0e10cSrcweir 	//==================================================================================================================
47cdf0e10cSrcweir 	//=
48cdf0e10cSrcweir 	//==================================================================================================================
49cdf0e10cSrcweir     typedef ::cppu::AggImplInheritanceHelper2   <   UnoControlBase
50cdf0e10cSrcweir                                                 ,   ::com::sun::star::awt::XAnimation
51cdf0e10cSrcweir                                                 ,   ::com::sun::star::container::XContainerListener
52cdf0e10cSrcweir                                                 >   AnimatedImagesControl_Base;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     class AnimatedImagesControl : public AnimatedImagesControl_Base
55cdf0e10cSrcweir     {
56cdf0e10cSrcweir     public:
57cdf0e10cSrcweir 								    AnimatedImagesControl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
58cdf0e10cSrcweir 	    ::rtl::OUString				GetComponentServiceName();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	    // XAnimation
61cdf0e10cSrcweir         virtual void SAL_CALL startAnimation(  ) throw (::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir         virtual void SAL_CALL stopAnimation(  ) throw (::com::sun::star::uno::RuntimeException);
63cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL isAnimationRunning(  ) throw (::com::sun::star::uno::RuntimeException);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	    // XServiceInfo
66cdf0e10cSrcweir         ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir         // XControl
70cdf0e10cSrcweir         sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& i_rModel ) throw ( ::com::sun::star::uno::RuntimeException );
71cdf0e10cSrcweir         void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& i_toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& i_parentPeer ) throw(::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
74cdf0e10cSrcweir         // XContainerListener
75cdf0e10cSrcweir         virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir         virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir         virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         // XEventListener
80cdf0e10cSrcweir         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir     };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     //==================================================================================================================
84cdf0e10cSrcweir     //= AnimatedImagesControlModel
85cdf0e10cSrcweir     //==================================================================================================================
86cdf0e10cSrcweir     struct AnimatedImagesControlModel_Data;
87cdf0e10cSrcweir     typedef ::cppu::AggImplInheritanceHelper1   <   UnoControlModel
88cdf0e10cSrcweir                                                 ,   ::com::sun::star::awt::XAnimatedImages
89cdf0e10cSrcweir                                                 >   AnimatedImagesControlModel_Base;
90cdf0e10cSrcweir     class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
91cdf0e10cSrcweir     {
92cdf0e10cSrcweir     public:
93cdf0e10cSrcweir                                         AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
94cdf0e10cSrcweir                                         AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir         virtual UnoControlModel*        Clone() const;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         // XPropertySet
99cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         // XPersistObject
102cdf0e10cSrcweir         ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         // XServiceInfo
105cdf0e10cSrcweir         ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         // XAnimatedImages
109cdf0e10cSrcweir         virtual ::sal_Int32 SAL_CALL getStepTime() throw (::com::sun::star::uno::RuntimeException);
110cdf0e10cSrcweir         virtual void SAL_CALL setStepTime( ::sal_Int32 _steptime ) throw (::com::sun::star::uno::RuntimeException);
111cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL getAutoRepeat() throw (::com::sun::star::uno::RuntimeException);
112cdf0e10cSrcweir         virtual void SAL_CALL setAutoRepeat( ::sal_Bool _autorepeat ) throw (::com::sun::star::uno::RuntimeException);
113cdf0e10cSrcweir         virtual ::sal_Int16 SAL_CALL getScaleMode() throw (::com::sun::star::uno::RuntimeException);
114cdf0e10cSrcweir         virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
115cdf0e10cSrcweir         virtual ::sal_Int32 SAL_CALL getImageSetCount(  ) throw (::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
117cdf0e10cSrcweir         virtual void SAL_CALL insertImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir         virtual void SAL_CALL replaceImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
119cdf0e10cSrcweir         virtual void SAL_CALL removeImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         // XAnimatedImages::XContainer
122cdf0e10cSrcweir         virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
123cdf0e10cSrcweir         virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     protected:
126cdf0e10cSrcweir                                         ~AnimatedImagesControlModel();
127cdf0e10cSrcweir 
128cdf0e10cSrcweir         ::com::sun::star::uno::Any		ImplGetDefaultValue( sal_uInt16 nPropId ) const;
129cdf0e10cSrcweir         ::cppu::IPropertyArrayHelper&	SAL_CALL getInfoHelper();
130cdf0e10cSrcweir 	    void SAL_CALL                   setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     private:
133cdf0e10cSrcweir         ::boost::scoped_ptr< AnimatedImagesControlModel_Data >
134cdf0e10cSrcweir                 m_pData;
135cdf0e10cSrcweir     };
136cdf0e10cSrcweir 
137cdf0e10cSrcweir //......................................................................................................................
138cdf0e10cSrcweir } // namespace toolkit
139cdf0e10cSrcweir //......................................................................................................................
140cdf0e10cSrcweir 
141cdf0e10cSrcweir #endif // TOOLKIT_ANIMATEDIMAGES_HXX
142