1*b8a377c6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b8a377c6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b8a377c6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b8a377c6SAndrew Rist  * distributed with this work for additional information
6*b8a377c6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b8a377c6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b8a377c6SAndrew Rist  * "License"); you may not use this file except in compliance
9*b8a377c6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*b8a377c6SAndrew Rist  *
11*b8a377c6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*b8a377c6SAndrew Rist  *
13*b8a377c6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b8a377c6SAndrew Rist  * software distributed under the License is distributed on an
15*b8a377c6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b8a377c6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b8a377c6SAndrew Rist  * specific language governing permissions and limitations
18*b8a377c6SAndrew Rist  * under the License.
19*b8a377c6SAndrew Rist  *
20*b8a377c6SAndrew Rist  *************************************************************/
21*b8a377c6SAndrew Rist 
22*b8a377c6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_WW8_CLX_HXX
25cdf0e10cSrcweir #define INCLUDED_WW8_CLX_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <resources.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef INCLUDED_WW8_OUTPUT_WITH_DEPTH_HXX
30cdf0e10cSrcweir #include <WW8OutputWithDepth.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace writerfilter {
34cdf0e10cSrcweir namespace doctok
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir /**
38cdf0e10cSrcweir    Piece table as stored in a Word file.
39cdf0e10cSrcweir 
40cdf0e10cSrcweir    It contains character positions (CPs) and file character positions
41cdf0e10cSrcweir    (FCs). Each CP is correlated to one FC.
42cdf0e10cSrcweir  */
43cdf0e10cSrcweir class WW8Clx : public WW8StructBase
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     /// Pointer to the file information block.
46cdf0e10cSrcweir     WW8Fib::Pointer_t pFib;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     /// Offset where FCs begin
49cdf0e10cSrcweir     sal_uInt32 nOffsetPieceTable;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir public:
52cdf0e10cSrcweir     /// Pointer to Clx.
53cdf0e10cSrcweir     typedef boost::shared_ptr<WW8Clx> Pointer_t;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     WW8Clx(WW8Stream & rStream,
56cdf0e10cSrcweir            sal_uInt32 nOffset, sal_uInt32 nCount);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     virtual void dump(OutputWithDepth<string> & o) const;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     /**
61cdf0e10cSrcweir        Return the number of pieces.
62cdf0e10cSrcweir     */
63cdf0e10cSrcweir     sal_uInt32 getPieceCount() const;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     /**
66cdf0e10cSrcweir        Return a certain character position.
67cdf0e10cSrcweir 
68cdf0e10cSrcweir        @param nIndex     index of the character position
69cdf0e10cSrcweir      */
70cdf0e10cSrcweir     sal_uInt32 getCp(sal_uInt32 nIndex) const;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     /**
73cdf0e10cSrcweir        Return a certain file character position.
74cdf0e10cSrcweir 
75cdf0e10cSrcweir        @param nIndex     index of the file character position
76cdf0e10cSrcweir      */
77cdf0e10cSrcweir     sal_uInt32 getFc(sal_uInt32 nIndex) const;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     /**
80cdf0e10cSrcweir        Return if a certain FC is complex.
81cdf0e10cSrcweir 
82cdf0e10cSrcweir        @nIndex           index of the FC
83cdf0e10cSrcweir      */
84cdf0e10cSrcweir     sal_Bool isComplexFc(sal_uInt32 nIndex) const;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir };
87cdf0e10cSrcweir }}
88cdf0e10cSrcweir 
89cdf0e10cSrcweir #endif
90