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

Generated by: LCOV version 1.10