1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _EXTENSIONS_PROPCTRLR_PROPCONTROLLER_HXX_ 29*cdf0e10cSrcweir #define _EXTENSIONS_PROPCTRLR_PROPCONTROLLER_HXX_ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "composeduiupdate.hxx" 32*cdf0e10cSrcweir #include "formbrowsertools.hxx" 33*cdf0e10cSrcweir #include "formmetadata.hxx" 34*cdf0e10cSrcweir #include "proplinelistener.hxx" 35*cdf0e10cSrcweir #include "propcontrolobserver.hxx" 36*cdf0e10cSrcweir #include "browserview.hxx" 37*cdf0e10cSrcweir #ifndef _EXTENSIONS_PROPCTRLR_MODULEPCR_HXX_ 38*cdf0e10cSrcweir #include "modulepcr.hxx" 39*cdf0e10cSrcweir #endif 40*cdf0e10cSrcweir #include "propertyinfo.hxx" 41*cdf0e10cSrcweir #include "pcrcomponentcontext.hxx" 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir /** === begin UNO includes === **/ 44*cdf0e10cSrcweir #include <com/sun/star/awt/XFocusListener.hpp> 45*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp> 46*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 47*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyChangeListener.hpp> 48*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 49*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 50*cdf0e10cSrcweir #include <com/sun/star/form/XForm.hpp> 51*cdf0e10cSrcweir #include <com/sun/star/script/XEventAttacherManager.hpp> 52*cdf0e10cSrcweir #include <com/sun/star/sdbc/XRowSet.hpp> 53*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 54*cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp> 55*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 56*cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp> 57*cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp> 58*cdf0e10cSrcweir #include <com/sun/star/awt/XLayoutConstrains.hpp> 59*cdf0e10cSrcweir #include <com/sun/star/awt/XLayoutConstrains.hpp> 60*cdf0e10cSrcweir #include <com/sun/star/awt/XControlContainer.hpp> 61*cdf0e10cSrcweir #include <com/sun/star/inspection/XPropertyControlFactory.hpp> 62*cdf0e10cSrcweir #include <com/sun/star/inspection/XObjectInspector.hpp> 63*cdf0e10cSrcweir #include <com/sun/star/inspection/XObjectInspectorUI.hpp> 64*cdf0e10cSrcweir #include <com/sun/star/inspection/XPropertyHandler.hpp> 65*cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 66*cdf0e10cSrcweir /** === end UNO includes === **/ 67*cdf0e10cSrcweir #include <connectivity/dbtools.hxx> 68*cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx> 69*cdf0e10cSrcweir #include <cppuhelper/implbase7.hxx> 70*cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx> 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir #include <map> 73*cdf0e10cSrcweir #include <hash_map> 74*cdf0e10cSrcweir #include <vector> 75*cdf0e10cSrcweir #include <memory> 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir class SvNumberFormatsSupplierObj; 78*cdf0e10cSrcweir class Font; 79*cdf0e10cSrcweir class Window; 80*cdf0e10cSrcweir class SfxItemSet; 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir //............................................................................ 83*cdf0e10cSrcweir namespace pcr 84*cdf0e10cSrcweir { 85*cdf0e10cSrcweir //............................................................................ 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir class OPropertyEditor; 88*cdf0e10cSrcweir struct OLineDescriptor; 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 0 91*cdf0e10cSrcweir const char* CheckPropertyBrowserInvariants( const void* pVoid ); 92*cdf0e10cSrcweir // for dignostics with DBG_CHKTHIS 93*cdf0e10cSrcweir #endif 94*cdf0e10cSrcweir DBG_NAMEEX( OPropertyBrowserController ) 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir //======================================================================== 97*cdf0e10cSrcweir //= OPropertyBrowserController 98*cdf0e10cSrcweir //======================================================================== 99*cdf0e10cSrcweir // #95343#------------------------------------------------------------------------------------ 100*cdf0e10cSrcweir typedef ::cppu::WeakImplHelper7 < ::com::sun::star::lang::XServiceInfo 101*cdf0e10cSrcweir , ::com::sun::star::awt::XFocusListener 102*cdf0e10cSrcweir , ::com::sun::star::awt::XLayoutConstrains 103*cdf0e10cSrcweir , ::com::sun::star::beans::XPropertyChangeListener 104*cdf0e10cSrcweir , ::com::sun::star::inspection::XPropertyControlFactory 105*cdf0e10cSrcweir , ::com::sun::star::inspection::XObjectInspector 106*cdf0e10cSrcweir , ::com::sun::star::lang::XInitialization 107*cdf0e10cSrcweir > OPropertyBrowserController_Base; 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir class OPropertyBrowserController 110*cdf0e10cSrcweir :public ::comphelper::OMutexAndBroadcastHelper 111*cdf0e10cSrcweir ,public OPropertyBrowserController_Base 112*cdf0e10cSrcweir ,public ::com::sun::star::inspection::XObjectInspectorUI 113*cdf0e10cSrcweir // that's intentionally *not* part of the OPropertyBrowserController_Base 114*cdf0e10cSrcweir // We do not want this to be available in queryInterface, getTypes, and the like. 115*cdf0e10cSrcweir ,public IPropertyLineListener 116*cdf0e10cSrcweir ,public IPropertyControlObserver 117*cdf0e10cSrcweir ,public IPropertyExistenceCheck 118*cdf0e10cSrcweir { 119*cdf0e10cSrcweir private: 120*cdf0e10cSrcweir typedef ::std::map< sal_Int32, ::com::sun::star::beans::Property > OrderedPropertyMap; 121*cdf0e10cSrcweir typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > 122*cdf0e10cSrcweir InterfaceArray; 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir protected: 125*cdf0e10cSrcweir ComponentContext m_aContext; 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir private: 128*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; 129*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xView; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper m_aDisposeListeners; 132*cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper m_aControlObservers; 133*cdf0e10cSrcweir // meta data about the properties 134*cdf0e10cSrcweir OPropertyBrowserView* m_pView; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir ::rtl::OUString m_sPageSelection; 137*cdf0e10cSrcweir ::rtl::OUString m_sLastValidPageSelection; 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler > 140*cdf0e10cSrcweir PropertyHandlerRef; 141*cdf0e10cSrcweir typedef ::std::vector< PropertyHandlerRef > PropertyHandlerArray; 142*cdf0e10cSrcweir typedef ::std::hash_map< ::rtl::OUString, PropertyHandlerRef, ::rtl::OUStringHash > 143*cdf0e10cSrcweir PropertyHandlerRepository; 144*cdf0e10cSrcweir typedef ::std::hash_multimap< ::rtl::OUString, PropertyHandlerRef, ::rtl::OUStringHash > 145*cdf0e10cSrcweir PropertyHandlerMultiRepository; 146*cdf0e10cSrcweir PropertyHandlerRepository m_aPropertyHandlers; 147*cdf0e10cSrcweir PropertyHandlerMultiRepository m_aDependencyHandlers; 148*cdf0e10cSrcweir PropertyHandlerRef m_xInteractiveHandler; 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir ::std::auto_ptr< ComposedPropertyUIUpdate > m_pUIRequestComposer; 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir /// our InspectorModel 153*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > 154*cdf0e10cSrcweir m_xModel; 155*cdf0e10cSrcweir /// the object(s) we're currently inspecting 156*cdf0e10cSrcweir InterfaceArray m_aInspectedObjects; 157*cdf0e10cSrcweir /// the properties of the currently inspected object(s) 158*cdf0e10cSrcweir OrderedPropertyMap m_aProperties; 159*cdf0e10cSrcweir /// the property we're just committing 160*cdf0e10cSrcweir ::rtl::OUString m_sCommittingProperty; 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir typedef ::std::hash_map< ::rtl::OUString, sal_uInt16, ::rtl::OUStringHash > HashString2Int16; 163*cdf0e10cSrcweir HashString2Int16 m_aPageIds; 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir bool m_bContainerFocusListening; 166*cdf0e10cSrcweir bool m_bSuspendingPropertyHandlers; 167*cdf0e10cSrcweir bool m_bConstructed; 168*cdf0e10cSrcweir bool m_bBindingIntrospectee; 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir protected: 171*cdf0e10cSrcweir DECLARE_XINTERFACE() 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir // XServiceInfo 174*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 175*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); 176*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir // XController 179*cdf0e10cSrcweir virtual void SAL_CALL attachFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ) throw(::com::sun::star::uno::RuntimeException); 180*cdf0e10cSrcweir virtual sal_Bool SAL_CALL attachModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ) throw(::com::sun::star::uno::RuntimeException); 181*cdf0e10cSrcweir virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) throw(::com::sun::star::uno::RuntimeException); 182*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getViewData( ) throw(::com::sun::star::uno::RuntimeException); 183*cdf0e10cSrcweir virtual void SAL_CALL restoreViewData( const ::com::sun::star::uno::Any& Data ) throw(::com::sun::star::uno::RuntimeException); 184*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException); 185*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame( ) throw(::com::sun::star::uno::RuntimeException); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir // XComponent 188*cdf0e10cSrcweir virtual void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); 189*cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); 190*cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir // XFocusListener 193*cdf0e10cSrcweir virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& _rSource ) throw (::com::sun::star::uno::RuntimeException); 194*cdf0e10cSrcweir virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& _rSource ) throw (::com::sun::star::uno::RuntimeException); 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir // XEventListener 197*cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir // XLayoutConstrains #95343# ---------------- 200*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw (::com::sun::star::uno::RuntimeException); 201*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw (::com::sun::star::uno::RuntimeException); 202*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw (::com::sun::star::uno::RuntimeException); 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir // XPropertyChangeListener 205*cdf0e10cSrcweir virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) throw (::com::sun::star::uno::RuntimeException); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir /** XPropertyControlFactory 208*cdf0e10cSrcweir */ 209*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > SAL_CALL createPropertyControl( ::sal_Int16 ControlType, ::sal_Bool CreateReadOnly ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir public: 212*cdf0e10cSrcweir OPropertyBrowserController( 213*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir protected: 216*cdf0e10cSrcweir virtual ~OPropertyBrowserController(); 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir public: 219*cdf0e10cSrcweir // XServiceInfo - static versions 220*cdf0e10cSrcweir static ::rtl::OUString getImplementationName_static( ) throw(::com::sun::star::uno::RuntimeException); 221*cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException); 222*cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 223*cdf0e10cSrcweir Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir protected: 226*cdf0e10cSrcweir // IPropertyLineListener 227*cdf0e10cSrcweir virtual void Clicked( const ::rtl::OUString& _rName, sal_Bool _bPrimary ); 228*cdf0e10cSrcweir virtual void Commit( const ::rtl::OUString& _rName, const ::com::sun::star::uno::Any& _rVal ); 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir // IPropertyControlObserver 231*cdf0e10cSrcweir virtual void focusGained( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _Control ); 232*cdf0e10cSrcweir virtual void valueChanged( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _Control ); 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir // IPropertyExistenceCheck 235*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& _rName ) throw (::com::sun::star::uno::RuntimeException); 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir // XObjectInspectorUI 238*cdf0e10cSrcweir virtual void SAL_CALL enablePropertyUI( const ::rtl::OUString& _rPropertyName, ::sal_Bool _bEnable ) throw (::com::sun::star::uno::RuntimeException); 239*cdf0e10cSrcweir virtual void SAL_CALL enablePropertyUIElements( const ::rtl::OUString& _rPropertyName, ::sal_Int16 _nElements, ::sal_Bool _bEnable ) throw (::com::sun::star::uno::RuntimeException); 240*cdf0e10cSrcweir virtual void SAL_CALL rebuildPropertyUI( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::uno::RuntimeException); 241*cdf0e10cSrcweir virtual void SAL_CALL showPropertyUI( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::uno::RuntimeException); 242*cdf0e10cSrcweir virtual void SAL_CALL hidePropertyUI( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::uno::RuntimeException); 243*cdf0e10cSrcweir virtual void SAL_CALL showCategory( const ::rtl::OUString& _rCategory, ::sal_Bool _bShow ) throw (::com::sun::star::uno::RuntimeException); 244*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > SAL_CALL getPropertyControl( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::uno::RuntimeException); 245*cdf0e10cSrcweir virtual void SAL_CALL registerControlObserver( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlObserver >& _Observer ) throw (::com::sun::star::uno::RuntimeException); 246*cdf0e10cSrcweir virtual void SAL_CALL revokeControlObserver( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlObserver >& _Observer ) throw (::com::sun::star::uno::RuntimeException); 247*cdf0e10cSrcweir virtual void SAL_CALL setHelpSectionText( const ::rtl::OUString& HelpText ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); 248*cdf0e10cSrcweir 249*cdf0e10cSrcweir // XObjectInspector 250*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > SAL_CALL getInspectorModel() throw (::com::sun::star::uno::RuntimeException); 251*cdf0e10cSrcweir virtual void SAL_CALL setInspectorModel( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >& _inspectormodel ) throw (::com::sun::star::uno::RuntimeException); 252*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > SAL_CALL getInspectorUI() throw (::com::sun::star::uno::RuntimeException); 253*cdf0e10cSrcweir virtual void SAL_CALL inspect( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& Objects ) throw (::com::sun::star::util::VetoException, ::com::sun::star::uno::RuntimeException); 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir // XDispatchProvider 256*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& URL, const ::rtl::OUString& TargetFrameName, ::sal_Int32 SearchFlags ) throw (::com::sun::star::uno::RuntimeException); 257*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& Requests ) throw (::com::sun::star::uno::RuntimeException); 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir // XInitialization 260*cdf0e10cSrcweir virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir private: 263*cdf0e10cSrcweir void UpdateUI(); 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir void startContainerWindowListening(); 266*cdf0e10cSrcweir void stopContainerWindowListening(); 267*cdf0e10cSrcweir 268*cdf0e10cSrcweir // stop the inspection 269*cdf0e10cSrcweir void stopInspection( bool _bCommitModified ); 270*cdf0e10cSrcweir 271*cdf0e10cSrcweir sal_Bool haveView() const { return NULL != m_pView; } 272*cdf0e10cSrcweir OPropertyEditor& getPropertyBox() { return m_pView->getPropertyBox(); } 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir // does the inspection of the objects as indicated by our model 275*cdf0e10cSrcweir void doInspection(); 276*cdf0e10cSrcweir 277*cdf0e10cSrcweir // bind the browser to m_xIntrospecteeAsProperty 278*cdf0e10cSrcweir void impl_rebindToInspectee_nothrow( const InterfaceArray& _rObjects ); 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir /** retrieves special property handlers for our introspectee 281*cdf0e10cSrcweir */ 282*cdf0e10cSrcweir void getPropertyHandlers( const InterfaceArray& _rObjects, PropertyHandlerArray& _rHandlers ); 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir /** called when a property changed, to broadcast any handlers which might have 285*cdf0e10cSrcweir registered for this property 286*cdf0e10cSrcweir 287*cdf0e10cSrcweir @param _bFirstTimeInit 288*cdf0e10cSrcweir if set to <FALSE/>, this is a real change in the property value, not just a call 289*cdf0e10cSrcweir for purposes of initialization. 290*cdf0e10cSrcweir */ 291*cdf0e10cSrcweir void impl_broadcastPropertyChange_nothrow( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rNewValue, const ::com::sun::star::uno::Any& _rOldValue, bool _bFirstTimeInit ) const; 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir /** determines whether the given property is an actuating property, that is, at least one 294*cdf0e10cSrcweir handler expressed interest in changes to this property's value. 295*cdf0e10cSrcweir */ 296*cdf0e10cSrcweir inline bool impl_isActuatingProperty_nothrow( const ::rtl::OUString& _rPropertyName ) const 297*cdf0e10cSrcweir { 298*cdf0e10cSrcweir return ( m_aDependencyHandlers.find( _rPropertyName ) != m_aDependencyHandlers.end() ); 299*cdf0e10cSrcweir } 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir sal_uInt32 GetPropertyPos(const ::rtl::OUString& _rPropName); 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir /** retrieves the value of the given property, by asking the appropriate XPropertyHandler 304*cdf0e10cSrcweir @param _rPropertyName 305*cdf0e10cSrcweir the name whose handler is to be obtained. Must be the name of a property 306*cdf0e10cSrcweir for which a handler is registered. 307*cdf0e10cSrcweir @throws 308*cdf0e10cSrcweir RuntimeException if there is no handler for the given property 309*cdf0e10cSrcweir @return 310*cdf0e10cSrcweir the value of this property 311*cdf0e10cSrcweir */ 312*cdf0e10cSrcweir ::com::sun::star::uno::Any 313*cdf0e10cSrcweir impl_getPropertyValue_throw( const ::rtl::OUString& _rPropertyName ); 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir /// calls XPropertyHandler::suspend for all our property handlers 316*cdf0e10cSrcweir sal_Bool suspendPropertyHandlers_nothrow( sal_Bool _bSuspend ); 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir /// suspends the complete inspector 319*cdf0e10cSrcweir sal_Bool suspendAll_nothrow(); 320*cdf0e10cSrcweir 321*cdf0e10cSrcweir /** selects a page according to our current view data 322*cdf0e10cSrcweir */ 323*cdf0e10cSrcweir void selectPageFromViewData(); 324*cdf0e10cSrcweir 325*cdf0e10cSrcweir /** updates our view data from the currently active page 326*cdf0e10cSrcweir */ 327*cdf0e10cSrcweir void updateViewDataFromActivePage(); 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir /// describes the UI for the given property 330*cdf0e10cSrcweir void describePropertyLine( const ::com::sun::star::beans::Property& _rPropertyName, OLineDescriptor& _rDescriptor ) 331*cdf0e10cSrcweir SAL_THROW((::com::sun::star::uno::Exception)); 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir /** retrieves the position of the property given by name in m_aProperties 334*cdf0e10cSrcweir @return 335*cdf0e10cSrcweir <TRUE/> if and only if the property could be found. In this case, <arg>_pProperty</arg> (if 336*cdf0e10cSrcweir not <NULL/> contains the iterator pointing to this property. 337*cdf0e10cSrcweir */ 338*cdf0e10cSrcweir bool impl_findObjectProperty_nothrow( const ::rtl::OUString& _rName, OrderedPropertyMap::const_iterator* _pProperty = NULL ); 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir sal_Bool Construct(Window* _pParentWin); 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir /** retrieves the property handler for a given property name 343*cdf0e10cSrcweir @param _rPropertyName 344*cdf0e10cSrcweir the name whose handler is to be obtained. Must be the name of a property 345*cdf0e10cSrcweir for which a handler is registered. 346*cdf0e10cSrcweir @throws 347*cdf0e10cSrcweir RuntimeException if there is no handler for the given property 348*cdf0e10cSrcweir @return 349*cdf0e10cSrcweir the handler which is responsible for the given property 350*cdf0e10cSrcweir */ 351*cdf0e10cSrcweir PropertyHandlerRef 352*cdf0e10cSrcweir impl_getHandlerForProperty_throw( const ::rtl::OUString& _rPropertyName ) const; 353*cdf0e10cSrcweir 354*cdf0e10cSrcweir /** determines whether we have a handler for the given property 355*cdf0e10cSrcweir @param _rPropertyName 356*cdf0e10cSrcweir the name of the property for which the existence of a handler should be checked 357*cdf0e10cSrcweir */ 358*cdf0e10cSrcweir bool 359*cdf0e10cSrcweir impl_hasPropertyHandlerFor_nothrow( const ::rtl::OUString& _rPropertyName ) const; 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir /** builds up m_aPageIds from InspectorModel::describeCategories, and insert all the 362*cdf0e10cSrcweir respective tab pages into our view 363*cdf0e10cSrcweir @precond 364*cdf0e10cSrcweir m_aPageIds is empty 365*cdf0e10cSrcweir @throws ::com::sun::star::uno::RuntimeException 366*cdf0e10cSrcweir if one of the callees of this method throws this exception 367*cdf0e10cSrcweir */ 368*cdf0e10cSrcweir void 369*cdf0e10cSrcweir impl_buildCategories_throw(); 370*cdf0e10cSrcweir 371*cdf0e10cSrcweir /** retrieves the id of the tab page which represents a given category. 372*cdf0e10cSrcweir @param _rCategoryName 373*cdf0e10cSrcweir the programmatic name of a category. 374*cdf0e10cSrcweir @return 375*cdf0e10cSrcweir the id of the tab page, or <code>(sal_uInt16)-1</code> if there 376*cdf0e10cSrcweir is no tab page for the given category 377*cdf0e10cSrcweir */ 378*cdf0e10cSrcweir sal_uInt16 379*cdf0e10cSrcweir impl_getPageIdForCategory_nothrow( const ::rtl::OUString& _rCategoryName ) const; 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir /** adds or removes ourself as XEventListener to/from all our inspectees 382*cdf0e10cSrcweir */ 383*cdf0e10cSrcweir void impl_toggleInspecteeListening_nothrow( bool _bOn ); 384*cdf0e10cSrcweir 385*cdf0e10cSrcweir /** binds the instance to a new model 386*cdf0e10cSrcweir */ 387*cdf0e10cSrcweir void impl_bindToNewModel_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >& _rxInspectorModel ); 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir /** initializes our view, as indicated by the model's view-relevant properties 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir It's allowed to call this method when no model exists, yet. In this case, nothing 392*cdf0e10cSrcweir happens. 393*cdf0e10cSrcweir */ 394*cdf0e10cSrcweir void impl_initializeView_nothrow(); 395*cdf0e10cSrcweir 396*cdf0e10cSrcweir /** determines whether the view should be readonly. 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir Effectively, this means that the method simply checks the IsReadOnly attribute of the model. 399*cdf0e10cSrcweir If there is no model, <FALSE/> is returned. 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir @throws ::com::sun::star::uno::RuntimeException 402*cdf0e10cSrcweir in case asking the model for its IsReadOnly attribute throws a ::com::sun::star::uno::RuntimeException 403*cdf0e10cSrcweir itself. 404*cdf0e10cSrcweir */ 405*cdf0e10cSrcweir bool impl_isReadOnlyModel_throw() const; 406*cdf0e10cSrcweir 407*cdf0e10cSrcweir /** updates our view so that it is read-only, as indicated by the model property 408*cdf0e10cSrcweir @see impl_isReadOnlyModel_throw 409*cdf0e10cSrcweir */ 410*cdf0e10cSrcweir void impl_updateReadOnlyView_nothrow(); 411*cdf0e10cSrcweir 412*cdf0e10cSrcweir /** starts or stops listening at the model 413*cdf0e10cSrcweir */ 414*cdf0e10cSrcweir void impl_startOrStopModelListening_nothrow( bool _bDoListen ) const; 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir private: 417*cdf0e10cSrcweir DECL_LINK(OnPageActivation, void*); 418*cdf0e10cSrcweir 419*cdf0e10cSrcweir private: 420*cdf0e10cSrcweir // constructors 421*cdf0e10cSrcweir void createDefault(); 422*cdf0e10cSrcweir void createWithModel( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >& _rxModel ); 423*cdf0e10cSrcweir }; 424*cdf0e10cSrcweir 425*cdf0e10cSrcweir //............................................................................ 426*cdf0e10cSrcweir } // namespace pcr 427*cdf0e10cSrcweir //............................................................................ 428*cdf0e10cSrcweir 429*cdf0e10cSrcweir #endif // _EXTENSIONS_PROPCTRLR_PROPCONTROLLER_HXX_ 430*cdf0e10cSrcweir 431