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