1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir #ifndef SVX_FMPROPBRW_HXX 24cdf0e10cSrcweir #define SVX_FMPROPBRW_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir /** === begin UNO includes === **/ 27cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 28cdf0e10cSrcweir #include <com/sun/star/awt/XControlContainer.hpp> 29cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 30cdf0e10cSrcweir #include <com/sun/star/inspection/XObjectInspectorModel.hpp> 31cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 32cdf0e10cSrcweir /** === end UNO includes === **/ 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <sfx2/basedlgs.hxx> 35cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 36cdf0e10cSrcweir #include <sfx2/childwin.hxx> 37cdf0e10cSrcweir #include "svx/fmtools.hxx" 38cdf0e10cSrcweir 39cdf0e10cSrcweir //======================================================================== 40cdf0e10cSrcweir class FmPropBrwMgr : public SfxChildWindow 41cdf0e10cSrcweir { 42cdf0e10cSrcweir public: 43cdf0e10cSrcweir FmPropBrwMgr(Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo); 44cdf0e10cSrcweir SFX_DECL_CHILDWINDOW(FmPropBrwMgr); 45cdf0e10cSrcweir }; 46cdf0e10cSrcweir 47cdf0e10cSrcweir class FmPropControl; 48cdf0e10cSrcweir class SfxBindings; 49cdf0e10cSrcweir class FmFormShell; 50cdf0e10cSrcweir //======================================================================== 51cdf0e10cSrcweir class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem 52cdf0e10cSrcweir { 53cdf0e10cSrcweir sal_Bool m_bInitialStateChange; 54cdf0e10cSrcweir bool m_bInStateChange; 55cdf0e10cSrcweir ::rtl::OUString m_sLastActivePage; 56cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > 57cdf0e10cSrcweir m_xInspectorContext; 58cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > 59cdf0e10cSrcweir m_xORB; 60cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > 61cdf0e10cSrcweir m_xMeAsFrame; 62cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 63cdf0e10cSrcweir m_xLastKnownDocument; 64cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > 65cdf0e10cSrcweir m_xInspectorModel; 66cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > 67cdf0e10cSrcweir m_xBrowserController; 68cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > 69cdf0e10cSrcweir m_xBrowserComponentWindow; 70cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > 71cdf0e10cSrcweir m_xFrameContainerWindow; 72cdf0e10cSrcweir 73cdf0e10cSrcweir protected: 74cdf0e10cSrcweir virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState); 75cdf0e10cSrcweir virtual void FillInfo( SfxChildWinInfo& rInfo ) const; 76cdf0e10cSrcweir virtual sal_Bool Close(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir DECL_LINK( OnAsyncGetFocus, void* ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir void implSetNewSelection( const InterfaceBag& _rSelection ); 81cdf0e10cSrcweir void implDetachController(); 82cdf0e10cSrcweir bool implIsReadOnlyModel() const; 83cdf0e10cSrcweir ::rtl::OUString getCurrentPage() const; 84cdf0e10cSrcweir 85cdf0e10cSrcweir public: 86cdf0e10cSrcweir FmPropBrw( 87cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB, 88cdf0e10cSrcweir SfxBindings* pBindings, 89cdf0e10cSrcweir SfxChildWindow* pMgr, 90cdf0e10cSrcweir Window* pParent, 91cdf0e10cSrcweir const SfxChildWinInfo* _pInfo 92cdf0e10cSrcweir ); 93cdf0e10cSrcweir virtual ~FmPropBrw(); 94cdf0e10cSrcweir 95cdf0e10cSrcweir using SfxFloatingWindow::StateChanged; 96cdf0e10cSrcweir 97cdf0e10cSrcweir protected: 98cdf0e10cSrcweir virtual void Resize(); 99cdf0e10cSrcweir 100cdf0e10cSrcweir private: 101cdf0e10cSrcweir /** creates the PropertyBrowser (aka ObjectInspector) and plugs it into our frame 102cdf0e10cSrcweir 103cdf0e10cSrcweir This method ensures that a new component is created every time the XModel which 104cdf0e10cSrcweir we're working for changed. This is necessary since this model is part of the 105cdf0e10cSrcweir ComponentContext we use to create the ObjectInspector. 106cdf0e10cSrcweir */ 107cdf0e10cSrcweir void impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir /** creates a property browser 110cdf0e10cSrcweir 111cdf0e10cSrcweir After this method returns, m_xBrowserController and m_xBrowserComponentWindow are 112cdf0e10cSrcweir not <NULL/>. 113cdf0e10cSrcweir 114cdf0e10cSrcweir @precond 115cdf0e10cSrcweir we don't have an ObjectInspector, yet, i.e. m_xBrowserController and m_xBrowserComponentWindow 116cdf0e10cSrcweir are <NULL/>. 117cdf0e10cSrcweir */ 118cdf0e10cSrcweir void impl_createPropertyBrowser_throw( FmFormShell* _pFormShell ); 119cdf0e10cSrcweir }; 120cdf0e10cSrcweir #endif //SVX_FMPROPBRW_HXX 121