1*d4cc1e8cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d4cc1e8cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d4cc1e8cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d4cc1e8cSAndrew Rist  * distributed with this work for additional information
6*d4cc1e8cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d4cc1e8cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d4cc1e8cSAndrew Rist  * "License"); you may not use this file except in compliance
9*d4cc1e8cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d4cc1e8cSAndrew Rist  *
11*d4cc1e8cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d4cc1e8cSAndrew Rist  *
13*d4cc1e8cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d4cc1e8cSAndrew Rist  * software distributed under the License is distributed on an
15*d4cc1e8cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d4cc1e8cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d4cc1e8cSAndrew Rist  * specific language governing permissions and limitations
18*d4cc1e8cSAndrew Rist  * under the License.
19*d4cc1e8cSAndrew Rist  *
20*d4cc1e8cSAndrew Rist  *************************************************************/
21*d4cc1e8cSAndrew Rist 
22*d4cc1e8cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package com.sun.star.comp.beans;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir /** Wrapper class for a com.sun.star.frame.XController.
29cdf0e10cSrcweir  *
30cdf0e10cSrcweir  * @since OOo 2.0.0
31cdf0e10cSrcweir  */
32cdf0e10cSrcweir public class Controller
33cdf0e10cSrcweir 	extends Wrapper
34cdf0e10cSrcweir 	implements
35cdf0e10cSrcweir 		com.sun.star.frame.XController
36cdf0e10cSrcweir {
37cdf0e10cSrcweir 	private com.sun.star.frame.XController xController;
38cdf0e10cSrcweir 	private com.sun.star.frame.XDispatchProvider xDispatchProvider;
39cdf0e10cSrcweir 
Controller( com.sun.star.frame.XController xController )40cdf0e10cSrcweir 	Controller( com.sun.star.frame.XController xController )
41cdf0e10cSrcweir 	{
42cdf0e10cSrcweir 		super( xController );
43cdf0e10cSrcweir 		this.xController = xController;
44cdf0e10cSrcweir 		xDispatchProvider = (com.sun.star.frame.XDispatchProvider)
45cdf0e10cSrcweir 			UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
46cdf0e10cSrcweir 				xController );
47cdf0e10cSrcweir 	}
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	//==============================================================
50cdf0e10cSrcweir 	// com.sun.star.frame.XController
51cdf0e10cSrcweir 	//--------------------------------------------------------------
52cdf0e10cSrcweir 
attachFrame( com.sun.star.frame.XFrame xFrame )53cdf0e10cSrcweir 	public void attachFrame( /*IN*/ com.sun.star.frame.XFrame xFrame )
54cdf0e10cSrcweir 	{
55cdf0e10cSrcweir 	    xController.attachFrame( xFrame );
56cdf0e10cSrcweir 	}
57cdf0e10cSrcweir 
attachModel( com.sun.star.frame.XModel xModel )58cdf0e10cSrcweir 	public boolean attachModel( /*IN*/ com.sun.star.frame.XModel xModel )
59cdf0e10cSrcweir 	{
60cdf0e10cSrcweir 	    return xController.attachModel( xModel );
61cdf0e10cSrcweir 	}
62cdf0e10cSrcweir 
suspend( boolean bSuspend )63cdf0e10cSrcweir 	public boolean suspend( /*IN*/boolean bSuspend )
64cdf0e10cSrcweir 	{
65cdf0e10cSrcweir 	    return xController.suspend( bSuspend );
66cdf0e10cSrcweir 	}
67cdf0e10cSrcweir 
getViewData( )68cdf0e10cSrcweir 	public java.lang.Object getViewData(  )
69cdf0e10cSrcweir 	{
70cdf0e10cSrcweir 	    return xController.getViewData();
71cdf0e10cSrcweir 	}
72cdf0e10cSrcweir 
restoreViewData( java.lang.Object aData )73cdf0e10cSrcweir 	public void restoreViewData( /*IN*/java.lang.Object aData )
74cdf0e10cSrcweir 	{
75cdf0e10cSrcweir 	    xController.restoreViewData( aData );
76cdf0e10cSrcweir 	}
77cdf0e10cSrcweir 
getModel( )78cdf0e10cSrcweir 	public com.sun.star.frame.XModel getModel(  )
79cdf0e10cSrcweir 	{
80cdf0e10cSrcweir 	    return xController.getModel();
81cdf0e10cSrcweir 	}
82cdf0e10cSrcweir 
getFrame( )83cdf0e10cSrcweir 	public com.sun.star.frame.XFrame getFrame(  )
84cdf0e10cSrcweir 	{
85cdf0e10cSrcweir 	    return xController.getFrame();
86cdf0e10cSrcweir 	}
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	//==============================================================
89cdf0e10cSrcweir 	// com.sun.star.frame.XDispatchProvider
90cdf0e10cSrcweir 	//--------------------------------------------------------------
91cdf0e10cSrcweir 
queryDispatch( com.sun.star.util.URL aURL, String aTargetFrameName, int nSearchFlags )92cdf0e10cSrcweir 	public com.sun.star.frame.XDispatch queryDispatch(
93cdf0e10cSrcweir 			/*IN*/ com.sun.star.util.URL aURL,
94cdf0e10cSrcweir 			/*IN*/ String aTargetFrameName,
95cdf0e10cSrcweir 			/*IN*/ int nSearchFlags )
96cdf0e10cSrcweir 	{
97cdf0e10cSrcweir 		return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
98cdf0e10cSrcweir 	}
99cdf0e10cSrcweir 
queryDispatches( com.sun.star.frame.DispatchDescriptor[] aRequests )100cdf0e10cSrcweir 	public com.sun.star.frame.XDispatch[] queryDispatches(
101cdf0e10cSrcweir 			/*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
102cdf0e10cSrcweir 	{
103cdf0e10cSrcweir 		return xDispatchProvider.queryDispatches( aRequests );
104cdf0e10cSrcweir 	}
105cdf0e10cSrcweir }
106cdf0e10cSrcweir 
107