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