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 com.sun.star.comp.beans;
25 
26 import com.sun.star.uno.*;
27 import com.sun.star.awt.*;
28 
29 /** <p>Class to pass the system window handle to the OpenOffice.org toolkit.</p>
30  *
31  * @since OOo 2.0.0
32  */
33 /* package */ class JavaWindowPeerFake
34 	implements XSystemDependentWindowPeer, XWindowPeer
35 {
36  	protected int localSystemType;
37     protected Any wrappedHandle;
38 
39 	/** Create the faked window peer.
40 	 * @param _hWindow the system handle to the window.
41 	 * @param _systemType specifies the system type.
42 	 */
JavaWindowPeerFake(Any _hWindow, int _systemType)43 	public JavaWindowPeerFake(Any _hWindow, int _systemType)
44 	{
45         localSystemType = _systemType;
46         wrappedHandle = _hWindow;
47 	}
48 
49 	/** <p>Implementation of XSystemDependentWindowPeer (that's all we really need)</p>
50 	 *  This method is called back from the OpenOffice.org toolkit to retrieve the system data.
51 	 */
getWindowHandle( byte[] ProcessId, short SystemType)52     public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType)
53 		throws com.sun.star.uno.RuntimeException
54 	{
55 		if (SystemType == localSystemType) {
56 			return wrappedHandle;
57 		}
58 		else return null;
59 	}
60 
61 	/** not really neaded.
62 	 */
getToolkit()63     public XToolkit getToolkit()
64 		throws com.sun.star.uno.RuntimeException
65 	{
66 		return null;
67 	}
68 
69 	/** not really neaded.
70 	 */
setPointer( XPointer Pointer)71     public void setPointer(/*IN*/XPointer Pointer)
72 		throws com.sun.star.uno.RuntimeException
73 	{
74 	}
75 
76 	/** not really neaded.
77 	 */
setBackground( int Color)78     public void setBackground(/*IN*/int Color)
79 		throws com.sun.star.uno.RuntimeException
80 	{
81 	}
82 
83 	/** not really neaded.
84 	 */
invalidate( short Flags)85     public void invalidate(/*IN*/short Flags)
86 		throws com.sun.star.uno.RuntimeException
87 	{
88 	}
89 
90 	/** not really neaded.
91 	 */
invalidateRect( com.sun.star.awt.Rectangle Rect, short Flags)92     public void invalidateRect(/*IN*/com.sun.star.awt.Rectangle Rect, /*IN*/short Flags)
93 		throws com.sun.star.uno.RuntimeException
94 	{
95 	}
96 
97 	/** not really neaded.
98 	 */
dispose()99     public void dispose()
100 		throws com.sun.star.uno.RuntimeException
101 	{
102 	}
103 
104 	/** not really neaded.
105 	 */
addEventListener( com.sun.star.lang.XEventListener xListener)106     public void addEventListener(/*IN*/com.sun.star.lang.XEventListener xListener)
107 		throws com.sun.star.uno.RuntimeException
108 	{
109 	}
110 
111 	/** not really neaded.
112 	 */
removeEventListener( com.sun.star.lang.XEventListener aListener)113     public void removeEventListener(/*IN*/com.sun.star.lang.XEventListener aListener)
114 		throws com.sun.star.uno.RuntimeException
115 	{
116 	}
117 }
118 
119