xref: /aoo42x/main/avmedia/source/win/window.hxx (revision 9ea84ac5)
1*9ea84ac5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9ea84ac5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ea84ac5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ea84ac5SAndrew Rist  * distributed with this work for additional information
6*9ea84ac5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ea84ac5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ea84ac5SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ea84ac5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ea84ac5SAndrew Rist  *
11*9ea84ac5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ea84ac5SAndrew Rist  *
13*9ea84ac5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ea84ac5SAndrew Rist  * software distributed under the License is distributed on an
15*9ea84ac5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ea84ac5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ea84ac5SAndrew Rist  * specific language governing permissions and limitations
18*9ea84ac5SAndrew Rist  * under the License.
19*9ea84ac5SAndrew Rist  *
20*9ea84ac5SAndrew Rist  *************************************************************/
21*9ea84ac5SAndrew Rist 
22*9ea84ac5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _WINDOW_HXX
25cdf0e10cSrcweir #define _WINDOW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "wincommon.hxx"
28cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_MEDIA_XPLAYERWINDOW_HDL_
31cdf0e10cSrcweir #include "com/sun/star/media/XPlayerWindow.hdl"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir 
34cdf0e10cSrcweir struct IVideoWindow;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace avmedia { namespace win {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // ---------------
39cdf0e10cSrcweir // - Window -
40cdf0e10cSrcweir // ---------------
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class Player;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class Window : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPlayerWindow,
45cdf0e10cSrcweir                                                 ::com::sun::star::lang::XServiceInfo >
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir 
49cdf0e10cSrcweir             Window( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr,
50cdf0e10cSrcweir                     Player& rPlayer );
51cdf0e10cSrcweir             ~Window();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     bool    create( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
54cdf0e10cSrcweir     void    processGraphEvent();
55cdf0e10cSrcweir     void    updatePointer();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     // XPlayerWindow
58cdf0e10cSrcweir     virtual void SAL_CALL update(  ) throw (::com::sun::star::uno::RuntimeException);
59cdf0e10cSrcweir     virtual sal_Bool SAL_CALL setZoomLevel( ::com::sun::star::media::ZoomLevel ZoomLevel ) throw (::com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir     virtual ::com::sun::star::media::ZoomLevel SAL_CALL getZoomLevel(  ) throw (::com::sun::star::uno::RuntimeException);
61cdf0e10cSrcweir     virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) throw (::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // XWindow
64cdf0e10cSrcweir     virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException);
65cdf0e10cSrcweir     virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize(  ) throw (::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir     virtual void SAL_CALL setVisible( sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir     virtual void SAL_CALL setEnable( sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir     virtual void SAL_CALL setFocus(  ) throw (::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir     virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir     virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
71cdf0e10cSrcweir     virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir     virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir     virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir     virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
75cdf0e10cSrcweir     virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir     virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir     virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir     virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir     virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir     virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     // XComponent
83cdf0e10cSrcweir     virtual void SAL_CALL dispose(  ) throw (::com::sun::star::uno::RuntimeException);
84cdf0e10cSrcweir     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     // XServiceInfo
88cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir public:
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     void fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
95cdf0e10cSrcweir     void fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
96cdf0e10cSrcweir     void fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
97cdf0e10cSrcweir     void fireKeyPressedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
98cdf0e10cSrcweir     void fireKeyReleasedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
99cdf0e10cSrcweir     void fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir private:
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     ::osl::Mutex                                maMutex;
106cdf0e10cSrcweir     ::cppu::OMultiTypeInterfaceContainerHelper  maListeners;
107cdf0e10cSrcweir     ::com::sun::star::media::ZoomLevel          meZoomLevel;
108cdf0e10cSrcweir     Player&                                     mrPlayer;
109cdf0e10cSrcweir     int                                         mnFrameWnd;
110cdf0e10cSrcweir     int                                         mnParentWnd;
111cdf0e10cSrcweir     int                                         mnPointerType;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     void                                        ImplLayoutVideoWindow();
114cdf0e10cSrcweir };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir } // namespace win
117cdf0e10cSrcweir } // namespace avmedia
118cdf0e10cSrcweir 
119cdf0e10cSrcweir #endif // _WINDOW_HXX
120