LCOV - code coverage report
Current view: top level - libreoffice/writerfilter/source/doctok - WW8DocumentImpl.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 12 0.0 %
Date: 2012-12-27 Functions: 0 9 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_WW8_DOCUMENT_IMPL_HXX
      21             : #define INCLUDED_WW8_DOCUMENT_IMPL_HXX
      22             : 
      23             : #include <set>
      24             : #include <WW8PieceTable.hxx>
      25             : #include <WW8BinTable.hxx>
      26             : #include <doctok/resources.hxx>
      27             : #include <resourcemodel/WW8ResourceModel.hxx>
      28             : #include <PLCF.hxx>
      29             : #include <WW8Sttbf.hxx>
      30             : #include <XNoteHelper.hxx>
      31             : 
      32             : namespace writerfilter {
      33             : namespace doctok
      34             : {
      35             : 
      36             : class WW8DocumentImpl;
      37             : 
      38             : /**
      39             :    A bookmark.
      40             : */
      41             : class Bookmark : public writerfilter::Reference<Properties>
      42             : {
      43             :     /// bookmark first descriptor
      44             :     writerfilter::Reference<Properties>::Pointer_t mpBKF;
      45             : 
      46             :     /// name of bookmark
      47             :     OUString mName;
      48             : 
      49             : public:
      50             :     Bookmark(writerfilter::Reference<Properties>::Pointer_t pBKF,
      51             :              OUString & rName);
      52             : 
      53           0 :     virtual ~Bookmark() {}
      54             : 
      55             :     /**
      56             :        Resolve bookmark to handler.
      57             : 
      58             :        @param rHandler    handler to send events to
      59             :      */
      60             :     virtual void resolve(Properties & rHandler);
      61             : 
      62             :     virtual string getType() const;
      63             : };
      64             : 
      65             : /**
      66             :    A helper for bookmarks.
      67             :  */
      68           0 : class BookmarkHelper
      69             : {
      70             :     /// PLCF containing Cps and BKFs for the bookmarks
      71             :     PLCF<WW8BKF>::Pointer_t mpStartCps;
      72             : 
      73             :     /// Cps of the ends of bookmarks
      74             :     WW8StructBase::Pointer_t mpEndCps;
      75             : 
      76             :     /// STTBF containing the names of bookmarks
      77             :     WW8Sttbf::Pointer_t mpNames;
      78             : 
      79             :     /// piece table for converting CPs to FCs
      80             :     WW8PieceTable::Pointer_t mpPieceTable;
      81             : 
      82             :     /// document to insert CpAndFcs to
      83             :     WW8DocumentImpl * mpDoc;
      84             : 
      85             :     /**
      86             :        Return start CpAndFc for a bookmark.
      87             : 
      88             :        @param nPos       index of the bookmark
      89             :     */
      90             :     CpAndFc getStartCpAndFc(sal_uInt32 nPos);
      91             : 
      92             :     /**
      93             :        Return end CpAndFc for a bookmark.
      94             : 
      95             :        @param nPos       index of the bookmark
      96             :     */
      97             :     CpAndFc getEndCpAndFc(sal_uInt32 nPos);
      98             : 
      99             :     /**
     100             :        Return the name of a bookmark.
     101             : 
     102             :        @param nPos       index of the bookmark
     103             :     */
     104             :     OUString getName(sal_uInt32 nPos);
     105             : 
     106             :     /**
     107             :        Return index of a bookmark.
     108             : 
     109             :        @param rCpAndFc    CpAndFc of the bookmark
     110             :      */
     111             :     sal_uInt32 getIndex(const CpAndFc & rCpAndFc);
     112             : 
     113             : public:
     114             :     typedef boost::shared_ptr<BookmarkHelper> Pointer_t;
     115             : 
     116           0 :     BookmarkHelper(PLCF<WW8BKF>::Pointer_t pStartCps,
     117             :                    WW8StructBase::Pointer_t pEndCps,
     118             :                    WW8Sttbf::Pointer_t pNames,
     119             :                    WW8PieceTable::Pointer_t pPieceTable,
     120             :                    WW8DocumentImpl * pDoc)
     121             :     : mpStartCps(pStartCps), mpEndCps(pEndCps), mpNames(pNames),
     122           0 :       mpPieceTable(pPieceTable), mpDoc(pDoc)
     123             :     {
     124           0 :     }
     125             : 
     126             :     /**
     127             :        Initialize.
     128             : 
     129             :        Inserts CpAndFcs for the bookmark starts and ends into the
     130             :     document.
     131             :     */
     132             :     void init();
     133             : 
     134             :     /**
     135             :        Return BKF of a bookmark.
     136             : 
     137             :        @param rCpAndFc       CpAndFc of the bookmark
     138             :      */
     139             :     writerfilter::Reference<Properties>::Pointer_t getBKF
     140             :     (const CpAndFc & rCpAndFc);
     141             : 
     142             :     /**
     143             :        Return the name of a bookmark.
     144             : 
     145             :        @param rCpAndFc       CpAndFc of the bookmark
     146             :      */
     147             :     OUString getName(const CpAndFc & rCp);
     148             : 
     149             :     /**
     150             :        Return bookmark.
     151             :        @param rCpAndFc       CpAndFc of the bookmark
     152             :      */
     153             :     writerfilter::Reference<Properties>::Pointer_t
     154             :     getBookmark(const CpAndFc & rCpAndFc);
     155             : };
     156             : 
     157             : /**
     158             :    Helper for shapes.
     159             :  */
     160           0 : class ShapeHelper
     161             : {
     162             : public:
     163             :     typedef boost::unordered_map<CpAndFc, WW8FSPA::Pointer_t, CpAndFcHash> Map_t;
     164             : 
     165             : private:
     166             :     WW8DocumentImpl * mpDoc;
     167             :     Map_t mMap;
     168             : 
     169             : public:
     170             :     typedef boost::shared_ptr<ShapeHelper> Pointer_t;
     171             :     ShapeHelper(PLCF<WW8FSPA>::Pointer_t pPlcspaMom,
     172             :                 PLCF<WW8FSPA>::Pointer_t pPlcspaHdr,
     173             :                 WW8DocumentImpl * pDoc);
     174             : 
     175             :     void init();
     176             : 
     177             :     writerfilter::Reference<Properties>::Pointer_t
     178             :     getShape(const CpAndFc & rCpAndFc);
     179             : 
     180             : };
     181             : 
     182             : /**
     183             :    Helper for fields.
     184             :  */
     185           0 : class FieldHelper
     186             : {
     187             : public:
     188             :     typedef boost::unordered_map<CpAndFc, WW8FLD::Pointer_t,
     189             :                      CpAndFcHash> Map_t;
     190             : 
     191             : private:
     192             :     WW8DocumentImpl * mpDoc;
     193             :     Map_t mMap;
     194             : public:
     195             : 
     196             :     typedef boost::shared_ptr<FieldHelper> Pointer_t;
     197             :     FieldHelper(PLCF<WW8FLD>::Pointer_t pPlcffldMom,
     198             :                 WW8DocumentImpl * pDoc);
     199             : 
     200             :     void init();
     201             : 
     202             :     writerfilter::Reference<Properties>::Pointer_t
     203             :     getField(const CpAndFc & rCpAndFc);
     204             : 
     205             :     WW8FLD::Pointer_t getWW8FLD(const CpAndFc & rCpAndFc);
     206             : };
     207             : 
     208             : /**
     209             :     Helper for Breaks.
     210             : */
     211           0 : class BreakHelper
     212             : {
     213             : public:
     214             :     typedef boost::unordered_map<CpAndFc, WW8BKD::Pointer_t,
     215             :                      CpAndFcHash> Map_t;
     216             : private:
     217             :     WW8DocumentImpl * mpDoc;
     218             :     Map_t mMap;
     219             : public:
     220             :     typedef boost::shared_ptr<BreakHelper> Pointer_t;
     221             :     BreakHelper(PLCF<WW8BKD>::Pointer_t pPlcfbkdMom,
     222             :                 WW8DocumentImpl * pDoc);
     223             : 
     224             :     void init();
     225             : 
     226             :     writerfilter::Reference<Properties>::Pointer_t
     227             :     getBreak(const CpAndFc & rCpAndFc);
     228             : };
     229             : 
     230             : /**
     231             :    Implementation class for document.
     232             :  */
     233           0 : class WW8DocumentImpl : public WW8Document
     234             : {
     235             :     /// true if the document is contained in another document
     236             :     bool bSubDocument;
     237             : 
     238             :     /// picture location
     239             :     sal_uInt32 mfcPicLoc;
     240             : 
     241             :     /// true if FFDATA structure is found at offset mfcPicLoc in data stream
     242             :     bool mbPicIsData;
     243             : 
     244             :     /// current field descriptor
     245             :     WW8FLD::Pointer_t mpFLD;
     246             : 
     247             :     /// CpAndFcs in the document where properties change
     248             :     CpAndFcs mCpAndFcs;
     249             : 
     250             :     /// CpAndFc pointing to the start of the document
     251             :     CpAndFc mCpAndFcStart;
     252             : 
     253             :     /// CpAndFc pointing to the end of the document
     254             :     CpAndFc mCpAndFcEnd;
     255             : 
     256             :     /// pointer to the cache of FKPs containing character properties
     257             :     WW8FKPCache::Pointer_t mpCHPFKPCache;
     258             : 
     259             :     /// pointer to the cache of FPKs containing paragraph properties
     260             :     WW8FKPCache::Pointer_t mpPAPFKPCache;
     261             : 
     262             :     /// pointer to the stream containing the whole document
     263             :     WW8Stream::Pointer_t mpStream;
     264             : 
     265             :     /// pointer to the substream of the document containing table like
     266             :     /// structures
     267             :     WW8Stream::Pointer_t mpTableStream;
     268             : 
     269             :     /// pointer to the substream of the document containing the
     270             :     /// document contents and formatting information
     271             :     WW8Stream::Pointer_t mpDocStream;
     272             : 
     273             :     /// pointer to the data stream of the document
     274             :     WW8Stream::Pointer_t mpDataStream;
     275             : 
     276             :     /// pointer to the compound object stream of the document
     277             :     WW8Stream::Pointer_t mpCompObjStream;
     278             : 
     279             :     /// pointer to the summayry information stream of the document
     280             :     WW8Stream::Pointer_t mpSummaryInformationStream;
     281             : 
     282             :     /// pointer to the piece table
     283             :     WW8PieceTable::Pointer_t mpPieceTable;
     284             : 
     285             :     /// pointer to the bin table for paragraph properties
     286             :     WW8BinTable::Pointer_t mpBinTablePAPX;
     287             : 
     288             :     /// pointer to the bin table for character properties
     289             :     WW8BinTable::Pointer_t mpBinTableCHPX;
     290             : 
     291             :     /// PLCF containing the section descriptions
     292             :     PLCF<WW8SED>::Pointer_t mpSEDs;
     293             : 
     294             :     /// pointer to the file information block
     295             :     WW8Fib::Pointer_t mpFib;
     296             : 
     297             :     /// pointer to the file information block for post 2000 documents
     298             :     WW8FibRgFcLcb2000::Pointer_t mpFibRgFcLcb2000;
     299             : 
     300             :     /// pointer to the offsets of headers/footers
     301             :     WW8StructBase::Pointer_t mpHeaderOffsets;
     302             : 
     303             :     /// pointer to the helper for footnotes
     304             :     XNoteHelper<WW8FRD>::Pointer_t mpFootnoteHelper;
     305             : 
     306             :     /// pointer to the helper for endnotes
     307             :     XNoteHelper<WW8FRD>::Pointer_t mpEndnoteHelper;
     308             : 
     309             :     /// pointer to the helper for annotations
     310             :     XNoteHelper<WW8ATRD>::Pointer_t mpAnnotationHelper;
     311             : 
     312             :     /// pointer to the helper for bookmarks
     313             :     BookmarkHelper::Pointer_t mpBookmarkHelper;
     314             : 
     315             :     /// pointer to the helper for fields
     316             :     FieldHelper::Pointer_t mpFieldHelper;
     317             : 
     318             :     /// pointer to the helper for shapes
     319             :     ShapeHelper::Pointer_t mpShapeHelper;
     320             : 
     321             :     /// pointer to the helper for breaks
     322             :     BreakHelper::Pointer_t mpBreakHelper;
     323             : 
     324             : 
     325             :     /// cache for the Cp where main text flow end
     326             :     CpAndFc mDocumentEndCpAndFc;
     327             : 
     328             :     /// cache for the Cp where footnotes section ends
     329             :     CpAndFc mFootnoteEndCpAndFc;
     330             : 
     331             :     /// cache for the Cp where header section ends
     332             :     CpAndFc mHeaderEndCpAndFc;
     333             : 
     334             :     /// cache for the Cp where annotation section ends
     335             :     CpAndFc mAnnotationEndCpAndFc;
     336             : 
     337             :     /// cache for the Cp where endnote section ends
     338             :     CpAndFc mEndnoteEndCpAndFc;
     339             : 
     340             :     /// cache for the Cp where textbox section ends
     341             :     CpAndFc mTextboxEndCpAndFc;
     342             : 
     343             :     /// cache for the Cp where textbox in header section ends
     344             :     CpAndFc mTextboxHeaderEndCpAndFc;
     345             : 
     346             :     /// DffBlock of document
     347             :     DffBlock::Pointer_t mpDffBlock;
     348             : 
     349             :     /// Textbox stories
     350             :     PLCF<WW8FTXBXS>::Pointer_t mpTextBoxStories;
     351             : 
     352             :     bool mbInSection;
     353             :     bool mbInParagraphGroup;
     354             :     bool mbInCharacterGroup;
     355             : 
     356             :     bool isSpecial(sal_uInt32 nChar);
     357             : 
     358             :     WW8Stream::Pointer_t getSubStream(const OUString & sId) const;
     359             : 
     360             :     /**
     361             :        Parse bin table and create CpAndFcs for all points in the
     362             :        document where properties of the given type change.
     363             : 
     364             :        @param rTable   bin table to parse
     365             :        @param eType_   type of CpAndFcs to create
     366             :      */
     367             :     void parseBinTableCpAndFcs(WW8BinTable & rTable, PropertyType eType_);
     368             : 
     369             :     void startCharacterGroup(Stream & rStream);
     370             :     void endCharacterGroup(Stream & rStream);
     371             :     void startParagraphGroup(Stream & rStream);
     372             :     void endParagraphGroup(Stream & rStream);
     373             :     void startSectionGroup(Stream & rStream);
     374             :     void endSectionGroup(Stream & rStream);
     375             :     void text(Stream & rStream, const sal_uInt8 * data, size_t len);
     376             :     void utext(Stream & rStream, const sal_uInt8 * data, size_t len);
     377             : 
     378             : public:
     379             :     WW8DocumentImpl(WW8Stream::Pointer_t rpStream);
     380             :     WW8DocumentImpl(const WW8DocumentImpl & rSrc,
     381             :                     const CpAndFc & rStart, const CpAndFc & rEnd);
     382             :     virtual ~WW8DocumentImpl();
     383             : 
     384             :     virtual WW8DocumentImpl & Assign(const WW8DocumentImpl & rSrc);
     385             : 
     386             :     virtual string getType() const;
     387             : 
     388             :     virtual WW8Document::Pointer_t getSubDocument(SubDocumentId nId);
     389             :     virtual WW8DocumentIterator::Pointer_t getIterator
     390             :     (const CpAndFc & rCpAndFc);
     391             :     virtual WW8DocumentIterator::Pointer_t begin();
     392             :     virtual WW8DocumentIterator::Pointer_t end();
     393             : 
     394             :     virtual WW8Stream::Sequence getText(const CpAndFc & rStart);
     395             : 
     396             :     /**
     397             :        Returns the document stream.
     398             :     */
     399             : 
     400             :     WW8Stream::Pointer_t getDocStream() const;
     401             : 
     402             :     /**
     403             :        Returns the data stream.
     404             :      */
     405             :     WW8Stream::Pointer_t getDataStream() const;
     406             : 
     407             :     /**
     408             :        Returns distance in bytes to next CpAndFc.
     409             : 
     410             :        @param rCpAndFc  CpAndFc to start at
     411             :      */
     412             :     sal_uInt32 getByteLength(const CpAndFc & rCpAndFc) const;
     413             : 
     414             :     /**
     415             :        Returns first character position in document.
     416             :      */
     417             :     const CpAndFc & getFirstCp() const;
     418             : 
     419             :     /**
     420             :        Returns last character position in document.
     421             :     */
     422             :     const CpAndFc & getLastCp() const;
     423             : 
     424             :     /**
     425             :        Returns next character position with change in properties.
     426             : 
     427             :        @param rCpAndFc   position to start at
     428             :      */
     429             :     CpAndFc getNextCp(const CpAndFc & rCpAndFc) const;
     430             : 
     431             :     /**
     432             :        Returns previous character position with change in properties.
     433             : 
     434             :        @param rCpAndFc   position to start at
     435             :     */
     436             :     CpAndFc getPrevCp(const CpAndFc & rCpAndFc) const;
     437             : 
     438             :     /**
     439             :        Returns character position where main text flow ends.
     440             :      */
     441             :     CpAndFc getDocumentEndCp() const;
     442             : 
     443             :     /**
     444             :        Returns character position where footnotes end.
     445             :     */
     446             :     CpAndFc getFootnodeEndCp() const;
     447             : 
     448             :     /**
     449             :        Returns character position where headers end.
     450             :     */
     451             :     CpAndFc getHeaderEndCp() const;
     452             : 
     453             :     /**
     454             :        Returns character position where annatations end.
     455             :     */
     456             :     CpAndFc getAnnotationEndCp() const;
     457             : 
     458             :     /**
     459             :        Returns character position where endnotes end.
     460             :     */
     461             :     CpAndFc getEndnoteEndCp() const;
     462             : 
     463             :     /**
     464             :        Returns character position where textboxes end.
     465             :     */
     466             :     CpAndFc getTextboxEndCp() const;
     467             : 
     468             :     /**
     469             :        Returns character positoion where textboxes in headers end.
     470             :     */
     471             :     CpAndFc getTextboxHeaderEndCp() const;
     472             : 
     473             :     /**
     474             :        Insert CpAndFc to set of CpAndFcs.
     475             : 
     476             :        @param rCpAndFc    CpAndFc to insert
     477             :     */
     478             :     void insertCpAndFc(const CpAndFc & rCpAndFc);
     479             : 
     480             :     /**
     481             :        Return FKP for certain CpAndFc.
     482             : 
     483             :        @param rCpAndFc CpAndFc for which the FKP is looked for
     484             :      */
     485             :     WW8FKP::Pointer_t getFKP(const CpAndFc & rCpAndFc);
     486             : 
     487             :     /**
     488             :        Return FKP containing character properties.
     489             : 
     490             :        @param nIndex      index of FKP to return
     491             :        @param bComplex    true if FKP contains complex FCs
     492             :      */
     493             :     WW8FKP::Pointer_t getFKPCHPX(sal_uInt32 nIndex, bool bComplex);
     494             : 
     495             :     /**
     496             :        Return FKP containing paragraph properties.
     497             : 
     498             :        @param nIndex      index of FKP to return
     499             :        @param bComplex    true if FKP contains complex FCs
     500             :      */
     501             :     WW8FKP::Pointer_t getFKPPAPX(sal_uInt32 nIndex, bool bComplex);
     502             : 
     503             :     /**
     504             :        Return property set valid at a certain CpAndFc.
     505             : 
     506             :        @param rCpAndFc    CpAndFc to look at
     507             :      */
     508             :     writerfilter::Reference<Properties>::Pointer_t
     509             :     getProperties(const CpAndFc & rCpAndFc);
     510             : 
     511             :     /**
     512             :        Return subdocument referenced at a certain point in document.
     513             : 
     514             :        @param rCpAndFc       CpAndFc where subdocument is referenced
     515             :      */
     516             :     writerfilter::Reference<Stream>::Pointer_t
     517             :     getSubDocument(const CpAndFc & rCpAndFc);
     518             : 
     519             :     /**
     520             :        Return section description at a certain CpAndFc.
     521             : 
     522             :        @param rCpAndFc   CpAndFc to look at
     523             :      */
     524             :     WW8SED * getSED(const CpAndFc & rCpAndFc) const;
     525             : 
     526             :     /**
     527             :      Return reference to list plcs.
     528             :     */
     529             :     writerfilter::Reference<Table>::Pointer_t getListTplcs() const;
     530             : 
     531             :     /**
     532             :        Return reference to list table.
     533             :      */
     534             :     writerfilter::Reference<Table>::Pointer_t getListTable() const;
     535             : 
     536             :     /**
     537             :        Return reference to table of list level overrides.
     538             :     */
     539             :     writerfilter::Reference<Table>::Pointer_t getLFOTable() const;
     540             : 
     541             :     /**
     542             :        Return reference to font table.
     543             :      */
     544             :     writerfilter::Reference<Table>::Pointer_t getFontTable() const;
     545             : 
     546             :     /**
     547             :        Return reference to style sheet.
     548             :     */
     549             :     writerfilter::Reference<Table>::Pointer_t getStyleSheet() const;
     550             : 
     551             :     /**
     552             :        Return reference to associated data.
     553             :      */
     554             :     writerfilter::Reference<Table>::Pointer_t getAssocTable() const;
     555             : 
     556             :     /**
     557             :        Return count of headers/footers.
     558             :     */
     559             :     sal_uInt32 getHeaderCount() const;
     560             : 
     561             :     /**
     562             :        Return CpAndFc for a header or footer.
     563             : 
     564             :        @param nPos   index in the list of headers and footers
     565             :      */
     566             :     CpAndFc getHeaderCpAndFc(sal_uInt32 nPos);
     567             : 
     568             :     /**
     569             :        Return subdocument for header/footer.
     570             : 
     571             :        @param nPos   index in the list of headers and footers
     572             :      */
     573             :     writerfilter::Reference<Stream>::Pointer_t getHeader(sal_uInt32 nPos);
     574             : 
     575             :     /**
     576             :        Return count of footnotes.
     577             :     */
     578             :     sal_uInt32 getFootnoteCount() const;
     579             : 
     580             :     /**
     581             :        Return subdocument for footnote.
     582             : 
     583             :        @param nPos     index of the footnote
     584             :     */
     585             :     writerfilter::Reference<Stream>::Pointer_t getFootnote(sal_uInt32 nPos);
     586             : 
     587             :     /**
     588             :        Return subdocument for footnote at a certain position in document.
     589             : 
     590             :        @param rCpAndFc      position in document
     591             :      */
     592             :     writerfilter::Reference<Stream>::Pointer_t getFootnote
     593             :     (const CpAndFc & rCpAndFc);
     594             : 
     595             :     /**
     596             :        Return count of endnotes.
     597             :     */
     598             :     sal_uInt32 getEndnoteCount() const;
     599             : 
     600             :     /**
     601             :        Return subdocument for an endnote.
     602             : 
     603             :        @param nPos       index of the endnote
     604             :      */
     605             :     writerfilter::Reference<Stream>::Pointer_t getEndnote(sal_uInt32 nPos);
     606             : 
     607             :     /**
     608             :        Return subdocument for an endnote.
     609             : 
     610             :        @param rCpAndFc    CpAndFc where endnote is referenced
     611             :      */
     612             :     writerfilter::Reference<Stream>::Pointer_t getEndnote
     613             :     (const CpAndFc & rCpAndFc);
     614             : 
     615             :     /**
     616             :        Return count of annotations.
     617             :     */
     618             :     sal_uInt32 getAnnotationCount() const;
     619             : 
     620             :     /**
     621             :        Return subdocument for an annotation.
     622             : 
     623             :        @param nPos       index of the annotation
     624             :      */
     625             :     writerfilter::Reference<Stream>::Pointer_t getAnnotation(sal_uInt32 nPos);
     626             : 
     627             :     /**
     628             :        Return subdocument for an annotation.
     629             : 
     630             :        @param rCpAndFc    CpAndFc where annotation is referenced
     631             :      */
     632             :     writerfilter::Reference<Stream>::Pointer_t getAnnotation
     633             :     (const CpAndFc & rCpAndFc);
     634             : 
     635             :     /**
     636             :        Return bookmark.
     637             : 
     638             :        @param rCpAndFc    CpAndFc where bookmark begins or ends
     639             :      */
     640             :     writerfilter::Reference<Properties>::Pointer_t
     641             :     getBookmark(const CpAndFc & rCpAndFc) const;
     642             : 
     643             :     /**
     644             :        Return shape.
     645             : 
     646             :        @param rCpAndFc    CpAndFc of the shape
     647             :      */
     648             :     writerfilter::Reference<Properties>::Pointer_t
     649             :     getShape(const CpAndFc & rCpAndFc) const;
     650             : 
     651             :     writerfilter::Reference<Properties>::Pointer_t
     652             :     getShape(sal_uInt32 nSpid);
     653             : 
     654             :     /**
     655             :        Return blip.
     656             : 
     657             :        @param nBlib  number of the blip to return
     658             :     */
     659             :     writerfilter::Reference<Properties>::Pointer_t
     660             :     getBlip(sal_uInt32 nBlib);
     661             : 
     662             :     /**
     663             :        Return break descriptor.
     664             : 
     665             :        @param rCpAndFc    CpAndFc of the break
     666             :     */
     667             :     writerfilter::Reference<Properties>::Pointer_t
     668             :     getBreak(const CpAndFc & rCpAndFc) const;
     669             : 
     670             : 
     671             :     /**
     672             :        Return field.
     673             : 
     674             :        @param rCpAndFc    CpAndFc of the field
     675             :      */
     676             :     writerfilter::Reference<Properties>::Pointer_t
     677             :     getField(const CpAndFc & rCpAndFc) const;
     678             : 
     679             :     /**
     680             :        Return document properties.
     681             : 
     682             :     */
     683             :     writerfilter::Reference<Properties>::Pointer_t
     684             :     getDocumentProperties() const;
     685             : 
     686             :     /**
     687             :        Return current field descriptor.
     688             :     */
     689             :     WW8FLD::Pointer_t getCurrentFLD() const;
     690             : 
     691             :     /**
     692             :        Return stream of text box.
     693             : 
     694             :        @param nShpId    shape id of text box
     695             :      */
     696             :     writerfilter::Reference<Stream>::Pointer_t
     697             :     getTextboxText(sal_uInt32 nShpId) const;
     698             : 
     699             :     /**
     700             :        Return file character position according to a character
     701             :        position.
     702             : 
     703             :        @param cp   the character position
     704             :      */
     705             :     Fc cp2fc(const Cp & cp) const;
     706             : 
     707             :     /**
     708             :        Return CpAndFc related to character position.
     709             : 
     710             :        @param cp    the character position
     711             :      */
     712             :     CpAndFc getCpAndFc(const Cp & cp, PropertyType type = PROP_DOC) const;
     713             : 
     714             :     /**
     715             :        Return CpAndFc related to file character position.
     716             : 
     717             :        @param fc    the file character position
     718             :     */
     719             :     CpAndFc getCpAndFc(const Fc & fc, PropertyType type = PROP_DOC) const;
     720             : 
     721             :     sal_uInt32 getPicLocation() const;
     722             :     void setPicLocation(sal_uInt32 fcPicLoc);
     723             : 
     724             :     bool isPicData();
     725             :     void setPicIsData(bool bPicIsData);
     726             : 
     727             :     /**
     728             :        Create events for the document.
     729             : 
     730             :        @param rHandler    handler to send the events to
     731             :      */
     732             :     void resolve(Stream & rHandler);
     733             : 
     734             :     /**
     735             :        Resolve text.
     736             : 
     737             :        The text of the given iterator is split at special
     738             :        characters. Each run of non-special characters is send as one
     739             :        event. Each run of special characters is send as one event.
     740             : 
     741             :        @param pIt        iterator whose text is to be resolved
     742             :        @param rStream    handler for the events
     743             :      */
     744             :     void resolveText(WW8DocumentIterator::Pointer_t pIt, Stream & rStream);
     745             : 
     746             :     /**
     747             :        Resolve the picture at mfcPicLoc.
     748             : 
     749             :        @param rStream
     750             :      */
     751             :     void resolvePicture(Stream & rStream);
     752             : 
     753             :     /**
     754             :        Resolve special char.
     755             : 
     756             :        @param nChar    the special char
     757             :        @param rStream  the stream handler to resolve the special char to
     758             :      */
     759             :     void resolveSpecialChar(sal_uInt32 nChar, Stream & rStream);
     760             : };
     761             : 
     762             : /**
     763             :    Implentation class for an iterator in a document.
     764             :  */
     765             : class WW8DocumentIteratorImpl : public WW8DocumentIterator
     766             : {
     767             :     /// pointer to the document
     768             :     WW8DocumentImpl * mpDocument;
     769             : 
     770             :     /// CpAndFc the iterator is pointing to
     771             :     CpAndFc mCpAndFc;
     772             : 
     773             : public:
     774           0 :     WW8DocumentIteratorImpl(WW8DocumentImpl * pDocument,
     775             :                             const CpAndFc & rCpAndFc)
     776           0 :     : mpDocument(pDocument), mCpAndFc(rCpAndFc)
     777             :     {
     778           0 :     }
     779             : 
     780             :     virtual ~WW8DocumentIteratorImpl();
     781             : 
     782             :     /**
     783             :        Increase the iterator to the next character position.
     784             :      */
     785             :     WW8DocumentIterator & operator++();
     786             : 
     787             :     /**
     788             :        Decrease the iterator to the previous character position.
     789             :      */
     790             :     WW8DocumentIterator & operator--();
     791             : 
     792             :     virtual writerfilter::Reference<Properties>::Pointer_t getProperties()
     793             :         const;
     794             :     //void setAttributes(const IAttributeSet & aAttributeSet);
     795             : 
     796             :     virtual writerfilter::Reference<Stream>::Pointer_t getSubDocument() const;
     797             : 
     798             :     /** Return if the text the iterator points to is complex.
     799             : 
     800             :         @attention The definition of a complex run of text in Word is
     801             :         counter-intuitive: Complex runs use 8-bit encoding for characters,
     802             :         non-complex ones use 16 bits.
     803             :     */
     804             :     bool isComplex() const;
     805             :     virtual PropertyType getPropertyType() const;
     806             : 
     807             :     virtual WW8Stream::Sequence getText();
     808             :     virtual bool equal(const WW8DocumentIterator & rIt) const;
     809             : 
     810             :     virtual string toString() const;
     811             :     virtual void dump(ostream & o) const;
     812             : 
     813             :     /**
     814             :        Return pointer to the shape at character position the iterator
     815             :        is pointing to.
     816             :      */
     817             :     virtual writerfilter::Reference<Properties>::Pointer_t getShape() const;
     818             : 
     819             :     /**
     820             :        Return pointer to section description at character position the
     821             :        iterator points to.
     822             :      */
     823             :     WW8SED * getSED() const;
     824             : };
     825             : 
     826             : /**
     827             :    Return string for property type.
     828             :  */
     829             : string propertyTypeToString(PropertyType nType);
     830             : 
     831             : }}
     832             : #endif // INCLUDED_WW8_DOCUMENT_IMPL_HXX
     833             : 
     834             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10