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