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 #ifndef DBACCESS_CONTROLLERFRAME_HXX
25 #define DBACCESS_CONTROLLERFRAME_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/frame/XFrame.hpp>
29 #include <com/sun/star/frame/FrameAction.hpp>
30 /** === end UNO includes === **/
31 
32 #include <memory>
33 
34 //........................................................................
35 namespace dbaui
36 {
37 //........................................................................
38 
39     class IController;
40 
41 	//====================================================================
42 	//= ControllerFrame
43 	//====================================================================
44     struct ControllerFrame_Data;
45     /** helper class to ancapsulate the frame which a controller is plugged into,
46         doing some common actions on it.
47     */
48 	class ControllerFrame
49 	{
50     public:
51         ControllerFrame( IController& _rController );
52         ~ControllerFrame();
53 
54         /// attaches a new frame
55         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
56                 attachFrame(
57                     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
58                 );
59 
60         // retrieves the current frame
61         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
62                 getFrame() const;
63 
64         /** determines whether the frame is currently active
65         */
66         bool    isActive() const;
67 
68         /** notifies the instance that a certain frame action happened with our frame
69         */
70         void    frameAction( ::com::sun::star::frame::FrameAction _eAction );
71 
72     private:
73         ::std::auto_ptr< ControllerFrame_Data > m_pData;
74 	};
75 
76 //........................................................................
77 } // namespace dbaui
78 //........................................................................
79 
80 #endif // DBACCESS_CONTROLLERFRAME_HXX
81