xref: /AOO41X/main/avmedia/source/gstreamer/gstwindow.hxx (revision 9ea84ac54d7ea9ebcfae551950dfc30154280364)
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
10cdf0e10cSrcweir  *
11*9ea84ac5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
20*9ea84ac5SAndrew Rist  *************************************************************/
21*9ea84ac5SAndrew Rist 
22*9ea84ac5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _GSTWINDOW_HXX
25cdf0e10cSrcweir #define _GSTWINDOW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "gstcommon.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 namespace avmedia
35cdf0e10cSrcweir {
36cdf0e10cSrcweir namespace gst
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class PlayerChildWindow;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // ---------------
42cdf0e10cSrcweir // - Window -
43cdf0e10cSrcweir // ---------------
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class Player;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class Window : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayerWindow,
48cdf0e10cSrcweir                                                ::com::sun::star::lang::XServiceInfo >
49cdf0e10cSrcweir {
50cdf0e10cSrcweir     friend class Player;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir public:     Window( ::avmedia::gst::Player& rPlayer );
53cdf0e10cSrcweir     ~Window();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     bool create( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     // XPlayerWindow
58cdf0e10cSrcweir     virtual void SAL_CALL update()
59cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     virtual sal_Bool SAL_CALL setZoomLevel( ::com::sun::star::media::ZoomLevel ZoomLevel )
62cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
63cdf0e10cSrcweir     virtual ::com::sun::star::media::ZoomLevel SAL_CALL getZoomLevel()
64cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     virtual void SAL_CALL setPointerType( sal_Int32 nPointerType )
67cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     // XWindow
70cdf0e10cSrcweir     virtual void SAL_CALL setPosSize( sal_Int32 X,
71cdf0e10cSrcweir                                       sal_Int32 Y,
72cdf0e10cSrcweir                                       sal_Int32 Width,
73cdf0e10cSrcweir                                       sal_Int32 Height,
74cdf0e10cSrcweir                                       sal_Int16 Flags )
75cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize()
78cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     virtual void SAL_CALL setVisible( sal_Bool Visible )
81cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     virtual void SAL_CALL setEnable( sal_Bool Enable )
84cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     virtual void SAL_CALL setFocus()
87cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     virtual void SAL_CALL addWindowListener(
90cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener )
91cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     virtual void SAL_CALL removeWindowListener(
94cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener )
95cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     virtual void SAL_CALL addFocusListener(
98cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
99cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     virtual void SAL_CALL removeFocusListener(
102cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
103cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     virtual void SAL_CALL addKeyListener(
106cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener )
107cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     virtual void SAL_CALL removeKeyListener(
110cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener )
111cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     virtual void SAL_CALL addMouseListener(
114cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener )
115cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     virtual void SAL_CALL removeMouseListener(
118cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener )
119cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     virtual void SAL_CALL addMouseMotionListener(
122cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener )
123cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     virtual void SAL_CALL removeMouseMotionListener(
126cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener )
127cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir     virtual void SAL_CALL addPaintListener(
130cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener )
131cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     virtual void SAL_CALL removePaintListener(
134cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener )
135cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     // XComponent
138cdf0e10cSrcweir     virtual void SAL_CALL dispose()
139cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     virtual void SAL_CALL addEventListener(
142cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
143cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener(
146cdf0e10cSrcweir         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
147cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
148cdf0e10cSrcweir 
149cdf0e10cSrcweir     // XServiceInfo
150cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName()
151cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
154cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
157cdf0e10cSrcweir      throw( ::com::sun::star::uno::RuntimeException );
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 
160cdf0e10cSrcweir public:
161cdf0e10cSrcweir 
162cdf0e10cSrcweir     void fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     void fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
165cdf0e10cSrcweir 
166cdf0e10cSrcweir     void fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     void fireKeyPressedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
169cdf0e10cSrcweir 
170cdf0e10cSrcweir     void fireKeyReleasedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     void fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt );
173cdf0e10cSrcweir 
174cdf0e10cSrcweir protected:
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     long getXWindowHandle() const;
177cdf0e10cSrcweir 
178cdf0e10cSrcweir private:
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     ::osl::Mutex maMutex;
181cdf0e10cSrcweir     ::cppu::OMultiTypeInterfaceContainerHelper maListeners;
182cdf0e10cSrcweir     ::com::sun::star::awt::Rectangle maWindowRect;
183cdf0e10cSrcweir     Player& mrPlayer;
184cdf0e10cSrcweir     PlayerChildWindow* mpPlayerWindow;
185cdf0e10cSrcweir     ::com::sun::star::media::ZoomLevel meZoomLevel;
186cdf0e10cSrcweir     sal_Int32 mnPointerType;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir     void implLayoutVideoWindow();
189cdf0e10cSrcweir };
190cdf0e10cSrcweir } // namespace gst
191cdf0e10cSrcweir } // namespace avmedia
192cdf0e10cSrcweir 
193cdf0e10cSrcweir #endif // _GSTWINDOW_HXX
194