Update ooo320-m1
[ooovba.git] / bean / com / sun / star / comp / beans / Controller.java
blobe4f968eecef42f52903345c4748f677ecd81c992
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: Controller.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 com.sun.star.comp.beans;
33 import com.sun.star.uno.UnoRuntime;
35 /** Wrapper class for a com.sun.star.frame.XController.
37 * @since OOo 2.0.0
39 public class Controller
40 extends Wrapper
41 implements
42 com.sun.star.frame.XController
44 private com.sun.star.frame.XController xController;
45 private com.sun.star.frame.XDispatchProvider xDispatchProvider;
47 Controller( com.sun.star.frame.XController xController )
49 super( xController );
50 this.xController = xController;
51 xDispatchProvider = (com.sun.star.frame.XDispatchProvider)
52 UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
53 xController );
56 //==============================================================
57 // com.sun.star.frame.XController
58 //--------------------------------------------------------------
60 public void attachFrame( /*IN*/ com.sun.star.frame.XFrame xFrame )
62 xController.attachFrame( xFrame );
65 public boolean attachModel( /*IN*/ com.sun.star.frame.XModel xModel )
67 return xController.attachModel( xModel );
70 public boolean suspend( /*IN*/boolean bSuspend )
72 return xController.suspend( bSuspend );
75 public java.lang.Object getViewData( )
77 return xController.getViewData();
80 public void restoreViewData( /*IN*/java.lang.Object aData )
82 xController.restoreViewData( aData );
85 public com.sun.star.frame.XModel getModel( )
87 return xController.getModel();
90 public com.sun.star.frame.XFrame getFrame( )
92 return xController.getFrame();
95 //==============================================================
96 // com.sun.star.frame.XDispatchProvider
97 //--------------------------------------------------------------
99 public com.sun.star.frame.XDispatch queryDispatch(
100 /*IN*/ com.sun.star.util.URL aURL,
101 /*IN*/ String aTargetFrameName,
102 /*IN*/ int nSearchFlags )
104 return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
107 public com.sun.star.frame.XDispatch[] queryDispatches(
108 /*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
110 return xDispatchProvider.queryDispatches( aRequests );