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 #ifndef CHART_TITLEWRAPPER_HXX 24*b1cdbd2cSJim Jagielski #define CHART_TITLEWRAPPER_HXX 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski #include "WrappedPropertySet.hxx" 27*b1cdbd2cSJim Jagielski #include "ReferenceSizePropertyProvider.hxx" 28*b1cdbd2cSJim Jagielski #include "Chart2ModelContact.hxx" 29*b1cdbd2cSJim Jagielski #include "ServiceMacros.hxx" 30*b1cdbd2cSJim Jagielski #include "TitleHelper.hxx" 31*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase3.hxx> 32*b1cdbd2cSJim Jagielski #include <comphelper/uno3.hxx> 33*b1cdbd2cSJim Jagielski #include <cppuhelper/interfacecontainer.hxx> 34*b1cdbd2cSJim Jagielski #include <com/sun/star/drawing/XShape.hpp> 35*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XComponent.hpp> 36*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XServiceInfo.hpp> 37*b1cdbd2cSJim Jagielski #include <com/sun/star/chart2/XTitle.hpp> 38*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/XComponentContext.hpp> 39*b1cdbd2cSJim Jagielski 40*b1cdbd2cSJim Jagielski #include <boost/shared_ptr.hpp> 41*b1cdbd2cSJim Jagielski 42*b1cdbd2cSJim Jagielski namespace chart 43*b1cdbd2cSJim Jagielski { 44*b1cdbd2cSJim Jagielski namespace wrapper 45*b1cdbd2cSJim Jagielski { 46*b1cdbd2cSJim Jagielski 47*b1cdbd2cSJim Jagielski class TitleWrapper : public ::cppu::ImplInheritanceHelper3< 48*b1cdbd2cSJim Jagielski WrappedPropertySet 49*b1cdbd2cSJim Jagielski , com::sun::star::drawing::XShape 50*b1cdbd2cSJim Jagielski , com::sun::star::lang::XComponent 51*b1cdbd2cSJim Jagielski , com::sun::star::lang::XServiceInfo 52*b1cdbd2cSJim Jagielski > 53*b1cdbd2cSJim Jagielski , public ReferenceSizePropertyProvider 54*b1cdbd2cSJim Jagielski { 55*b1cdbd2cSJim Jagielski public: 56*b1cdbd2cSJim Jagielski TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType, 57*b1cdbd2cSJim Jagielski ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ); 58*b1cdbd2cSJim Jagielski virtual ~TitleWrapper(); 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski /// XServiceInfo declarations 61*b1cdbd2cSJim Jagielski APPHELPER_XSERVICEINFO_DECL() 62*b1cdbd2cSJim Jagielski 63*b1cdbd2cSJim Jagielski //ReferenceSizePropertyProvider 64*b1cdbd2cSJim Jagielski virtual void updateReferenceSize(); 65*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Any getReferenceSize(); 66*b1cdbd2cSJim Jagielski virtual ::com::sun::star::awt::Size getCurrentSizeForReference(); 67*b1cdbd2cSJim Jagielski 68*b1cdbd2cSJim Jagielski protected: 69*b1cdbd2cSJim Jagielski // ____ XShape ____ 70*b1cdbd2cSJim Jagielski virtual ::com::sun::star::awt::Point SAL_CALL getPosition() 71*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 72*b1cdbd2cSJim Jagielski virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) 73*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 74*b1cdbd2cSJim Jagielski virtual ::com::sun::star::awt::Size SAL_CALL getSize() 75*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 76*b1cdbd2cSJim Jagielski virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) 77*b1cdbd2cSJim Jagielski throw (::com::sun::star::beans::PropertyVetoException, 78*b1cdbd2cSJim Jagielski ::com::sun::star::uno::RuntimeException); 79*b1cdbd2cSJim Jagielski 80*b1cdbd2cSJim Jagielski // ____ XShapeDescriptor (base of XShape) ____ 81*b1cdbd2cSJim Jagielski virtual ::rtl::OUString SAL_CALL getShapeType() 82*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski // ____ XComponent ____ 85*b1cdbd2cSJim Jagielski virtual void SAL_CALL dispose() 86*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 87*b1cdbd2cSJim Jagielski virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 88*b1cdbd2cSJim Jagielski ::com::sun::star::lang::XEventListener >& xListener ) 89*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 90*b1cdbd2cSJim Jagielski virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 91*b1cdbd2cSJim Jagielski ::com::sun::star::lang::XEventListener >& aListener ) 92*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::RuntimeException); 93*b1cdbd2cSJim Jagielski 94*b1cdbd2cSJim Jagielski // character properties have to be handled differently (via the XFormattedString elements) 95*b1cdbd2cSJim Jagielski void getFastCharacterPropertyValue( sal_Int32 nHandle, ::com::sun::star::uno::Any& rValue ); 96*b1cdbd2cSJim Jagielski void setFastCharacterPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) 97*b1cdbd2cSJim Jagielski throw (::com::sun::star::uno::Exception); 98*b1cdbd2cSJim Jagielski 99*b1cdbd2cSJim Jagielski // ____ WrappedPropertySet ____ 100*b1cdbd2cSJim Jagielski virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 101*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 102*b1cdbd2cSJim Jagielski 103*b1cdbd2cSJim Jagielski virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 104*b1cdbd2cSJim Jagielski virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 107*b1cdbd2cSJim Jagielski 108*b1cdbd2cSJim Jagielski virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 109*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 110*b1cdbd2cSJim Jagielski 111*b1cdbd2cSJim Jagielski virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet(); 112*b1cdbd2cSJim Jagielski 113*b1cdbd2cSJim Jagielski virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence(); 114*b1cdbd2cSJim Jagielski virtual const std::vector< WrappedProperty* > createWrappedProperties(); 115*b1cdbd2cSJim Jagielski 116*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getFirstCharacterPropertySet(); 117*b1cdbd2cSJim Jagielski 118*b1cdbd2cSJim Jagielski private: 119*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle > getTitleObject(); 120*b1cdbd2cSJim Jagielski 121*b1cdbd2cSJim Jagielski private: 122*b1cdbd2cSJim Jagielski ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 123*b1cdbd2cSJim Jagielski ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; 124*b1cdbd2cSJim Jagielski 125*b1cdbd2cSJim Jagielski ::chart::TitleHelper::eTitleType m_eTitleType; 126*b1cdbd2cSJim Jagielski }; 127*b1cdbd2cSJim Jagielski 128*b1cdbd2cSJim Jagielski } // namespace wrapper 129*b1cdbd2cSJim Jagielski } // namespace chart 130*b1cdbd2cSJim Jagielski 131*b1cdbd2cSJim Jagielski // CHART_TITLEWRAPPER_HXX 132*b1cdbd2cSJim Jagielski #endif 133