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 _REPORT_PROPBRW_HXX
29 #define _REPORT_PROPBRW_HXX
30 
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/awt/XControlContainer.hpp>
34 #include <com/sun/star/frame/XFrame.hpp>
35 #include <com/sun/star/inspection/XObjectInspector.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <svl/brdcst.hxx>
38 #include <svl/lstner.hxx>
39 #include <vcl/dockwin.hxx>
40 #include <svx/svdmark.hxx>
41 #include "ModuleHelper.hxx"
42 
43 namespace rptui
44 {
45 
46 class OSectionView;
47 class ODesignView;
48 class OObjectBase;
49 //============================================================================
50 // PropBrw
51 //============================================================================
52 
53 class PropBrw : public DockingWindow , public SfxListener, public SfxBroadcaster
54 {
55 private:
56     OModuleClient	    m_aModuleClient;
57     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
58                         m_xInspectorContext;
59 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
60 					    m_xORB;
61 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
62 					    m_xMeAsFrame;
63 	::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspector >
64 					    m_xBrowserController;
65 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
66 					    m_xBrowserComponentWindow;
67     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>
68                         m_xLastSection; /// is the previously displayed section
69     ::rtl::OUString     m_sLastActivePage;
70     ODesignView*        m_pDesignView;
71     OSectionView*	    m_pView;
72     sal_Bool		    m_bInitialStateChange;
73 
74     PropBrw(PropBrw&);
75     void operator =(PropBrw&);
76 protected:
77 
78 	virtual void Resize();
79 	virtual sal_Bool Close();
80 
81 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >
82         CreateCompPropSet(const SdrMarkList& rMarkList);
83 
84 	void implSetNewObject(
85 		const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >& _aObjects = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >());
86 
87 	::rtl::OUString GetHeadlineName(
88 		const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >& _aObjects);
89 
90 	void implDetachController();
91     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> CreateComponentPair(OObjectBase* _pObj);
92     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> CreateComponentPair(
93              const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xFormComponent
94             ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
95     DECL_LINK( OnAsyncGetFocus, void* );
96 
97 public:
98 	PropBrw(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&	_xORB
99 			,Window* pParent
100             ,ODesignView*  _pDesignView);
101 	virtual ~PropBrw();
102 
103     virtual void LoseFocus();
104 
105 	void	Update( OSectionView* m_pView );
106 	void	Update( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
107 	inline OSectionView*	GetCurView() const { return m_pView; }
108     ::rtl::OUString         getCurrentPage() const;
109     void                    setCurrentPage(const ::rtl::OUString& _sLastActivePage);
110 
111     ::Size getMinimumSize() const;
112 private:
113     using Window::Update;
114 };
115 //==============================================================================
116 } // rptui
117 //==============================================================================
118 #endif // _REPORT_PROPBRW_HXX
119