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 INCLUDED_WW8_BIN_TABLE_HXX
25 #define INCLUDED_WW8_BIN_TABLE_HXX
26 
27 #include <boost/shared_ptr.hpp>
28 #include <string>
29 #include <WW8FKP.hxx>
30 
31 namespace writerfilter {
32 namespace doctok
33 {
34 
35 /**
36    A bintable.
37 
38    Word uses bintables to associate FC ranges with FKPs. A bintable
39    has a list of FCs. At each FC a range begins. The length of the
40    range is given by the distance of the according CPs.
41  */
42 class WW8BinTable
43 {
44 public:
~WW8BinTable()45     virtual ~WW8BinTable() {};
46     /**
47        Shared pointer to a bintable.
48      */
49     typedef boost::shared_ptr<WW8BinTable> Pointer_t;
50 
51     /**
52        Return count of entries.
53      */
54     virtual sal_uInt32 getEntryCount() const = 0;
55 
56     /**
57        Return FC from bintable.
58 
59        @param nIndex    index in bintable to return FC from
60      */
61     virtual Fc getFc(sal_uInt32 nIndex) const = 0;
62 
63     /**
64        Return page number.
65 
66        @param nIndex    index in bintable to return page number from
67      */
68     virtual sal_uInt32 getPageNumber(sal_uInt32 nIndex) const = 0;
69 
70     /**
71        Return page number associated with FC.
72 
73        @param rFc      FC to return page number for
74      */
75     virtual sal_uInt32 getPageNumber(const Fc & rFc) const = 0;
76 
77     /**
78        Return string representation of bintable.
79      */
80     virtual string toString() const = 0;
81 };
82 }}
83 
84 #endif // INCLUDED_WW8_BIN_TABLE_HXX
85