xref: /AOO41X/main/bean/com/sun/star/comp/beans/Frame.java (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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.UnoRuntime;
31 
32 /** Wrapper class for a com.sun.star.frame.XFrame.
33  *
34  * @since OOo 2.0.0
35  */
36 public class Frame
37 	extends Wrapper
38 	implements
39 		com.sun.star.frame.XFrame,
40 		com.sun.star.frame.XDispatchProvider,
41 		com.sun.star.frame.XDispatchProviderInterception
42 {
43 	private com.sun.star.frame.XFrame xFrame;
44 	private com.sun.star.frame.XDispatchProvider xDispatchProvider;
45 	private com.sun.star.frame.XDispatchProviderInterception xDispatchProviderInterception;
46 
47 	public Frame( com.sun.star.frame.XFrame xFrame )
48 	{
49 		super( xFrame );
50 		this.xFrame = xFrame;
51 		xDispatchProvider = (com.sun.star.frame.XDispatchProvider)
52 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
53 				xFrame );
54 		xDispatchProviderInterception = (com.sun.star.frame.XDispatchProviderInterception)
55 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProviderInterception.class,
56 				xFrame );
57 	}
58 
59 	//==============================================================
60 	// com.sun.star.frame.XFrame
61 	//--------------------------------------------------------------
62 
63 	public void initialize( /*IN*/com.sun.star.awt.XWindow xWindow )
64 	{
65 		xFrame.initialize( xWindow );
66 	}
67 
68 	public com.sun.star.awt.XWindow getContainerWindow(  )
69 	{
70 		return xFrame.getContainerWindow();
71 	}
72 
73 	public void setCreator( /*IN*/ com.sun.star.frame.XFramesSupplier xCreator )
74 	{
75 		xFrame.setCreator( xCreator );
76 	}
77 
78 	public com.sun.star.frame.XFramesSupplier getCreator(  )
79 	{
80 		return xFrame.getCreator();
81 	}
82 
83 	public String getName(  )
84 	{
85 		return xFrame.getName();
86 	}
87 
88 	public void setName( /*IN*/ String aName )
89 	{
90 		xFrame.setName( aName );
91 	}
92 
93 	public com.sun.star.frame.XFrame findFrame( /*IN*/String aTargetFrameName, /*IN*/int nSearchFlags )
94 	{
95 		return xFrame.findFrame( aTargetFrameName, nSearchFlags );
96 	}
97 
98 	public boolean isTop(  )
99 	{
100 		return xFrame.isTop();
101 	}
102 
103 	public void activate(  )
104 	{
105 		xFrame.activate();
106 	}
107 
108 	public void deactivate(  )
109 	{
110 		xFrame.deactivate();
111 	}
112 
113 	public boolean isActive(  )
114 	{
115 		return xFrame.isActive();
116 	}
117 
118 	public boolean setComponent( /*IN*/com.sun.star.awt.XWindow xComponentWindow, /*IN*/ com.sun.star.frame.XController xController )
119 	{
120 		return xFrame.setComponent( xComponentWindow, xController );
121 	}
122 
123 	public com.sun.star.awt.XWindow getComponentWindow(  )
124 	{
125 		return xFrame.getComponentWindow();
126 	}
127 
128 	public com.sun.star.frame.XController getController(  )
129 	{
130 		return xFrame.getController();
131 	}
132 
133 	public void contextChanged(  )
134 	{
135 		xFrame.contextChanged();
136 	}
137 
138 	public void addFrameActionListener( /*IN*/ com.sun.star.frame.XFrameActionListener xListener )
139 	{
140 		xFrame.addFrameActionListener( xListener );
141 	}
142 
143 	public void removeFrameActionListener( /*IN*/ com.sun.star.frame.XFrameActionListener xListener )
144 	{
145 		xFrame.removeFrameActionListener( xListener );
146 	}
147 
148 	//==============================================================
149 	// com.sun.star.frame.XDispatchProvider
150 	//--------------------------------------------------------------
151 
152 	public com.sun.star.frame.XDispatch queryDispatch(
153 			/*IN*/ com.sun.star.util.URL aURL,
154 			/*IN*/ String aTargetFrameName,
155 			/*IN*/ int nSearchFlags )
156 	{
157 		return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
158 	}
159 
160 	public com.sun.star.frame.XDispatch[] queryDispatches(
161 			/*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
162 	{
163 		return xDispatchProvider.queryDispatches( aRequests );
164 	}
165 
166 	//==============================================================
167 	// com.sun.star.frame.XDispatchProviderInterception
168 	//--------------------------------------------------------------
169 
170 	public void registerDispatchProviderInterceptor(
171 			/*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
172 	{
173 		xDispatchProviderInterception.registerDispatchProviderInterceptor( xInterceptor );
174 	}
175 
176 	public void releaseDispatchProviderInterceptor(
177 			/*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
178 	{
179 		xDispatchProviderInterception.releaseDispatchProviderInterceptor( xInterceptor );
180 	}
181 };
182 
183