LCOV - code coverage report
Current view: top level - sw/inc - shellio.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 53 66 80.3 %
Date: 2015-06-13 12:38:46 Functions: 49 64 76.6 %
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             : #ifndef INCLUDED_SW_INC_SHELLIO_HXX
      20             : #define INCLUDED_SW_INC_SHELLIO_HXX
      21             : 
      22             : #include <memory>
      23             : #include <boost/utility.hpp>
      24             : 
      25             : #include <com/sun/star/uno/Reference.h>
      26             : #include <com/sun/star/embed/XStorage.hpp>
      27             : #include <sfx2/docfile.hxx>
      28             : #include <sfx2/fcontnr.hxx>
      29             : #include <sot/formats.hxx>
      30             : #include <sot/storage.hxx>
      31             : #include <svtools/parhtml.hxx>
      32             : #include <tools/date.hxx>
      33             : #include <tools/time.hxx>
      34             : #include <tools/datetime.hxx>
      35             : #include <tools/ref.hxx>
      36             : #include <swdllapi.h>
      37             : #include <swtypes.hxx>
      38             : #include <docfac.hxx>
      39             : #include <iodetect.hxx>
      40             : #include <IMark.hxx>
      41             : 
      42             : class SfxFilterContainer;
      43             : class SfxFilter;
      44             : class SfxItemPool;
      45             : class SfxItemSet;
      46             : class SfxMedium;
      47             : class SvStream;
      48             : class SvxFontItem;
      49             : class SvxMacroTableDtor;
      50             : class SwContentNode;
      51             : class SwCrsrShell;
      52             : class SwDoc;
      53             : class SwPaM;
      54             : class SwTextBlocks;
      55             : struct SwPosition;
      56             : struct Writer_Impl;
      57             : 
      58             : // Defines the count of chars at which a paragraph read via ASCII/W4W-Reader
      59             : // is forced to wrap. It has to be always greater than 200!!!
      60             : #define MAX_ASCII_PARA 10000
      61             : 
      62       56938 : class SW_DLLPUBLIC SwAsciiOptions
      63             : {
      64             :     OUString sFont;
      65             :     rtl_TextEncoding eCharSet;
      66             :     sal_uInt16 nLanguage;
      67             :     LineEnd eCRLF_Flag;
      68             : 
      69             : public:
      70             : 
      71          15 :     OUString GetFontName() const { return sFont; }
      72           0 :     void SetFontName( const OUString& rFont ) { sFont = rFont; }
      73             : 
      74       18847 :     rtl_TextEncoding GetCharSet() const { return eCharSet; }
      75        8075 :     void SetCharSet( rtl_TextEncoding nVal ) { eCharSet = nVal; }
      76             : 
      77           9 :     sal_uInt16 GetLanguage() const { return nLanguage; }
      78           0 :     void SetLanguage( sal_uInt16 nVal ) { nLanguage = nVal; }
      79             : 
      80        9115 :     LineEnd GetParaFlags() const { return eCRLF_Flag; }
      81           0 :     void SetParaFlags( LineEnd eVal ) { eCRLF_Flag = eVal; }
      82             : 
      83       16751 :     void Reset()
      84             :     {
      85       16751 :         sFont.clear();
      86       16751 :         eCRLF_Flag = GetSystemLineEnd();
      87       16751 :         eCharSet = ::osl_getThreadTextEncoding();
      88       16751 :         nLanguage = 0;
      89       16751 :     }
      90             :     // for the automatic conversion (mail/news/...)
      91             :     void ReadUserData( const OUString& );
      92             :     void WriteUserData( OUString& );
      93             : 
      94       16560 :     SwAsciiOptions() { Reset(); }
      95             : };
      96             : 
      97             : // Base class of possible options for a special reader.
      98             : class Reader;
      99             : // Calls reader with its options, document, cursor etc.
     100             : class SwReader;
     101             : // SwRead is pointer to the read-options base class.
     102             : typedef Reader *SwRead;
     103             : 
     104         187 : class SwgReaderOption
     105             : {
     106             :     SwAsciiOptions aASCIIOpts;
     107             :     union
     108             :     {
     109             :         bool bFormatsOnly;
     110             :         struct
     111             :         {
     112             :             bool bFrameFormats: 1;
     113             :             bool bPageDescs: 1;
     114             :             bool bTextFormats: 1;
     115             :             bool bNumRules: 1;
     116             :             bool bMerge:1;
     117             :         }  Formats;
     118             :     } What;
     119             : 
     120             : public:
     121         478 :     void ResetAllFormatsOnly() { What.bFormatsOnly = false; }
     122        1872 :     bool IsFormatsOnly() const { return What.bFormatsOnly; }
     123             : 
     124           0 :     bool IsFrameFormats() const { return What.Formats.bFrameFormats; }
     125           0 :     void SetFrameFormats( const bool bNew) { What.Formats.bFrameFormats = bNew; }
     126             : 
     127           1 :     bool IsPageDescs() const { return What.Formats.bPageDescs; }
     128           0 :     void SetPageDescs( const bool bNew) { What.Formats.bPageDescs = bNew; }
     129             : 
     130           0 :     bool IsTextFormats() const { return What.Formats.bTextFormats; }
     131           0 :     void SetTextFormats( const bool bNew) { What.Formats.bTextFormats = bNew; }
     132             : 
     133           0 :     bool IsNumRules() const { return What.Formats.bNumRules; }
     134           0 :     void SetNumRules( const bool bNew) { What.Formats.bNumRules = bNew; }
     135             : 
     136           0 :     bool IsMerge() const { return What.Formats.bMerge; }
     137           0 :     void SetMerge( const bool bNew ) { What.Formats.bMerge = bNew; }
     138             : 
     139           4 :     const SwAsciiOptions& GetASCIIOpts() const { return aASCIIOpts; }
     140           3 :     void SetASCIIOpts( const SwAsciiOptions& rOpts ) { aASCIIOpts = rOpts; }
     141           4 :     void ResetASCIIOpts() { aASCIIOpts.Reset(); }
     142             : 
     143         187 :     SwgReaderOption()
     144         187 :     {   ResetAllFormatsOnly(); aASCIIOpts.Reset(); }
     145             : };
     146             : 
     147         440 : class SW_DLLPUBLIC SwReader: public SwDocFac
     148             : {
     149             :     SvStream* pStrm;
     150             :     tools::SvRef<SotStorage> pStg;
     151             :     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
     152             :     SfxMedium* pMedium;     // Who wants to obtain a Medium (W4W).
     153             : 
     154             :     SwPaM* pCrsr;
     155             :     OUString aFileName;
     156             :     OUString sBaseURL;
     157             :     bool mbSkipImages;
     158             : 
     159             : public:
     160             : 
     161             :     // Initial reading. Document is created only at Read(...)
     162             :     // or in case it is given, into that.
     163             :     // Special case for Load with Sw3Reader.
     164             :     SwReader( SfxMedium&, const OUString& rFilename, SwDoc *pDoc = 0 );
     165             : 
     166             :     // Read into existing document.
     167             :     // Document and position in document are taken from SwPaM.
     168             :     SwReader( SvStream&, const OUString& rFilename, const OUString& rBaseURL, SwPaM& );
     169             :     SwReader( SfxMedium&, const OUString& rFilename, SwPaM& );
     170             :     SwReader( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const OUString& rFilename, SwPaM& );
     171             : 
     172             :     // The only export interface is SwReader::Read(...)!!!
     173             :     sal_uLong Read( const Reader& );
     174             : 
     175             :     // Ask for glossaries.
     176             :     bool HasGlossaries( const Reader& );
     177             :     bool ReadGlossaries( const Reader&, SwTextBlocks&, bool bSaveRelFiles );
     178             : 
     179         440 :     OUString            GetBaseURL() const { return sBaseURL;}
     180             : 
     181             : protected:
     182         440 :     void                SetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
     183         439 :     void                SetSkipImages( bool bSkipImages ) { mbSkipImages = bSkipImages; }
     184             : };
     185             : 
     186             : // Special Readers can be both!! (Excel, W4W, .. ).
     187             : #define SW_STREAM_READER    1
     188             : #define SW_STORAGE_READER   2
     189             : 
     190             : class SW_DLLPUBLIC Reader
     191             : {
     192             :     friend class SwReader;
     193             :     SwDoc* pTemplate;
     194             :     OUString aTemplateNm;
     195             : 
     196             :     Date aDStamp;
     197             :     tools::Time aTStamp;
     198             :     DateTime aChkDateTime;
     199             : 
     200             : protected:
     201             :     SvStream* pStrm;
     202             :     tools::SvRef<SotStorage> pStg;
     203             :     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
     204             :     SfxMedium* pMedium;     // Who wants to obtain a Medium (W4W).
     205             : 
     206             :     SwgReaderOption aOpt;
     207             :     bool bInsertMode : 1;
     208             :     bool bTmplBrowseMode : 1;
     209             :     bool bReadUTF8: 1;      // Interprete stream as UTF-8.
     210             :     bool bBlockMode: 1;
     211             :     bool bOrganizerMode : 1;
     212             :     bool bHasAskTemplateName : 1;
     213             :     bool bIgnoreHTMLComments : 1;
     214             :     bool bSkipImages : 1;
     215             : 
     216             :     virtual OUString GetTemplateName() const;
     217             : 
     218             : public:
     219             :     Reader();
     220             :     virtual ~Reader();
     221             : 
     222             :     virtual int GetReaderType();
     223           3 :     SwgReaderOption& GetReaderOpt() { return aOpt; }
     224             : 
     225             :     virtual void SetFltName( const OUString& rFltNm );
     226             : 
     227             :     // Adapt item-set of a Frm-Format to the old format.
     228             :     static void ResetFrameFormatAttrs( SfxItemSet &rFrmSet );
     229             : 
     230             :     // Adapt Frame-/Graphics-/OLE- styles to the old format
     231             :     // (without borders etc.).
     232             :     static void ResetFrameFormats( SwDoc& rDoc );
     233             : 
     234             :     // Load filter template, set it and release it again.
     235             :     SwDoc* GetTemplateDoc();
     236             :     bool SetTemplate( SwDoc& rDoc );
     237             :     void ClearTemplate();
     238             :     void SetTemplateName( const OUString& rDir );
     239             :     void MakeHTMLDummyTemplateDoc();
     240             : 
     241          16 :     bool IsReadUTF8() const { return bReadUTF8; }
     242         440 :     void SetReadUTF8( bool bSet ) { bReadUTF8 = bSet; }
     243             : 
     244        1152 :     bool IsBlockMode() const { return bBlockMode; }
     245         444 :     void SetBlockMode( bool bSet ) { bBlockMode = bSet; }
     246             : 
     247        1453 :     bool IsOrganizerMode() const { return bOrganizerMode; }
     248         448 :     void SetOrganizerMode( bool bSet ) { bOrganizerMode = bSet; }
     249             : 
     250         440 :     void SetIgnoreHTMLComments( bool bSet ) { bIgnoreHTMLComments = bSet; }
     251             : 
     252             :     virtual bool HasGlossaries() const;
     253             :     virtual bool ReadGlossaries( SwTextBlocks&, bool bSaveRelFiles ) const;
     254             : 
     255             :     // Read the sections of the document, which is equal to the medium.
     256             :     // Returns the count of it
     257             :     virtual size_t GetSectionList( SfxMedium& rMedium,
     258             :                                    std::vector<OUString*>& rStrings ) const;
     259             : 
     260         148 :     tools::SvRef<SotStorage> getSotStorageRef() { return pStg; };
     261         148 :     void setSotStorageRef(tools::SvRef<SotStorage> pStgRef) { pStg = pStgRef; };
     262             : 
     263             : private:
     264             :     virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &)=0;
     265             : 
     266             :     // Everyone who does not need the streams / storages open
     267             :     // has to override the method (W4W!!).
     268             :     virtual bool SetStrmStgPtr();
     269             : };
     270             : 
     271         118 : class AsciiReader: public Reader
     272             : {
     273             :     friend class SwReader;
     274             :     virtual sal_uLong Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) SAL_OVERRIDE;
     275             : public:
     276          59 :     AsciiReader(): Reader() {}
     277             : };
     278             : 
     279          18 : class SW_DLLPUBLIC StgReader : public Reader
     280             : {
     281             :     OUString aFltName;
     282             : 
     283             : protected:
     284             :     sal_uLong OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize );
     285             : public:
     286             :     virtual int GetReaderType() SAL_OVERRIDE;
     287         128 :     OUString GetFltName() { return aFltName; }
     288             :     virtual void SetFltName( const OUString& r ) SAL_OVERRIDE;
     289             : };
     290             : 
     291             : // The given stream has to be created dynamically and must
     292             : // be requested via Stream() before the instance is deleted!
     293             : 
     294             : class SwImpBlocks;
     295             : 
     296             : class SW_DLLPUBLIC SwTextBlocks
     297             : {
     298             :     SwImpBlocks* pImp;
     299             :     sal_uLong        nErr;
     300             : 
     301             : public:
     302             :     SwTextBlocks( const OUString& );
     303             :     ~SwTextBlocks();
     304             : 
     305             :     SwDoc* GetDoc();
     306             :     void   ClearDoc();                  // Delete Doc-contents.
     307             :     OUString GetName();
     308             :     void   SetName( const OUString& );
     309         108 :     sal_uLong GetError() const { return nErr; }
     310             : 
     311             :     OUString GetBaseURL() const;
     312             :     void   SetBaseURL( const OUString& rURL );
     313             : 
     314             :     bool   IsOld() const;
     315             :     sal_uLong  ConvertToNew();              // Convert text modules.
     316             : 
     317             :     sal_uInt16 GetCount() const;                        // Get count text modules.
     318             :     sal_uInt16 GetIndex( const OUString& ) const;       // Get index of short names.
     319             :     sal_uInt16 GetLongIndex( const OUString& ) const;   // Get index of long names.
     320             :     OUString GetShortName( sal_uInt16 ) const;          // Get short name for index.
     321             :     OUString GetLongName( sal_uInt16 ) const;           // Get long name for index.
     322             : 
     323             :     bool   Delete( sal_uInt16 );
     324             :     sal_uInt16 Rename( sal_uInt16, const OUString*, const OUString* );
     325             :     sal_uLong  CopyBlock( SwTextBlocks& rSource, OUString& rSrcShort,
     326             :                                     const OUString& rLong );
     327             : 
     328             :     bool   BeginGetDoc( sal_uInt16 );   // Read text modules.
     329             :     void   EndGetDoc();                     // Release text modules.
     330             : 
     331             :     bool   BeginPutDoc( const OUString&, const OUString& ); // Begin save.
     332             :     sal_uInt16 PutDoc();                                    // End save.
     333             : 
     334             :     sal_uInt16 PutText( const OUString&, const OUString&, const OUString& ); // Save (short name, text).
     335             : 
     336             :     bool IsOnlyTextBlock( sal_uInt16 ) const;
     337             :     bool IsOnlyTextBlock( const OUString& rShort ) const;
     338             : 
     339             :     OUString GetFileName() const;           // Filename of pImp.
     340             :     bool IsReadOnly() const;            // ReadOnly-flag of pImp.
     341             : 
     342             :     bool GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable );
     343             :     bool SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTable );
     344             : 
     345             :     bool StartPutMuchBlockEntries();
     346             :     void EndPutMuchBlockEntries();
     347             : };
     348             : 
     349             : // BEGIN source/filter/basflt/fltini.cxx
     350             : 
     351             : extern SwRead ReadAscii, /*ReadSwg, ReadSw3, */ReadHTML, ReadXML;
     352             : 
     353             : SW_DLLPUBLIC SwRead SwGetReaderXML();
     354             : 
     355             : // END source/filter/basflt/fltini.cxx
     356             : 
     357             : extern bool SetHTMLTemplate( SwDoc &rDoc ); //For templates from HTML before loading shellio.cxx.
     358             : 
     359             : // Base-class of all writers.
     360             : 
     361             : class IDocumentSettingAccess;
     362             : class IDocumentStylePoolAccess;
     363             : 
     364             : class SW_DLLPUBLIC Writer
     365             :     : public SvRefBase
     366             :     , private ::boost::noncopyable
     367             : {
     368             :     SwAsciiOptions aAscOpts;
     369             :     OUString       sBaseURL;
     370             : 
     371             :     void _AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont );
     372             :     void _AddFontItems( SfxItemPool& rPool, sal_uInt16 nWhichId );
     373             : 
     374             :     ::std::unique_ptr<Writer_Impl> m_pImpl;
     375             : 
     376             : protected:
     377             : 
     378             :     SwPaM* pOrigPam;            // Last Pam that has to be processed.
     379             :     const OUString* pOrigFileName;
     380             : 
     381             :     void ResetWriter();
     382             :     bool CopyNextPam( SwPaM ** );
     383             : 
     384             :     void PutNumFormatFontsInAttrPool();
     385             :     void PutEditEngFontsInAttrPool( bool bIncl_CJK_CTL = true );
     386             : 
     387             :     virtual sal_uLong WriteStream() = 0;
     388         119 :     void                SetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
     389             : 
     390             :     IDocumentSettingAccess* getIDocumentSettingAccess();
     391             :     const IDocumentSettingAccess* getIDocumentSettingAccess() const;
     392             : 
     393             :     IDocumentStylePoolAccess* getIDocumentStylePoolAccess();
     394             :     const IDocumentStylePoolAccess* getIDocumentStylePoolAccess() const;
     395             : 
     396             : public:
     397             :     SwDoc* pDoc;
     398             :     SwPaM* pCurPam;
     399             :     bool bWriteAll : 1;
     400             :     bool bShowProgress : 1;
     401             :     bool bWriteClipboardDoc : 1;
     402             :     bool bWriteOnlyFirstTable : 1;
     403             :     bool bASCII_ParaAsCR : 1;
     404             :     bool bASCII_ParaAsBlanc : 1;
     405             :     bool bASCII_NoLastLineEnd : 1;
     406             :     bool bUCS2_WithStartChar : 1;
     407             :     bool bExportPargraphNumbering : 1;
     408             : 
     409             :     bool bBlock : 1;
     410             :     bool bOrganizerMode : 1;
     411             : 
     412             :     Writer();
     413             :     virtual ~Writer();
     414             : 
     415             :     virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* = 0 );
     416             :             sal_uLong Write( SwPaM&, SvStream&,  const OUString* = 0 );
     417             :     virtual sal_uLong Write( SwPaM&, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const OUString* = 0, SfxMedium* = 0 );
     418             :     virtual sal_uLong Write( SwPaM&, SotStorage&, const OUString* = 0 );
     419             : 
     420             :     virtual void SetupFilterOptions(SfxMedium& rMedium);
     421             : 
     422             :     virtual bool IsStgWriter() const;
     423             : 
     424           1 :     void SetShowProgress( bool bFlag = false )  { bShowProgress = bFlag; }
     425             : 
     426             :     const OUString* GetOrigFileName() const       { return pOrigFileName; }
     427             : 
     428       43065 :     const SwAsciiOptions& GetAsciiOptions() const { return aAscOpts; }
     429       16151 :     void SetAsciiOptions( const SwAsciiOptions& rOpt ) { aAscOpts = rOpt; }
     430             : 
     431          92 :     OUString GetBaseURL() const { return sBaseURL;}
     432             : 
     433             :     // Look up next bookmark position from bookmark-table.
     434             :     sal_Int32 FindPos_Bkmk( const SwPosition& rPos ) const;
     435             :     // Build a bookmark table, which is sort by the node position. The
     436             :     // OtherPos of the bookmarks also inserted.
     437             :     void CreateBookmarkTable();
     438             :     // Search alle Bookmarks in the range and return it in the Array.
     439             :     bool GetBookmarks( const SwContentNode& rNd,
     440             :                         sal_Int32 nStt, sal_Int32 nEnd,
     441             :                         std::vector< const ::sw::mark::IMark* >& rArr );
     442             : 
     443             :     // Create new PaM at position.
     444             :     static SwPaM * NewSwPaM(SwDoc & rDoc,
     445             :                             sal_uLong const nStartIdx, sal_uLong const nEndIdx);
     446             : 
     447             :     // Stream-specific routines. Do not use in storage-writer!
     448             : 
     449             :     // Optimizing output on stream.
     450             :     static SvStream& OutLong( SvStream& rStrm, long nVal );
     451             :     static SvStream& OutULong( SvStream& rStrm, sal_uLong nVal );
     452             : 
     453             :     inline SvStream& OutLong( long nVal )       { return OutLong( Strm(), nVal ); }
     454             :     inline SvStream& OutULong( sal_uLong nVal )     { return OutULong( Strm(), nVal ); }
     455             : 
     456             :     void SetStream(SvStream *const pStream);
     457             :     SvStream& Strm();
     458             : 
     459           0 :     void SetOrganizerMode( bool bSet ) { bOrganizerMode = bSet; }
     460             : };
     461             : 
     462             : typedef tools::SvRef<Writer> WriterRef;
     463             : 
     464             : // Base class for all storage writers.
     465         103 : class SW_DLLPUBLIC StgWriter : public Writer
     466             : {
     467             : protected:
     468             :     OUString aFltName;
     469             :     tools::SvRef<SotStorage> pStg;
     470             :     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
     471             : 
     472             :     // Create error at call.
     473             :     virtual sal_uLong WriteStream() SAL_OVERRIDE;
     474             :     virtual sal_uLong WriteStorage() = 0;
     475             :     virtual sal_uLong WriteMedium( SfxMedium& ) = 0;
     476             : 
     477             :     using Writer::Write;
     478             : 
     479             : public:
     480         103 :     StgWriter() : Writer() {}
     481             : 
     482             :     virtual bool IsStgWriter() const SAL_OVERRIDE;
     483             : 
     484             :     virtual sal_uLong Write( SwPaM&, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const OUString* = 0, SfxMedium* = 0 ) SAL_OVERRIDE;
     485             :     virtual sal_uLong Write( SwPaM&, SotStorage&, const OUString* = 0 ) SAL_OVERRIDE;
     486             : 
     487         228 :     SotStorage& GetStorage() const       { return *pStg; }
     488             : };
     489             : 
     490             : // Interface class for general access on special writers.
     491             : 
     492        8195 : class SW_DLLPUBLIC SwWriter
     493             : {
     494             :     SvStream* pStrm;
     495             :     tools::SvRef<SotStorage> pStg;
     496             :     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
     497             :     SfxMedium* pMedium;
     498             : 
     499             :     SwPaM* pOutPam;
     500             :     SwCrsrShell *pShell;
     501             :     SwDoc &rDoc;
     502             : 
     503             :     bool bWriteAll;
     504             : 
     505             : public:
     506             :     sal_uLong Write( WriterRef& rxWriter, const OUString* = 0);
     507             : 
     508             :     SwWriter( SvStream&, SwCrsrShell &, bool bWriteAll = false );
     509             :     SwWriter( SvStream&, SwDoc & );
     510             :     SwWriter( SvStream&, SwPaM &, bool bWriteAll = false );
     511             : 
     512             :     SwWriter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, SwDoc& );
     513             : 
     514             :     SwWriter( SfxMedium&, SwCrsrShell &, bool bWriteAll = false );
     515             :     SwWriter( SfxMedium&, SwDoc & );
     516             : };
     517             : 
     518             : typedef Reader* (*FnGetReader)();
     519             : typedef void (*FnGetWriter)(const OUString&, const OUString& rBaseURL, WriterRef&);
     520             : sal_uLong SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, bool, const OUString& );
     521             : sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
     522             : 
     523             : struct SwReaderWriterEntry
     524             : {
     525             :     Reader* pReader;
     526             :     FnGetReader fnGetReader;
     527             :     FnGetWriter fnGetWriter;
     528             :     bool bDelReader;
     529             : 
     530         590 :     SwReaderWriterEntry( const FnGetReader fnReader, const FnGetWriter fnWriter, bool bDel )
     531         590 :         : pReader( NULL ), fnGetReader( fnReader ), fnGetWriter( fnWriter ), bDelReader( bDel )
     532         590 :     {}
     533             : 
     534             :     /// Get access to the reader.
     535             :     Reader* GetReader();
     536             : 
     537             :     /// Get access to the writer.
     538             :     void GetWriter( const OUString& rNm, const OUString& rBaseURL, WriterRef& xWrt ) const;
     539             : };
     540             : 
     541             : namespace SwReaderWriter
     542             : {
     543             :     /// Return reader based on ReaderWriterEnum.
     544             :     SW_DLLPUBLIC Reader* GetReader( ReaderWriterEnum eReader );
     545             : 
     546             :     /// Return reader based on the name.
     547             :     Reader* GetReader( const OUString& rFltName );
     548             : 
     549             :     /// Return writer based on the name.
     550             :     SW_DLLPUBLIC void GetWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xWrt );
     551             : }
     552             : 
     553             : void GetRTFWriter( const OUString&, const OUString&, WriterRef& );
     554             : void GetASCWriter( const OUString&, const OUString&, WriterRef& );
     555             : void GetHTMLWriter( const OUString&, const OUString&, WriterRef& );
     556             : void GetXMLWriter( const OUString&, const OUString&, WriterRef& );
     557             : 
     558             : #endif
     559             : 
     560             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11