1 /*
2  * This file is part of the LibreOffice project.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  *
8  * This file incorporates work covered by the following license notice:
9  *
10  *   Licensed to the Apache Software Foundation (ASF) under one or more
11  *   contributor license agreements. See the NOTICE file distributed
12  *   with this work for additional information regarding copyright
13  *   ownership. The ASF licenses this file to you under the Apache
14  *   License, Version 2.0 (the "License"); you may not use this file
15  *   except in compliance with the License. You may obtain a copy of
16  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
17  */
18 
19 package com.sun.star.comp.beans;
20 
21 import com.sun.star.uno.UnoRuntime;
22 
23 /** Wrapper class for a com.sun.star.frame.XFrame.
24  *
25  * @since OOo 2.0.0
26  */
27 public class Frame
28     extends Wrapper
29     implements
30         com.sun.star.frame.XFrame,
31         com.sun.star.frame.XDispatchProvider,
32         com.sun.star.frame.XDispatchProviderInterception
33 {
34     private final com.sun.star.frame.XFrame xFrame;
35     private final com.sun.star.frame.XDispatchProvider xDispatchProvider;
36     private final com.sun.star.frame.XDispatchProviderInterception xDispatchProviderInterception;
37 
Frame( com.sun.star.frame.XFrame xFrame )38     public Frame( com.sun.star.frame.XFrame xFrame )
39     {
40         super( xFrame );
41         this.xFrame = xFrame;
42         xDispatchProvider = UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProvider.class,
43             xFrame );
44         xDispatchProviderInterception = UnoRuntime.queryInterface( com.sun.star.frame.XDispatchProviderInterception.class,
45             xFrame );
46     }
47 
48 
49     // com.sun.star.frame.XFrame
50 
51 
initialize( com.sun.star.awt.XWindow xWindow )52     public void initialize( /*IN*/ com.sun.star.awt.XWindow xWindow )
53     {
54         xFrame.initialize( xWindow );
55     }
56 
getContainerWindow( )57     public com.sun.star.awt.XWindow getContainerWindow(  )
58     {
59         return xFrame.getContainerWindow();
60     }
61 
setCreator( com.sun.star.frame.XFramesSupplier xCreator )62     public void setCreator( /*IN*/ com.sun.star.frame.XFramesSupplier xCreator )
63     {
64         xFrame.setCreator( xCreator );
65     }
66 
getCreator( )67     public com.sun.star.frame.XFramesSupplier getCreator(  )
68     {
69         return xFrame.getCreator();
70     }
71 
getName( )72     public String getName(  )
73     {
74         return xFrame.getName();
75     }
76 
setName( String aName )77     public void setName( /*IN*/ String aName )
78     {
79         xFrame.setName( aName );
80     }
81 
findFrame( String aTargetFrameName, int nSearchFlags )82     public com.sun.star.frame.XFrame findFrame( /*IN*/ String aTargetFrameName, /*IN*/ int nSearchFlags )
83     {
84         return xFrame.findFrame( aTargetFrameName, nSearchFlags );
85     }
86 
isTop( )87     public boolean isTop(  )
88     {
89         return xFrame.isTop();
90     }
91 
activate( )92     public void activate(  )
93     {
94         xFrame.activate();
95     }
96 
deactivate( )97     public void deactivate(  )
98     {
99         xFrame.deactivate();
100     }
101 
isActive( )102     public boolean isActive(  )
103     {
104         return xFrame.isActive();
105     }
106 
setComponent( com.sun.star.awt.XWindow xComponentWindow, com.sun.star.frame.XController xController )107     public boolean setComponent( /*IN*/ com.sun.star.awt.XWindow xComponentWindow, /*IN*/ com.sun.star.frame.XController xController )
108     {
109         return xFrame.setComponent( xComponentWindow, xController );
110     }
111 
getComponentWindow( )112     public com.sun.star.awt.XWindow getComponentWindow(  )
113     {
114         return xFrame.getComponentWindow();
115     }
116 
getController( )117     public com.sun.star.frame.XController getController(  )
118     {
119         return xFrame.getController();
120     }
121 
contextChanged( )122     public void contextChanged(  )
123     {
124         xFrame.contextChanged();
125     }
126 
addFrameActionListener( com.sun.star.frame.XFrameActionListener xListener )127     public void addFrameActionListener( /*IN*/ com.sun.star.frame.XFrameActionListener xListener )
128     {
129         xFrame.addFrameActionListener( xListener );
130     }
131 
removeFrameActionListener( com.sun.star.frame.XFrameActionListener xListener )132     public void removeFrameActionListener( /*IN*/ com.sun.star.frame.XFrameActionListener xListener )
133     {
134         xFrame.removeFrameActionListener( xListener );
135     }
136 
137 
138     // com.sun.star.frame.XDispatchProvider
139 
140 
queryDispatch( com.sun.star.util.URL aURL, String aTargetFrameName, int nSearchFlags )141     public com.sun.star.frame.XDispatch queryDispatch(
142             /*IN*/ com.sun.star.util.URL aURL,
143             /*IN*/ String aTargetFrameName,
144             /*IN*/ int nSearchFlags )
145     {
146         return xDispatchProvider.queryDispatch( aURL, aTargetFrameName, nSearchFlags );
147     }
148 
queryDispatches( com.sun.star.frame.DispatchDescriptor[] aRequests )149     public com.sun.star.frame.XDispatch[] queryDispatches(
150             /*IN*/ com.sun.star.frame.DispatchDescriptor[] aRequests )
151     {
152         return xDispatchProvider.queryDispatches( aRequests );
153     }
154 
155 
156     // com.sun.star.frame.XDispatchProviderInterception
157 
158 
registerDispatchProviderInterceptor( com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )159     public void registerDispatchProviderInterceptor(
160             /*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
161     {
162         xDispatchProviderInterception.registerDispatchProviderInterceptor( xInterceptor );
163     }
164 
releaseDispatchProviderInterceptor( com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )165     public void releaseDispatchProviderInterceptor(
166             /*IN*/ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor )
167     {
168         xDispatchProviderInterception.releaseDispatchProviderInterceptor( xInterceptor );
169     }
170 }
171 
172