xref: /trunk/main/embedserv/source/inc/xwin.hxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
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 
54     virtual void SAL_CALL
55     addEventListener(
56         const ::com::sun::star::uno::Reference<
57         ::com::sun::star::lang::XEventListener >& xListener
58     );
59 
60     virtual void SAL_CALL
61     removeEventListener(
62         const ::com::sun::star::uno::Reference<
63         ::com::sun::star::lang::XEventListener >& aListener
64     );
65 
66 
67     // XSystemDependentWindowPeer
68 
69     virtual ::com::sun::star::uno::Any SAL_CALL
70     getWindowHandle(
71         const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId,
72         sal_Int16 SystemType
73     );
74 
75     // XWindow
76 
77     virtual void SAL_CALL
78     setPosSize(
79         sal_Int32 X,
80         sal_Int32 Y,
81         sal_Int32 Width,
82         sal_Int32 Height,
83         sal_Int16 Flags
84     );
85 
86     virtual ::com::sun::star::awt::Rectangle SAL_CALL
87     getPosSize(
88     );
89 
90     virtual void SAL_CALL
91     setVisible(
92         sal_Bool Visible
93     );
94 
95     virtual void SAL_CALL
96     setEnable(
97         sal_Bool Enable
98     );
99 
100     virtual void SAL_CALL
101     setFocus(
102     );
103 
104     virtual void SAL_CALL
105     addWindowListener(
106         const ::com::sun::star::uno::Reference<
107         ::com::sun::star::awt::XWindowListener >& xListener
108     );
109 
110     virtual void SAL_CALL
111     removeWindowListener(
112         const ::com::sun::star::uno::Reference<
113         ::com::sun::star::awt::XWindowListener >& xListener
114     );
115 
116     virtual void SAL_CALL
117     addFocusListener(
118         const ::com::sun::star::uno::Reference<
119         ::com::sun::star::awt::XFocusListener >& xListener
120     );
121 
122     virtual void SAL_CALL
123     removeFocusListener(
124         const ::com::sun::star::uno::Reference<
125         ::com::sun::star::awt::XFocusListener >& xListener
126     );
127 
128     virtual void SAL_CALL
129     addKeyListener(
130         const ::com::sun::star::uno::Reference<
131         ::com::sun::star::awt::XKeyListener >& xListener
132     );
133 
134     virtual void SAL_CALL
135     removeKeyListener(
136         const ::com::sun::star::uno::Reference<
137         ::com::sun::star::awt::XKeyListener >& xListener
138     );
139 
140     virtual void SAL_CALL
141     addMouseListener(
142         const ::com::sun::star::uno::Reference<
143         ::com::sun::star::awt::XMouseListener >& xListener
144     );
145 
146     virtual void SAL_CALL
147     removeMouseListener(
148         const ::com::sun::star::uno::Reference<
149         ::com::sun::star::awt::XMouseListener >& xListener
150     );
151 
152     virtual void SAL_CALL
153     addMouseMotionListener(
154         const ::com::sun::star::uno::Reference<
155         ::com::sun::star::awt::XMouseMotionListener >& xListener
156     );
157 
158     virtual void SAL_CALL
159     removeMouseMotionListener(
160         const ::com::sun::star::uno::Reference<
161         ::com::sun::star::awt::XMouseMotionListener >& xListener
162     );
163 
164     virtual void SAL_CALL
165     addPaintListener(
166         const ::com::sun::star::uno::Reference<
167         ::com::sun::star::awt::XPaintListener >& xListener
168     );
169 
170     virtual void SAL_CALL
171     removePaintListener(
172         const ::com::sun::star::uno::Reference<
173         ::com::sun::star::awt::XPaintListener >& xListener
174     );
175 
176 
177 private:
178 
179     osl::Mutex m_aMutex;
180     cppu::OInterfaceContainerHelper *m_pDisposeEventListeners;
181 
182     HWND m_aHwnd;
183 };
184 
185 
186 #endif
187