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