1*4c5491eaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*4c5491eaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*4c5491eaSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*4c5491eaSAndrew Rist * distributed with this work for additional information 6*4c5491eaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*4c5491eaSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*4c5491eaSAndrew Rist * "License"); you may not use this file except in compliance 9*4c5491eaSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*4c5491eaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*4c5491eaSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*4c5491eaSAndrew Rist * software distributed under the License is distributed on an 15*4c5491eaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*4c5491eaSAndrew Rist * KIND, either express or implied. See the License for the 17*4c5491eaSAndrew Rist * specific language governing permissions and limitations 18*4c5491eaSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*4c5491eaSAndrew Rist *************************************************************/ 21*4c5491eaSAndrew Rist 22*4c5491eaSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVX_UNONRULE_HXX 25cdf0e10cSrcweir #define _SVX_UNONRULE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/container/XIndexReplace.hpp> 28cdf0e10cSrcweir #include <com/sun/star/ucb/XAnyCompare.hpp> 29cdf0e10cSrcweir #include "editeng/editengdllapi.h" 30cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 31cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 33cdf0e10cSrcweir #include <com/sun/star/util/XCloneable.hpp> 34cdf0e10cSrcweir #include <editeng/numitem.hxx> 35cdf0e10cSrcweir #include <comphelper/servicehelper.hxx> 36cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 37cdf0e10cSrcweir 38cdf0e10cSrcweir EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule( const SvxNumRule* pRule ) throw(); 39cdf0e10cSrcweir EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule() throw(); 40cdf0e10cSrcweir const SvxNumRule& SvxGetNumRule( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > xRule ) throw( ::com::sun::star::lang::IllegalArgumentException ); 41cdf0e10cSrcweir bool SvxGetNumRule( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > xRule, SvxNumRule& rNumRule ); 42cdf0e10cSrcweir EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SvxCreateNumRuleCompare() throw(); 43cdf0e10cSrcweir 44cdf0e10cSrcweir class SvxUnoNumberingRules : public ::cppu::WeakAggImplHelper5< com::sun::star::container::XIndexReplace, com::sun::star::ucb::XAnyCompare, 45cdf0e10cSrcweir com::sun::star::lang::XUnoTunnel, com::sun::star::util::XCloneable, com::sun::star::lang::XServiceInfo > 46cdf0e10cSrcweir { 47cdf0e10cSrcweir private: 48cdf0e10cSrcweir SvxNumRule maRule; 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir SvxUnoNumberingRules( const SvxNumRule& rRule ) throw(); 51cdf0e10cSrcweir virtual ~SvxUnoNumberingRules() throw(); 52cdf0e10cSrcweir 53cdf0e10cSrcweir UNO3_GETIMPLEMENTATION_DECL( SvxUnoNumberingRules ) 54cdf0e10cSrcweir 55cdf0e10cSrcweir //XIndexReplace 56cdf0e10cSrcweir virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const com::sun::star::uno::Any& Element ) throw( 57cdf0e10cSrcweir com::sun::star::lang::IllegalArgumentException, com::sun::star::lang::IndexOutOfBoundsException, com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException); 58cdf0e10cSrcweir 59cdf0e10cSrcweir //XIndexAccess 60cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getCount() throw(com::sun::star::uno::RuntimeException) ; 61cdf0e10cSrcweir virtual com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(com::sun::star::lang::IndexOutOfBoundsException, 62cdf0e10cSrcweir com::sun::star::lang::WrappedTargetException, com::sun::star::uno::RuntimeException); 63cdf0e10cSrcweir 64cdf0e10cSrcweir //XElementAccess 65cdf0e10cSrcweir virtual com::sun::star::uno::Type SAL_CALL getElementType() throw(com::sun::star::uno::RuntimeException); 66cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() throw(com::sun::star::uno::RuntimeException); 67cdf0e10cSrcweir 68cdf0e10cSrcweir // XAnyCompare 69cdf0e10cSrcweir virtual sal_Int16 SAL_CALL compare( const com::sun::star::uno::Any& Any1, const com::sun::star::uno::Any& Any2 ) throw(com::sun::star::uno::RuntimeException); 70cdf0e10cSrcweir 71cdf0e10cSrcweir // XCloneable 72cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir 74cdf0e10cSrcweir // XServiceInfo 75cdf0e10cSrcweir virtual rtl::OUString SAL_CALL getImplementationName( ) throw(com::sun::star::uno::RuntimeException); 76cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir 79cdf0e10cSrcweir // intern 80cdf0e10cSrcweir com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getNumberingRuleByIndex( sal_Int32 nIndex) const throw(); 81cdf0e10cSrcweir void setNumberingRuleByIndex( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rProperties, sal_Int32 nIndex) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir static sal_Int16 Compare( const com::sun::star::uno::Any& rAny1, const com::sun::star::uno::Any& rAny2 ); 84cdf0e10cSrcweir getNumRule() const85cdf0e10cSrcweir const SvxNumRule& getNumRule() const { return maRule; } 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir 89cdf0e10cSrcweir #endif 90