1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DBACCESS_CONTROLLERFRAME_HXX
29 #define DBACCESS_CONTROLLERFRAME_HXX
30 
31 /** === begin UNO includes === **/
32 #include <com/sun/star/frame/XFrame.hpp>
33 #include <com/sun/star/frame/FrameAction.hpp>
34 /** === end UNO includes === **/
35 
36 #include <memory>
37 
38 //........................................................................
39 namespace dbaui
40 {
41 //........................................................................
42 
43     class IController;
44 
45 	//====================================================================
46 	//= ControllerFrame
47 	//====================================================================
48     struct ControllerFrame_Data;
49     /** helper class to ancapsulate the frame which a controller is plugged into,
50         doing some common actions on it.
51     */
52 	class ControllerFrame
53 	{
54     public:
55         ControllerFrame( IController& _rController );
56         ~ControllerFrame();
57 
58         /// attaches a new frame
59         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
60                 attachFrame(
61                     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
62                 );
63 
64         // retrieves the current frame
65         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
66                 getFrame() const;
67 
68         /** determines whether the frame is currently active
69         */
70         bool    isActive() const;
71 
72         /** notifies the instance that a certain frame action happened with our frame
73         */
74         void    frameAction( ::com::sun::star::frame::FrameAction _eAction );
75 
76     private:
77         ::std::auto_ptr< ControllerFrame_Data > m_pData;
78 	};
79 
80 //........................................................................
81 } // namespace dbaui
82 //........................................................................
83 
84 #endif // DBACCESS_CONTROLLERFRAME_HXX
85