xref: /trunk/main/editeng/inc/editeng/unonrule.hxx (revision 9d37da743abb7db0a497688391f6e55a19f27c44)
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 );
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 );
57 
58     //XIndexAccess
59     virtual sal_Int32 SAL_CALL getCount() ;
60     virtual com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index );
61 
62     //XElementAccess
63     virtual com::sun::star::uno::Type SAL_CALL getElementType();
64     virtual sal_Bool SAL_CALL hasElements();
65 
66     // XAnyCompare
67     virtual sal_Int16 SAL_CALL compare( const com::sun::star::uno::Any& Any1, const com::sun::star::uno::Any& Any2 );
68 
69     // XCloneable
70     virtual com::sun::star::uno::Reference< com::sun::star::util::XCloneable > SAL_CALL createClone(  );
71 
72     // XServiceInfo
73     virtual rtl::OUString SAL_CALL getImplementationName(  );
74     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
75     virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(  );
76 
77     // intern
78     com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getNumberingRuleByIndex( sal_Int32 nIndex) const throw();
79     void setNumberingRuleByIndex( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rProperties, sal_Int32 nIndex);
80 
81     static sal_Int16 Compare( const com::sun::star::uno::Any& rAny1, const com::sun::star::uno::Any& rAny2 );
82 
83     const SvxNumRule& getNumRule() const { return maRule; }
84 };
85 
86 
87 #endif
88