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