xref: /trunk/main/embedserv/source/inc/xwin.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XWIN_HXX_
29 #define _XWIN_HXX_
30 
31 
32 #include "common.h"
33 #include <osl/mutex.hxx>
34 #include <cppuhelper/interfacecontainer.h>
35 #include <cppuhelper/implbase2.hxx>
36 #include <com/sun/star/awt/XWindow.hpp>
37 #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
38 
39 
40 class ContainerWindowWrapper:
41     public ::cppu::WeakImplHelper2<
42                  ::com::sun::star::awt::XWindow,
43                  ::com::sun::star::awt::XSystemDependentWindowPeer>
44 {
45 public:
46 
47     ContainerWindowWrapper(HWND aHwnd);
48 
49     ~ ContainerWindowWrapper();
50 
51 
52     // XComponent
53 
54     virtual void SAL_CALL
55     dispose(
56     )
57         throw (
58             ::com::sun::star::uno::RuntimeException
59         );
60 
61     virtual void SAL_CALL
62     addEventListener(
63         const ::com::sun::star::uno::Reference<
64         ::com::sun::star::lang::XEventListener >& xListener
65     )
66         throw (
67             ::com::sun::star::uno::RuntimeException
68         );
69 
70     virtual void SAL_CALL
71     removeEventListener(
72         const ::com::sun::star::uno::Reference<
73         ::com::sun::star::lang::XEventListener >& aListener
74     )
75         throw (
76             ::com::sun::star::uno::RuntimeException
77         );
78 
79 
80     // XSystemDependentWindowPeer
81 
82     virtual ::com::sun::star::uno::Any SAL_CALL
83     getWindowHandle(
84         const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId,
85         sal_Int16 SystemType
86     )
87         throw (
88             ::com::sun::star::uno::RuntimeException
89         );
90 
91     // XWindow
92 
93     virtual void SAL_CALL
94     setPosSize(
95         sal_Int32 X,
96         sal_Int32 Y,
97         sal_Int32 Width,
98         sal_Int32 Height,
99         sal_Int16 Flags
100     )
101         throw (
102             ::com::sun::star::uno::RuntimeException);
103 
104     virtual ::com::sun::star::awt::Rectangle SAL_CALL
105     getPosSize(
106     )
107         throw (
108             ::com::sun::star::uno::RuntimeException
109         );
110 
111     virtual void SAL_CALL
112     setVisible(
113         sal_Bool Visible
114     )
115         throw (
116             ::com::sun::star::uno::RuntimeException
117         );
118 
119     virtual void SAL_CALL
120     setEnable(
121         sal_Bool Enable
122     )
123         throw (
124             ::com::sun::star::uno::RuntimeException
125         );
126 
127     virtual void SAL_CALL
128     setFocus(
129     )
130         throw (
131             ::com::sun::star::uno::RuntimeException
132         );
133 
134     virtual void SAL_CALL
135     addWindowListener(
136         const ::com::sun::star::uno::Reference<
137         ::com::sun::star::awt::XWindowListener >& xListener
138     )
139         throw (
140             ::com::sun::star::uno::RuntimeException
141         );
142 
143     virtual void SAL_CALL
144     removeWindowListener(
145         const ::com::sun::star::uno::Reference<
146         ::com::sun::star::awt::XWindowListener >& xListener
147     )
148         throw (
149             ::com::sun::star::uno::RuntimeException
150         );
151 
152     virtual void SAL_CALL
153     addFocusListener(
154         const ::com::sun::star::uno::Reference<
155         ::com::sun::star::awt::XFocusListener >& xListener
156     )
157         throw (
158             ::com::sun::star::uno::RuntimeException
159         );
160 
161     virtual void SAL_CALL
162     removeFocusListener(
163         const ::com::sun::star::uno::Reference<
164         ::com::sun::star::awt::XFocusListener >& xListener
165     )
166         throw (
167             ::com::sun::star::uno::RuntimeException
168         );
169 
170     virtual void SAL_CALL
171     addKeyListener(
172         const ::com::sun::star::uno::Reference<
173         ::com::sun::star::awt::XKeyListener >& xListener
174     )
175         throw (
176             ::com::sun::star::uno::RuntimeException
177         );
178 
179     virtual void SAL_CALL
180     removeKeyListener(
181         const ::com::sun::star::uno::Reference<
182         ::com::sun::star::awt::XKeyListener >& xListener
183     )
184         throw (
185             ::com::sun::star::uno::RuntimeException
186         );
187 
188     virtual void SAL_CALL
189     addMouseListener(
190         const ::com::sun::star::uno::Reference<
191         ::com::sun::star::awt::XMouseListener >& xListener
192     )
193         throw (
194             ::com::sun::star::uno::RuntimeException
195         );
196 
197     virtual void SAL_CALL
198     removeMouseListener(
199         const ::com::sun::star::uno::Reference<
200         ::com::sun::star::awt::XMouseListener >& xListener
201     )
202         throw (
203             ::com::sun::star::uno::RuntimeException
204         );
205 
206     virtual void SAL_CALL
207     addMouseMotionListener(
208         const ::com::sun::star::uno::Reference<
209         ::com::sun::star::awt::XMouseMotionListener >& xListener
210     )
211         throw (
212             ::com::sun::star::uno::RuntimeException
213         );
214 
215     virtual void SAL_CALL
216     removeMouseMotionListener(
217         const ::com::sun::star::uno::Reference<
218         ::com::sun::star::awt::XMouseMotionListener >& xListener
219     )
220         throw (
221             ::com::sun::star::uno::RuntimeException
222         );
223 
224     virtual void SAL_CALL
225     addPaintListener(
226         const ::com::sun::star::uno::Reference<
227         ::com::sun::star::awt::XPaintListener >& xListener
228     )
229         throw (
230             ::com::sun::star::uno::RuntimeException
231         );
232 
233     virtual void SAL_CALL
234     removePaintListener(
235         const ::com::sun::star::uno::Reference<
236         ::com::sun::star::awt::XPaintListener >& xListener
237     )
238         throw (
239             ::com::sun::star::uno::RuntimeException
240         );
241 
242 
243 private:
244 
245     osl::Mutex m_aMutex;
246     cppu::OInterfaceContainerHelper *m_pDisposeEventListeners;
247 
248     HWND m_aHwnd;
249 };
250 
251 
252 #endif
253