xref: /aoo42x/main/embedserv/source/inc/xwin.hxx (revision a20fd023)
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 _XWIN_HXX_
25 #define _XWIN_HXX_
26 
27 
28 #include "common.h"
29 #include <osl/mutex.hxx>
30 #include <cppuhelper/interfacecontainer.h>
31 #include <cppuhelper/implbase2.hxx>
32 #include <com/sun/star/awt/XWindow.hpp>
33 #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
34 
35 
36 class ContainerWindowWrapper:
37     public ::cppu::WeakImplHelper2<
38                  ::com::sun::star::awt::XWindow,
39                  ::com::sun::star::awt::XSystemDependentWindowPeer>
40 {
41 public:
42 
43     ContainerWindowWrapper(HWND aHwnd);
44 
45     ~ ContainerWindowWrapper();
46 
47 
48     // XComponent
49 
50     virtual void SAL_CALL
51     dispose(
52     )
53         throw (
54             ::com::sun::star::uno::RuntimeException
55         );
56 
57     virtual void SAL_CALL
58     addEventListener(
59         const ::com::sun::star::uno::Reference<
60         ::com::sun::star::lang::XEventListener >& xListener
61     )
62         throw (
63             ::com::sun::star::uno::RuntimeException
64         );
65 
66     virtual void SAL_CALL
67     removeEventListener(
68         const ::com::sun::star::uno::Reference<
69         ::com::sun::star::lang::XEventListener >& aListener
70     )
71         throw (
72             ::com::sun::star::uno::RuntimeException
73         );
74 
75 
76     // XSystemDependentWindowPeer
77 
78     virtual ::com::sun::star::uno::Any SAL_CALL
79     getWindowHandle(
80         const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId,
81         sal_Int16 SystemType
82     )
83         throw (
84             ::com::sun::star::uno::RuntimeException
85         );
86 
87     // XWindow
88 
89     virtual void SAL_CALL
90     setPosSize(
91         sal_Int32 X,
92         sal_Int32 Y,
93         sal_Int32 Width,
94         sal_Int32 Height,
95         sal_Int16 Flags
96     )
97         throw (
98             ::com::sun::star::uno::RuntimeException);
99 
100     virtual ::com::sun::star::awt::Rectangle SAL_CALL
101     getPosSize(
102     )
103         throw (
104             ::com::sun::star::uno::RuntimeException
105         );
106 
107     virtual void SAL_CALL
108     setVisible(
109         sal_Bool Visible
110     )
111         throw (
112             ::com::sun::star::uno::RuntimeException
113         );
114 
115     virtual void SAL_CALL
116     setEnable(
117         sal_Bool Enable
118     )
119         throw (
120             ::com::sun::star::uno::RuntimeException
121         );
122 
123     virtual void SAL_CALL
124     setFocus(
125     )
126         throw (
127             ::com::sun::star::uno::RuntimeException
128         );
129 
130     virtual void SAL_CALL
131     addWindowListener(
132         const ::com::sun::star::uno::Reference<
133         ::com::sun::star::awt::XWindowListener >& xListener
134     )
135         throw (
136             ::com::sun::star::uno::RuntimeException
137         );
138 
139     virtual void SAL_CALL
140     removeWindowListener(
141         const ::com::sun::star::uno::Reference<
142         ::com::sun::star::awt::XWindowListener >& xListener
143     )
144         throw (
145             ::com::sun::star::uno::RuntimeException
146         );
147 
148     virtual void SAL_CALL
149     addFocusListener(
150         const ::com::sun::star::uno::Reference<
151         ::com::sun::star::awt::XFocusListener >& xListener
152     )
153         throw (
154             ::com::sun::star::uno::RuntimeException
155         );
156 
157     virtual void SAL_CALL
158     removeFocusListener(
159         const ::com::sun::star::uno::Reference<
160         ::com::sun::star::awt::XFocusListener >& xListener
161     )
162         throw (
163             ::com::sun::star::uno::RuntimeException
164         );
165 
166     virtual void SAL_CALL
167     addKeyListener(
168         const ::com::sun::star::uno::Reference<
169         ::com::sun::star::awt::XKeyListener >& xListener
170     )
171         throw (
172             ::com::sun::star::uno::RuntimeException
173         );
174 
175     virtual void SAL_CALL
176     removeKeyListener(
177         const ::com::sun::star::uno::Reference<
178         ::com::sun::star::awt::XKeyListener >& xListener
179     )
180         throw (
181             ::com::sun::star::uno::RuntimeException
182         );
183 
184     virtual void SAL_CALL
185     addMouseListener(
186         const ::com::sun::star::uno::Reference<
187         ::com::sun::star::awt::XMouseListener >& xListener
188     )
189         throw (
190             ::com::sun::star::uno::RuntimeException
191         );
192 
193     virtual void SAL_CALL
194     removeMouseListener(
195         const ::com::sun::star::uno::Reference<
196         ::com::sun::star::awt::XMouseListener >& xListener
197     )
198         throw (
199             ::com::sun::star::uno::RuntimeException
200         );
201 
202     virtual void SAL_CALL
203     addMouseMotionListener(
204         const ::com::sun::star::uno::Reference<
205         ::com::sun::star::awt::XMouseMotionListener >& xListener
206     )
207         throw (
208             ::com::sun::star::uno::RuntimeException
209         );
210 
211     virtual void SAL_CALL
212     removeMouseMotionListener(
213         const ::com::sun::star::uno::Reference<
214         ::com::sun::star::awt::XMouseMotionListener >& xListener
215     )
216         throw (
217             ::com::sun::star::uno::RuntimeException
218         );
219 
220     virtual void SAL_CALL
221     addPaintListener(
222         const ::com::sun::star::uno::Reference<
223         ::com::sun::star::awt::XPaintListener >& xListener
224     )
225         throw (
226             ::com::sun::star::uno::RuntimeException
227         );
228 
229     virtual void SAL_CALL
230     removePaintListener(
231         const ::com::sun::star::uno::Reference<
232         ::com::sun::star::awt::XPaintListener >& xListener
233     )
234         throw (
235             ::com::sun::star::uno::RuntimeException
236         );
237 
238 
239 private:
240 
241     osl::Mutex m_aMutex;
242     cppu::OInterfaceContainerHelper *m_pDisposeEventListeners;
243 
244     HWND m_aHwnd;
245 };
246 
247 
248 #endif
249