update dev300-m58
[ooovba.git] / embeddedobj / test / Container1 / JavaWindowPeerFake.java
blob7f70867cd3a0ddfb3586dc9cf50388d30e5c127a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: JavaWindowPeerFake.java,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 *************************************************************************/
31 package embeddedobj.test;
33 import java.awt.*;
35 import com.sun.star.uno.*;
36 import com.sun.star.lang.*;
37 import com.sun.star.awt.*;
38 import com.sun.star.util.*;
39 import com.sun.star.beans.*;
40 import com.sun.star.container.*;
42 /** <p>Class to pass the system window handle to the OpenOffice.org toolkit.</p>
44 class JavaWindowPeerFake implements XSystemDependentWindowPeer,
45 XWindowPeer
47 NativeView maView;
49 public JavaWindowPeerFake( NativeView aNative )
51 maView = aNative;
54 // ____________________
55 /**
56 * Implementation of XSystemDependentWindowPeer ( that's all we really need ).
57 * This method is called back from the Office toolkit to retrieve the system data.
59 public java.lang.Object getWindowHandle( byte[] aProcessId, short aSystem )
60 throws com.sun.star.uno.RuntimeException
62 Object aReturn = null;
63 if( aSystem == maView.maSystem )
64 aReturn = ( Object )maView.maHandle;
66 return aReturn;
69 /** not really neaded.
71 public XToolkit getToolkit()
72 throws com.sun.star.uno.RuntimeException
74 return null;
77 public void setPointer( XPointer xPointer )
78 throws com.sun.star.uno.RuntimeException
82 public void setBackground( int nColor )
83 throws com.sun.star.uno.RuntimeException
87 public void invalidate( short nFlags )
88 throws com.sun.star.uno.RuntimeException
92 public void invalidateRect( com.sun.star.awt.Rectangle aRect,short nFlags )
93 throws com.sun.star.uno.RuntimeException
97 public void dispose()
98 throws com.sun.star.uno.RuntimeException
102 public void addEventListener( XEventListener xListener )
103 throws com.sun.star.uno.RuntimeException
107 public void removeEventListener( XEventListener xListener )
108 throws com.sun.star.uno.RuntimeException