134dd1e25SAndrew Rist /************************************************************** 234dd1e25SAndrew Rist * 334dd1e25SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 434dd1e25SAndrew Rist * or more contributor license agreements. See the NOTICE file 534dd1e25SAndrew Rist * distributed with this work for additional information 634dd1e25SAndrew Rist * regarding copyright ownership. The ASF licenses this file 734dd1e25SAndrew Rist * to you under the Apache License, Version 2.0 (the 834dd1e25SAndrew Rist * "License"); you may not use this file except in compliance 934dd1e25SAndrew Rist * with the License. You may obtain a copy of the License at 1034dd1e25SAndrew Rist * 1134dd1e25SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 1234dd1e25SAndrew Rist * 1334dd1e25SAndrew Rist * Unless required by applicable law or agreed to in writing, 1434dd1e25SAndrew Rist * software distributed under the License is distributed on an 1534dd1e25SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1634dd1e25SAndrew Rist * KIND, either express or implied. See the License for the 1734dd1e25SAndrew Rist * specific language governing permissions and limitations 1834dd1e25SAndrew Rist * under the License. 1934dd1e25SAndrew Rist * 2034dd1e25SAndrew Rist *************************************************************/ 2134dd1e25SAndrew Rist 2234dd1e25SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir import java.awt.*; 25cdf0e10cSrcweir 26cdf0e10cSrcweir 27*16e97b58SMatthias Seidel /** <p>Class to pass the system window handle to the OpenOffice toolkit.</p> 28cdf0e10cSrcweir */ 29cdf0e10cSrcweir class JavaWindowPeerFake implements com.sun.star.awt.XSystemDependentWindowPeer, 30*16e97b58SMatthias Seidel com.sun.star.awt.XWindowPeer 31cdf0e10cSrcweir { 32*16e97b58SMatthias Seidel NativeView maView; 33cdf0e10cSrcweir JavaWindowPeerFake(NativeView aNative)34*16e97b58SMatthias Seidel public JavaWindowPeerFake(NativeView aNative) 35*16e97b58SMatthias Seidel { 36*16e97b58SMatthias Seidel maView = aNative; 37*16e97b58SMatthias Seidel } 38cdf0e10cSrcweir 39*16e97b58SMatthias Seidel // ____________________ 40*16e97b58SMatthias Seidel /** 41*16e97b58SMatthias Seidel * Implementation of XSystemDependentWindowPeer (that's all we really need). 42*16e97b58SMatthias Seidel * This method is called back from the OpenOffice toolkit to retrieve the system data. 43cdf0e10cSrcweir */ getWindowHandle(byte[] aProcessId, short aSystem)44*16e97b58SMatthias Seidel public java.lang.Object getWindowHandle(byte[] aProcessId, short aSystem) 45*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 46*16e97b58SMatthias Seidel { 47*16e97b58SMatthias Seidel Object aReturn = null; 48*16e97b58SMatthias Seidel if(aSystem==maView.maSystem) 49*16e97b58SMatthias Seidel aReturn = (Object)maView.maHandle; 50*16e97b58SMatthias Seidel return aReturn; 51cdf0e10cSrcweir } 52cdf0e10cSrcweir 53*16e97b58SMatthias Seidel /** not really needed. 54cdf0e10cSrcweir */ getToolkit()55*16e97b58SMatthias Seidel public com.sun.star.awt.XToolkit getToolkit() 56*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 57*16e97b58SMatthias Seidel { 58cdf0e10cSrcweir return null; 59cdf0e10cSrcweir } 60cdf0e10cSrcweir setPointer(com.sun.star.awt.XPointer xPointer)61*16e97b58SMatthias Seidel public void setPointer(com.sun.star.awt.XPointer xPointer) 62*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 63*16e97b58SMatthias Seidel { 64cdf0e10cSrcweir } 65cdf0e10cSrcweir setBackground(int nColor)66*16e97b58SMatthias Seidel public void setBackground(int nColor) 67*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 68*16e97b58SMatthias Seidel { 69cdf0e10cSrcweir } 70cdf0e10cSrcweir invalidate(short nFlags)71*16e97b58SMatthias Seidel public void invalidate(short nFlags) 72*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 73*16e97b58SMatthias Seidel { 74cdf0e10cSrcweir } 75cdf0e10cSrcweir invalidateRect(com.sun.star.awt.Rectangle aRect,short nFlags)76*16e97b58SMatthias Seidel public void invalidateRect(com.sun.star.awt.Rectangle aRect,short nFlags) 77*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 78*16e97b58SMatthias Seidel { 79cdf0e10cSrcweir } 80cdf0e10cSrcweir dispose()81*16e97b58SMatthias Seidel public void dispose() 82*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 83*16e97b58SMatthias Seidel { 84cdf0e10cSrcweir } 85cdf0e10cSrcweir addEventListener(com.sun.star.lang.XEventListener xListener)86*16e97b58SMatthias Seidel public void addEventListener(com.sun.star.lang.XEventListener xListener) 87*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 88*16e97b58SMatthias Seidel { 89cdf0e10cSrcweir } 90cdf0e10cSrcweir removeEventListener(com.sun.star.lang.XEventListener xListener)91*16e97b58SMatthias Seidel public void removeEventListener(com.sun.star.lang.XEventListener xListener) 92*16e97b58SMatthias Seidel throws com.sun.star.uno.RuntimeException 93*16e97b58SMatthias Seidel { 94cdf0e10cSrcweir } 95cdf0e10cSrcweir } 96cdf0e10cSrcweir 97