Update ooo320-m1
[ooovba.git] / writerfilter / source / doctok / WW8Sttbf.hxx
blobefb9ae7842b828c12922bdfa79232189973f6665
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: WW8Sttbf.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_WW8_STTBF_HXX
32 #define INCLUDED_WW8_STTBF_HXX
34 #include <WW8StructBase.hxx>
36 #include <boost/shared_ptr.hpp>
37 #include <vector>
39 namespace writerfilter {
40 namespace doctok
43 using namespace ::std;
45 /**
46 A string table in file.
48 The string table contains strings that each can have extra data.
50 class WW8Sttbf : public WW8StructBase
52 /// true if strings contain two-byte characters
53 bool mbComplex;
55 /// the number of entries
56 sal_uInt32 mnCount;
58 /// the size of the extra data (per string)
59 sal_uInt32 mnExtraDataCount;
61 /// offsets for the strings
62 vector<sal_uInt32> mEntryOffsets;
64 /// offsets for the extra data
65 vector<sal_uInt32> mExtraOffsets;
67 /**
68 Return offset of an entry.
70 @param nPos the index of the entry
72 sal_uInt32 getEntryOffset(sal_uInt32 nPos) const;
74 /**
75 Return offset of extra data of an entry.
77 @param nPos the index of the entry
79 sal_uInt32 getExtraOffset(sal_uInt32 nPos) const;
81 public:
82 typedef boost::shared_ptr<WW8Sttbf> Pointer_t;
84 WW8Sttbf(WW8Stream & rStream, sal_uInt32 nOffset, sal_uInt32 nCount);
86 /**
87 Return the number of entries.
89 sal_uInt32 getEntryCount() const;
91 /**
92 Return the string of an entry.
94 @param nPos the index of the entry
96 rtl::OUString getEntry(sal_uInt32 nPos) const;
98 /**
99 Return the extra data of an entry.
101 @param nPos the index of the entry
103 WW8StructBase::Pointer_t getExtraData(sal_uInt32 nPos);
106 #endif // INCLUDED_WW8_STTBF