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