xref: /aoo4110/main/basctl/source/inc/propbrw.hxx (revision b1cdbd2c)
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 _BASCTL_PROPBRW_HXX
25 #define _BASCTL_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 <comphelper/composedprops.hxx>
32 #include <sfx2/basedlgs.hxx>
33 #include <svl/brdcst.hxx>
34 #include <svl/lstner.hxx>
35 #include <sfx2/childwin.hxx>
36 #include <svx/svdmark.hxx>
37 
38 //============================================================================
39 // PropBrwMgr
40 //============================================================================
41 
42 class PropBrwMgr : public SfxChildWindow
43 {
44 public:
45 	PropBrwMgr(Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo);
46 	SFX_DECL_CHILDWINDOW(PropBrwMgr);
47 };
48 
49 //============================================================================
50 // PropBrw
51 //============================================================================
52 
53 class SfxBindings;
54 class SdrView;
55 
56 class PropBrw : public SfxFloatingWindow , public SfxListener, public SfxBroadcaster
57 {
58 private:
59 	sal_Bool		m_bInitialStateChange;
60 
61 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
62 					m_xORB;
63 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
64 					m_xMeAsFrame;
65 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
66 					m_xBrowserController;
67 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
68 					m_xBrowserComponentWindow;
69 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
70 					m_xContextDocument;
71 
72 protected:
73 	SdrView*		pView;
74 	virtual void Resize();
75 	virtual void FillInfo( SfxChildWinInfo& rInfo ) const;
76 	virtual sal_Bool Close();
77 
78 	DECLARE_STL_VECTOR(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>, InterfaceArray);
79 
80 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >
81 		CreateMultiSelectionSequence( const SdrMarkList& _rMarkList );
82 	void implSetNewObjectSequence( const ::com::sun::star::uno::Sequence
83 		< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& _rObjectSeq );
84 
85 	void implSetNewObject(
86 		const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject);
87 
88 	::rtl::OUString GetHeadlineName(
89 		const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject);
90 
91 public:
92 	PropBrw( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB,
93 			 SfxBindings *pBindings,
94 			 PropBrwMgr* pMgr,
95 			 Window* pParent,
96 			 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
97 	);
98 	virtual ~PropBrw();
99 	using Window::Update;
100     // note: changing the Context document to an instance other than the one given in the ctor is not supported
101     // currently
102     void    Update( const SfxViewShell* _pShell );
GetCurView() const103 	SdrView*		GetCurView() const { return pView; }
104 
105 private:
106     void    ImplUpdate( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument, SdrView* pView );
107     void    ImplDestroyController();
108     void    ImplReCreateController();
109 };
110 
111 #endif // _BASCTL_PROPBRW_HXX
112