update dev300-m58
[ooovba.git] / sw / source / filter / ww8 / ww8glsy.hxx
blobbc6addfe53400c04984719751fa59799f0c1e8eb
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: ww8glsy.hxx,v $
10 * $Revision: 1.15 $
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 ************************************************************************/
30 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
32 #ifndef _WW8GLSY_HXX
33 #define _WW8GLSY_HXX
35 #include <sot/storage.hxx>
36 #include "ww8scan.hxx"
38 class SwTextBlocks;
39 class SwNodeIndex;
42 * GlossaryFib takes the document fib and finds the glossary fib which may
43 * not exist. The glossary fib has the offsets into the autotext subdocument
44 * which is at the end of template .dot's
46 class WW8GlossaryFib : public WW8Fib
48 public:
49 WW8GlossaryFib( SvStream& rStrm, BYTE nWantedVersion ,
50 SvStream& rTableStrm, const WW8Fib &rFib) : WW8Fib(rStrm,
51 nWantedVersion,FindGlossaryFibOffset(rTableStrm,rStrm,rFib)) {}
52 bool IsGlossaryFib();
53 private:
54 UINT32 FindGlossaryFibOffset(SvStream &rTableStrm,SvStream &rStrm,
55 const WW8Fib &rFib);
59 * Imports glossaries from word, given the document it gets the usual word
60 * doc information, then the glossary fib and uses the usual reader class to
61 * wrap the autotext into a star doc. Afterwards taking each section entry and
62 * making it a single star autotext entry.
64 * ToDo currently all autotext entries become resource hungry star autotext
65 * formatted text, need to use a flag in the ww8reader class to determine if
66 * an entry is formatted or not.
68 class WW8Glossary
70 public:
71 WW8Glossary( SvStorageStreamRef &refStrm, BYTE nVersion, SvStorage *pStg=0);
72 bool Load( SwTextBlocks &rBlocks, bool bSaveRelFile );
73 ~WW8Glossary() { delete pGlossary; }
74 WW8GlossaryFib *GetFib() { return pGlossary; }
75 USHORT GetNoStrings() const { return nStrings; }
77 private:
78 WW8GlossaryFib *pGlossary;
79 SvStorageStreamRef xTableStream;
80 SvStorageStreamRef &rStrm;
81 SvStorageRef xStg;
82 USHORT nStrings;
84 bool MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool bSaveRelFile,
85 const ::std::vector<String>& rStrings,
86 const ::std::vector<ww::bytes>& rExtra);
87 bool HasBareGraphicEnd(SwDoc *pD,SwNodeIndex &rIdx);
89 //No copying
90 WW8Glossary(const WW8Glossary&);
91 WW8Glossary& operator=(const WW8Glossary&);
93 #endif
95 /* vi:set tabstop=4 shiftwidth=4 expandtab: */