1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 *************************************************************************/ 27 28 package embeddedobj.test; 29 30 import java.awt.*; 31 32 import com.sun.star.uno.*; 33 import com.sun.star.lang.*; 34 import com.sun.star.awt.*; 35 import com.sun.star.util.*; 36 import com.sun.star.beans.*; 37 import com.sun.star.container.*; 38 39 /** <p>Class to pass the system window handle to the OpenOffice.org toolkit.</p> 40 */ 41 class JavaWindowPeerFake implements XSystemDependentWindowPeer, 42 XWindowPeer 43 { 44 NativeView maView; 45 46 public JavaWindowPeerFake( NativeView aNative ) 47 { 48 maView = aNative; 49 } 50 51 // ____________________ 52 /** 53 * Implementation of XSystemDependentWindowPeer ( that's all we really need ). 54 * This method is called back from the Office toolkit to retrieve the system data. 55 */ 56 public java.lang.Object getWindowHandle( byte[] aProcessId, short aSystem ) 57 throws com.sun.star.uno.RuntimeException 58 { 59 Object aReturn = null; 60 if( aSystem == maView.maSystem ) 61 aReturn = ( Object )maView.maHandle; 62 63 return aReturn; 64 } 65 66 /** not really neaded. 67 */ 68 public XToolkit getToolkit() 69 throws com.sun.star.uno.RuntimeException 70 { 71 return null; 72 } 73 74 public void setPointer( XPointer xPointer ) 75 throws com.sun.star.uno.RuntimeException 76 { 77 } 78 79 public void setBackground( int nColor ) 80 throws com.sun.star.uno.RuntimeException 81 { 82 } 83 84 public void invalidate( short nFlags ) 85 throws com.sun.star.uno.RuntimeException 86 { 87 } 88 89 public void invalidateRect( com.sun.star.awt.Rectangle aRect,short nFlags ) 90 throws com.sun.star.uno.RuntimeException 91 { 92 } 93 94 public void dispose() 95 throws com.sun.star.uno.RuntimeException 96 { 97 } 98 99 public void addEventListener( XEventListener xListener ) 100 throws com.sun.star.uno.RuntimeException 101 { 102 } 103 104 public void removeEventListener( XEventListener xListener ) 105 throws com.sun.star.uno.RuntimeException 106 { 107 } 108 } 109 110