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 package embeddedobj.test;
25 
26 import java.awt.*;
27 
28 import com.sun.star.uno.*;
29 import com.sun.star.lang.*;
30 import com.sun.star.awt.*;
31 import com.sun.star.util.*;
32 import com.sun.star.beans.*;
33 import com.sun.star.container.*;
34 
35 /** <p>Class to pass the system window handle to the OpenOffice.org toolkit.</p>
36  */
37 class JavaWindowPeerFake implements XSystemDependentWindowPeer,
38 									XWindowPeer
39 {
40 	NativeView maView;
41 
JavaWindowPeerFake( NativeView aNative )42 	public JavaWindowPeerFake( NativeView aNative )
43 	{
44 		maView = aNative;
45 	}
46 
47 	// ____________________
48 	/**
49 	 * Implementation of XSystemDependentWindowPeer ( that's all we really need ).
50 	 * This method is called back from the Office toolkit to retrieve the system data.
51 	 */
getWindowHandle( byte[] aProcessId, short aSystem )52 	public java.lang.Object getWindowHandle( byte[] aProcessId, short aSystem )
53 		throws com.sun.star.uno.RuntimeException
54 	{
55 		Object aReturn = null;
56 		if( aSystem == maView.maSystem )
57 			aReturn = ( Object )maView.maHandle;
58 
59 		return aReturn;
60 	}
61 
62 	/** not really neaded.
63 	 */
getToolkit()64 	public XToolkit getToolkit()
65 		throws com.sun.star.uno.RuntimeException
66 	{
67 		return null;
68 	}
69 
setPointer( XPointer xPointer )70 	public void setPointer( XPointer xPointer )
71 		throws com.sun.star.uno.RuntimeException
72 	{
73 	}
74 
setBackground( int nColor )75 	public void setBackground( int nColor )
76 		throws com.sun.star.uno.RuntimeException
77 	{
78 	}
79 
invalidate( short nFlags )80 	public void invalidate( short nFlags )
81 		throws com.sun.star.uno.RuntimeException
82 	{
83 	}
84 
invalidateRect( com.sun.star.awt.Rectangle aRect,short nFlags )85 	public void invalidateRect( com.sun.star.awt.Rectangle aRect,short nFlags )
86 		throws com.sun.star.uno.RuntimeException
87 	{
88 	}
89 
dispose()90 	public void dispose()
91 		throws com.sun.star.uno.RuntimeException
92 	{
93 	}
94 
addEventListener( XEventListener xListener )95 	public void addEventListener( XEventListener xListener )
96 		throws com.sun.star.uno.RuntimeException
97 	{
98 	}
99 
removeEventListener( XEventListener xListener )100 	public void removeEventListener( XEventListener xListener )
101 		throws com.sun.star.uno.RuntimeException
102 	{
103 	}
104 }
105 
106