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