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

Generated by: LCOV version 1.10