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 #ifndef _TEXTMARKUPHELPER_HXX_
24 #define _TEXTMARKUPHELPER_HXX_
25 
26 #include <sal/types.h>
27 #include "com/sun/star/lang/IndexOutOfBoundsException.hdl"
28 #include "com/sun/star/lang/IllegalArgumentException.hdl"
29 #include "com/sun/star/uno/RuntimeException.hdl"
30 #include "com/sun/star/uno/Sequence.h"
31 
32 namespace com { namespace sun { namespace star { namespace accessibility {
33 struct TextSegment;
34 } } } }
35 
36 class SwAccessiblePortionData;
37 class SwTxtNode;
38 // --> OD 2010-02-19 #i108125#
39 class SwWrongList;
40 // <--
41 
42 class SwTextMarkupHelper
43 {
44     public:
45         SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
46                             const SwTxtNode& rTxtNode );
47         // --> OD 2010-02-19 #i108125#
48         SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
49                             const SwWrongList& rTextMarkupList );
50         // <--
~SwTextMarkupHelper()51         ~SwTextMarkupHelper() {}
52 
53         sal_Int32 getTextMarkupCount( const sal_Int32 nTextMarkupType )
54                 throw (::com::sun::star::lang::IllegalArgumentException,
55                        ::com::sun::star::uno::RuntimeException);
56 
57         ::com::sun::star::accessibility::TextSegment getTextMarkup(
58                                             const sal_Int32 nTextMarkupIndex,
59                                             const sal_Int32 nTextMarkupType )
60                 throw (::com::sun::star::lang::IndexOutOfBoundsException,
61                        ::com::sun::star::lang::IllegalArgumentException,
62                        ::com::sun::star::uno::RuntimeException);
63 
64         ::com::sun::star::uno::Sequence< ::com::sun::star::accessibility::TextSegment >
65                 getTextMarkupAtIndex( const sal_Int32 nCharIndex,
66                                       const sal_Int32 nTextMarkupType )
67                 throw (::com::sun::star::lang::IndexOutOfBoundsException,
68                        ::com::sun::star::lang::IllegalArgumentException,
69                        ::com::sun::star::uno::RuntimeException);
70 
71     private:
72         SwTextMarkupHelper( const SwTextMarkupHelper& );
73         SwTextMarkupHelper& operator=( const SwTextMarkupHelper& );
74 
75         const SwAccessiblePortionData& mrPortionData;
76 
77         // --> OD 2010-02-19 #i108125#
78         const SwTxtNode* mpTxtNode;
79         const SwWrongList* mpTextMarkupList;
80         // <--
81 };
82 #endif
83 
84