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