LibreOffice Module sw (master)  1
shellio.hxx
Go to the documentation of this file.
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 
24 #include <com/sun/star/uno/Reference.h>
25 #include <sot/storage.hxx>
26 #include <tools/date.hxx>
27 #include <tools/time.hxx>
28 #include <tools/datetime.hxx>
29 #include <tools/ref.hxx>
30 #include <rtl/ref.hxx>
31 #include <osl/thread.h>
32 #include <o3tl/deleter.hxx>
33 #include <o3tl/typed_flags_set.hxx>
34 #include "swdllapi.h"
35 #include "docfac.hxx"
36 #include "unocrsr.hxx"
37 
38 class SfxItemPool;
39 class SfxItemSet;
40 class SfxMedium;
41 class SvStream;
42 class SvxFontItem;
43 class SvxMacroTableDtor;
44 class SwContentNode;
45 class SwCursorShell;
46 class SwDoc;
47 class SwPaM;
48 class SwTextBlocks;
49 struct SwPosition;
50 struct Writer_Impl;
51 namespace sw::mark { class IMark; }
52 namespace com::sun::star::embed { class XStorage; }
53 
54 // Defines the count of chars at which a paragraph read via ASCII/W4W-Reader
55 // is forced to wrap. It has to be always greater than 200!!!
56 #define MAX_ASCII_PARA 10000
57 
59 {
60  OUString m_sFont;
61  rtl_TextEncoding m_eCharSet;
64  bool m_bIncludeBOM; // Whether to include a byte-order-mark in the output.
65  bool m_bIncludeHidden; // Whether to include hidden paragraphs and text.
66 
67 public:
68 
69  const OUString& GetFontName() const { return m_sFont; }
70  void SetFontName( const OUString& rFont ) { m_sFont = rFont; }
71 
72  rtl_TextEncoding GetCharSet() const { return m_eCharSet; }
73  void SetCharSet( rtl_TextEncoding nVal ) { m_eCharSet = nVal; }
74 
75  LanguageType GetLanguage() const { return m_nLanguage; }
76  void SetLanguage( LanguageType nVal ) { m_nLanguage = nVal; }
77 
78  LineEnd GetParaFlags() const { return m_eCRLF_Flag; }
79  void SetParaFlags( LineEnd eVal ) { m_eCRLF_Flag = eVal; }
80 
81  bool GetIncludeBOM() const { return m_bIncludeBOM; }
82  void SetIncludeBOM( bool bVal ) { m_bIncludeBOM = bVal; }
83 
84  bool GetIncludeHidden() const { return m_bIncludeHidden; }
85  void SetIncludeHidden( bool bVal ) { m_bIncludeHidden = bVal; }
86 
87  void Reset()
88  {
89  m_sFont.clear();
90  m_eCRLF_Flag = GetSystemLineEnd();
91  m_eCharSet = ::osl_getThreadTextEncoding();
92  m_nLanguage = LANGUAGE_SYSTEM;
93  m_bIncludeBOM = true;
94  m_bIncludeHidden = true;
95  }
96  // for the automatic conversion (mail/news/...)
97  void ReadUserData( const OUString& );
98  void WriteUserData( OUString& );
99 
101 };
102 
103 // Base class of possible options for a special reader.
104 class Reader;
105 
107 {
113  bool m_bMerge;
114  css::uno::Reference<css::io::XInputStream> m_xInputStream;
115 public:
116  void ResetAllFormatsOnly() { m_bFrameFormats = m_bPageDescs = m_bTextFormats = m_bNumRules = m_bMerge = false; }
117  bool IsFormatsOnly() const { return m_bFrameFormats || m_bPageDescs || m_bTextFormats || m_bNumRules || m_bMerge; }
118 
119  bool IsFrameFormats() const { return m_bFrameFormats; }
120  void SetFrameFormats( const bool bNew) { m_bFrameFormats = bNew; }
121 
122  bool IsPageDescs() const { return m_bPageDescs; }
123  void SetPageDescs( const bool bNew) { m_bPageDescs = bNew; }
124 
125  bool IsTextFormats() const { return m_bTextFormats; }
126  void SetTextFormats( const bool bNew) { m_bTextFormats = bNew; }
127 
128  bool IsNumRules() const { return m_bNumRules; }
129  void SetNumRules( const bool bNew) { m_bNumRules = bNew; }
130 
131  bool IsMerge() const { return m_bMerge; }
132  void SetMerge( const bool bNew ) { m_bMerge = bNew; }
133 
134  const SwAsciiOptions& GetASCIIOpts() const { return m_aASCIIOpts; }
135  void SetASCIIOpts( const SwAsciiOptions& rOpts ) { m_aASCIIOpts = rOpts; }
136  void ResetASCIIOpts() { m_aASCIIOpts.Reset(); }
137 
138  css::uno::Reference<css::io::XInputStream>& GetInputStream() { return m_xInputStream; }
139  void SetInputStream(const css::uno::Reference<css::io::XInputStream>& xInputStream)
140  {
141  m_xInputStream = xInputStream;
142  }
143 
145  { ResetAllFormatsOnly(); m_aASCIIOpts.Reset(); }
146 };
147 
148 // Calls reader with its options, document, cursor etc.
150 {
153  css::uno::Reference < css::embed::XStorage > mxStg;
154  SfxMedium* mpMedium; // Who wants to obtain a Medium (W4W).
155 
157  OUString maFileName;
158  OUString msBaseURL;
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 OUString& rFilename, SwDoc *pDoc = nullptr );
167 
168  // Read into existing document.
169  // Document and position in document are taken from SwPaM.
170  SwReader( SvStream&, const OUString& rFilename, const OUString& rBaseURL, SwPaM& );
171  SwReader( SfxMedium&, const OUString& rFilename, SwPaM& );
172  SwReader( const css::uno::Reference < css::embed::XStorage >&, const OUString& rFilename, SwPaM& );
173 
174  // The only export interface is SwReader::Read(...)!!!
175  ErrCode Read( const Reader& );
176 
177  // Ask for glossaries.
178  bool HasGlossaries( const Reader& );
179  bool ReadGlossaries( const Reader&, SwTextBlocks&, bool bSaveRelFiles );
180 
181 protected:
182  void SetBaseURL( const OUString& rURL ) { msBaseURL = rURL; }
183  void SetSkipImages( bool bSkipImages ) { mbSkipImages = bSkipImages; }
184 };
185 
186 typedef std::unique_ptr<SwReader, o3tl::default_delete<SwReader>> SwReaderPtr;
187 
188 // Special Readers can be both!! (Excel, W4W, .. ).
189 enum class SwReaderType {
190  NONE = 0x00,
191  Stream = 0x01,
192  Storage = 0x02
193 };
194 namespace o3tl {
195  template<> struct typed_flags<SwReaderType> : is_typed_flags<SwReaderType, 0x03> {};
196 };
197 
198 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
199 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream);
200 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream);
201 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream);
202 SAL_DLLPUBLIC_EXPORT void FlushFontCache();
203 
205 {
206  friend class SwReader;
207  friend bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
208  friend bool TestImportRTF(SvStream &rStream);
209  friend bool TestImportHTML(SvStream &rStream);
211  OUString m_aTemplateName;
212 
216 
217 protected:
220  css::uno::Reference < css::embed::XStorage > m_xStorage;
221  SfxMedium* m_pMedium; // Who wants to obtain a Medium (W4W).
222 
224  bool m_bInsertMode : 1;
225  bool m_bTemplateBrowseMode : 1;
226  bool m_bReadUTF8: 1; // Interpret stream as UTF-8.
227  bool m_bBlockMode: 1;
228  bool m_bOrganizerMode : 1;
229  bool m_bHasAskTemplateName : 1;
230  bool m_bIgnoreHTMLComments : 1;
231  bool m_bSkipImages : 1;
232 
233  virtual OUString GetTemplateName(SwDoc& rDoc) const;
234 
235 public:
236  Reader();
237  virtual ~Reader();
238 
239  virtual SwReaderType GetReaderType();
240  SwgReaderOption& GetReaderOpt() { return m_aOption; }
241 
242  virtual void SetFltName( const OUString& rFltNm );
243 
244  // Adapt item-set of a Frame-Format to the old format.
245  static void ResetFrameFormatAttrs( SfxItemSet &rFrameSet );
246 
247  // Adapt Frame-/Graphics-/OLE- styles to the old format
248  // (without borders etc.).
249  static void ResetFrameFormats( SwDoc& rDoc );
250 
251  // Load filter template, set it and release it again.
252  SwDoc* GetTemplateDoc(SwDoc& rDoc);
253  bool SetTemplate( SwDoc& rDoc );
254  void ClearTemplate();
255  void SetTemplateName( const OUString& rDir );
256  void MakeHTMLDummyTemplateDoc();
257 
258  bool IsReadUTF8() const { return m_bReadUTF8; }
259  void SetReadUTF8( bool bSet ) { m_bReadUTF8 = bSet; }
260 
261  bool IsBlockMode() const { return m_bBlockMode; }
262  void SetBlockMode( bool bSet ) { m_bBlockMode = bSet; }
263 
264  bool IsOrganizerMode() const { return m_bOrganizerMode; }
265  void SetOrganizerMode( bool bSet ) { m_bOrganizerMode = bSet; }
266 
267  void SetIgnoreHTMLComments( bool bSet ) { m_bIgnoreHTMLComments = bSet; }
268 
269  virtual bool HasGlossaries() const;
270  virtual bool ReadGlossaries( SwTextBlocks&, bool bSaveRelFiles ) const;
271 
272  // Read the sections of the document, which is equal to the medium.
273  // Returns the count of it
274  virtual size_t GetSectionList( SfxMedium& rMedium,
275  std::vector<OUString>& rStrings) const;
276 
277  const tools::SvRef<SotStorage>& getSotStorageRef() const { return m_pStorage; };
278  void setSotStorageRef(const tools::SvRef<SotStorage>& pStgRef) { m_pStorage = pStgRef; };
279 
280 private:
281  virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &)=0;
282 
283  // Everyone who does not need the streams / storages open
284  // has to override the method (W4W!!).
285  virtual bool SetStrmStgPtr();
286 };
287 
288 class AsciiReader final : public Reader
289 {
290  friend class SwReader;
291  virtual ErrCode Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override;
292 public:
294 };
295 
297 {
298  OUString m_aFltName;
299 
300 public:
301  virtual SwReaderType GetReaderType() override;
302  const OUString& GetFltName() const { return m_aFltName; }
303  virtual void SetFltName( const OUString& r ) override;
304 };
305 
306 // The given stream has to be created dynamically and must
307 // be requested via Stream() before the instance is deleted!
308 
309 class SwImpBlocks;
310 
312 {
313  std::unique_ptr<SwImpBlocks> m_pImp;
315 
316 public:
317  SwTextBlocks( const OUString& );
318  ~SwTextBlocks();
319 
320  SwDoc* GetDoc();
321  void ClearDoc(); // Delete Doc-contents.
322  OUString GetName() const;
323  void SetName( const OUString& );
324  ErrCode const & GetError() const { return m_nErr; }
325 
326  OUString GetBaseURL() const;
327  void SetBaseURL( const OUString& rURL );
328 
329  sal_uInt16 GetCount() const; // Get count text modules.
330  sal_uInt16 GetIndex( const OUString& ) const; // Get index of short names.
331  sal_uInt16 GetLongIndex( const OUString& ) const; // Get index of long names.
332  OUString GetShortName( sal_uInt16 ) const; // Get short name for index.
333  OUString GetLongName( sal_uInt16 ) const; // Get long name for index.
334 
335  bool Delete( sal_uInt16 );
336  void Rename( sal_uInt16, const OUString*, const OUString* );
337 
338  bool BeginGetDoc( sal_uInt16 ); // Read text modules.
339  void EndGetDoc(); // Release text modules.
340 
341  bool BeginPutDoc( const OUString&, const OUString& ); // Begin save.
342  sal_uInt16 PutDoc(); // End save.
343 
344  sal_uInt16 PutText( const OUString&, const OUString&, const OUString& ); // Save (short name, text).
345 
346  bool IsOnlyTextBlock( sal_uInt16 ) const;
347  bool IsOnlyTextBlock( const OUString& rShort ) const;
348 
349  OUString const & GetFileName() const; // Filename of pImp.
350  bool IsReadOnly() const; // ReadOnly-flag of pImp.
351 
352  bool GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTable );
353  bool SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTable );
354 
355  bool StartPutMuchBlockEntries();
356  void EndPutMuchBlockEntries();
357 };
358 
359 // BEGIN source/filter/basflt/fltini.cxx
360 
361 extern Reader *ReadAscii, *ReadHTML, *ReadXML;
362 
364 
365 // END source/filter/basflt/fltini.cxx
366 
367 extern bool SetHTMLTemplate( SwDoc &rDoc ); //For templates from HTML before loading shellio.cxx.
368 
369 // Base-class of all writers.
370 
373 
375  : public SvRefBase
376 {
378  OUString m_sBaseURL;
379 
380  void AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont );
381  void AddFontItems_( SfxItemPool& rPool, sal_uInt16 nWhichId );
382 
383  std::unique_ptr<Writer_Impl> m_pImpl;
384 
385  Writer(Writer const&) = delete;
386  Writer& operator=(Writer const&) = delete;
387 
388 protected:
389 
390  const OUString* m_pOrigFileName;
391 
392  void ResetWriter();
393  bool CopyNextPam( SwPaM ** );
394 
395  void PutNumFormatFontsInAttrPool();
396  void PutEditEngFontsInAttrPool();
397 
398  virtual ErrCode WriteStream() = 0;
399  void SetBaseURL( const OUString& rURL ) { m_sBaseURL = rURL; }
400 
401  IDocumentSettingAccess& getIDocumentSettingAccess();
402  const IDocumentSettingAccess& getIDocumentSettingAccess() const;
403 
404  IDocumentStylePoolAccess& getIDocumentStylePoolAccess();
405  const IDocumentStylePoolAccess& getIDocumentStylePoolAccess() const;
406 
407 public:
409  SwPaM* m_pOrigPam; // Last Pam that has to be processed.
410  std::shared_ptr<SwUnoCursor> m_pCurrentPam;
411  bool m_bWriteAll : 1;
412  bool m_bShowProgress : 1;
413  bool m_bWriteClipboardDoc : 1;
414  bool m_bWriteOnlyFirstTable : 1;
415  bool m_bASCII_ParaAsCR : 1;
416  bool m_bASCII_ParaAsBlank : 1;
417  bool m_bASCII_NoLastLineEnd : 1;
418  bool m_bUCS2_WithStartChar : 1;
419  bool m_bExportParagraphNumbering : 1;
420 
421  bool m_bBlock : 1;
422  bool m_bOrganizerMode : 1;
423  bool m_bHideDeleteRedlines : 1;
424 
425  Writer();
426  virtual ~Writer() override;
427 
428  virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* );
429  ErrCode Write( SwPaM&, SvStream&, const OUString* );
430  virtual ErrCode Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr );
431  virtual ErrCode Write( SwPaM&, SotStorage&, const OUString* );
432 
433  virtual void SetupFilterOptions(SfxMedium& rMedium);
434 
435  virtual bool IsStgWriter() const;
436 
437  void SetShowProgress( bool bFlag ) { m_bShowProgress = bFlag; }
438 
439  const OUString* GetOrigFileName() const { return m_pOrigFileName; }
440 
441  const SwAsciiOptions& GetAsciiOptions() const { return m_aAsciiOptions; }
442  void SetAsciiOptions( const SwAsciiOptions& rOpt ) { m_aAsciiOptions = rOpt; }
443 
444  const OUString& GetBaseURL() const { return m_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 CreateBookmarkTable();
451  // Search all Bookmarks in the range and return it in the Array.
452  bool GetBookmarks( const SwContentNode& rNd,
453  sal_Int32 nStt, sal_Int32 nEnd,
454  std::vector< const ::sw::mark::IMark* >& rArr );
455 
456  // Create new PaM at position.
457  static std::shared_ptr<SwUnoCursor> NewUnoCursor(SwDoc & rDoc,
458  sal_uLong const nStartIdx, sal_uLong const nEndIdx);
459 
460  // If applicable copy a local file into internet.
461  bool CopyLocalFileToINet( OUString& rFileNm );
462 
463  // Stream-specific routines. Do not use in storage-writer!
464 
465  // Optimizing output on stream.
466  static SvStream& OutLong( SvStream& rStrm, tools::Long nVal );
467  static SvStream& OutULong( SvStream& rStrm, sal_uLong nVal );
468 
469  void SetStream(SvStream *const pStream);
470  SvStream& Strm();
471 
472  void SetOrganizerMode( bool bSet ) { m_bOrganizerMode = bSet; }
473 };
474 
476 
477 // Base class for all storage writers.
479 {
480 protected:
482  css::uno::Reference < css::embed::XStorage > m_xStg;
483 
484  // Create error at call.
485  virtual ErrCode WriteStream() override;
486  virtual ErrCode WriteStorage() = 0;
487  virtual ErrCode WriteMedium( SfxMedium& ) = 0;
488 
489  using Writer::Write;
490 
491 public:
492  StgWriter() : Writer() {}
493 
494  virtual bool IsStgWriter() const override;
495 
496  virtual ErrCode Write( SwPaM&, const css::uno::Reference < css::embed::XStorage >&, const OUString*, SfxMedium* = nullptr ) override;
497  virtual ErrCode Write( SwPaM&, SotStorage&, const OUString* ) override;
498 
499  SotStorage& GetStorage() const { return *m_pStg; }
500 };
501 
502 // Interface class for general access on special writers.
503 
505 {
507  css::uno::Reference < css::embed::XStorage > m_xStg;
509 
513 
515 
516 public:
517  ErrCode Write( WriterRef const & rxWriter, const OUString* = nullptr);
518 
519  SwWriter( SvStream&, SwCursorShell &, bool bWriteAll = false );
520  SwWriter( SvStream&, SwDoc & );
521  SwWriter( SvStream&, SwPaM &, bool bWriteAll = false );
522 
523  SwWriter( const css::uno::Reference < css::embed::XStorage >&, SwDoc& );
524 
525  SwWriter( SfxMedium&, SwCursorShell &, bool bWriteAll );
526  SwWriter( SfxMedium&, SwDoc & );
527 };
528 
529 typedef Reader* (*FnGetReader)();
530 typedef void (*FnGetWriter)(const OUString&, const OUString& rBaseURL, WriterRef&);
531 ErrCode SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, bool, const OUString& );
533 
535 {
540 
541  SwReaderWriterEntry( const FnGetReader fnReader, const FnGetWriter fnWriter, bool bDel )
542  : pReader( nullptr ), fnGetReader( fnReader ), fnGetWriter( fnWriter ), bDelReader( bDel )
543  {}
544 
546  Reader* GetReader();
547 
549  void GetWriter( const OUString& rNm, const OUString& rBaseURL, WriterRef& xWrt ) const;
550 };
551 
552 namespace SwReaderWriter
553 {
556 
558  Reader* GetReader( const OUString& rFltName );
559 
561  SW_DLLPUBLIC void GetWriter( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xWrt );
562 }
563 
564 void GetRTFWriter( const OUString&, const OUString&, WriterRef& );
565 void GetASCWriter(const OUString&, const OUString&, WriterRef&);
566 void GetHTMLWriter( const OUString&, const OUString&, WriterRef& );
567 void GetXMLWriter( const OUString&, const OUString&, WriterRef& );
568 
569 #endif
570 
571 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ErrCode m_nErr
Definition: shellio.hxx:314
void SetShowProgress(bool bFlag)
Definition: shellio.hxx:437
rtl_TextEncoding GetCharSet() const
Definition: shellio.hxx:72
const tools::SvRef< SotStorage > & getSotStorageRef() const
Definition: shellio.hxx:277
SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName)
Definition: ww8par.cxx:6264
const OUString & GetBaseURL() const
Definition: shellio.hxx:444
bool m_bIncludeBOM
Definition: shellio.hxx:64
bool GetIncludeBOM() const
Definition: shellio.hxx:81
void ResetASCIIOpts()
Definition: shellio.hxx:136
Marks a position in the document model.
Definition: pam.hxx:35
rtl_TextEncoding m_eCharSet
Definition: shellio.hxx:61
bool IsMerge() const
Definition: shellio.hxx:131
std::unique_ptr< Writer_Impl > m_pImpl
Definition: shellio.hxx:383
bool ReadGlossaries(const Reader &, SwTextBlocks &, bool bSaveRelFiles)
Definition: shellio.cxx:657
tools::Time m_aTimeStamp
Definition: shellio.hxx:214
bool SetHTMLTemplate(SwDoc &rDoc)
Definition: shellio.cxx:907
void SetPageDescs(const bool bNew)
Definition: shellio.hxx:123
tools::SvRef< SotStorage > mpStg
Definition: shellio.hxx:152
SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream)
Definition: swparrtf.cxx:179
const OUString & GetFontName() const
Definition: shellio.hxx:69
bool IsPageDescs() const
Definition: shellio.hxx:122
css::uno::Reference< css::embed::XStorage > mxStg
Definition: shellio.hxx:153
bool IsFrameFormats() const
Definition: shellio.hxx:119
bool IsFormatsOnly() const
Definition: shellio.hxx:117
sal_uIntPtr sal_uLong
long Long
Date m_aDateStamp
Definition: shellio.hxx:213
void(* FnGetWriter)(const OUString &, const OUString &rBaseURL, WriterRef &)
Definition: shellio.hxx:530
Definition: doc.hxx:188
LanguageType GetLanguage() const
Definition: shellio.hxx:75
tools::SvRef< Writer > WriterRef
Definition: shellio.hxx:475
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:265
tools::SvRef< SotStorage > m_pStorage
Definition: shellio.hxx:219
OUString m_aFltName
Definition: shellio.hxx:298
void SetReadUTF8(bool bSet)
Definition: shellio.hxx:259
SvStream * m_pStrm
Definition: shellio.hxx:506
void SetParaFlags(LineEnd eVal)
Definition: shellio.hxx:79
ErrCode SaveOrDelMSVBAStorage(SfxObjectShell &, SotStorage &, bool, const OUString &)
Definition: fltini.cxx:716
SvStream * mpStrm
Definition: shellio.hxx:151
Reader * ReadHTML
Definition: fltini.cxx:46
OUString m_sFont
Definition: shellio.hxx:60
ErrCode const & GetError() const
Definition: shellio.hxx:324
void SetTextFormats(const bool bNew)
Definition: shellio.hxx:126
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: shellio.hxx:186
ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
Definition: fltini.cxx:728
OUString maFileName
Definition: shellio.hxx:157
void SetSkipImages(bool bSkipImages)
Definition: shellio.hxx:183
void SetLanguage(LanguageType nVal)
Definition: shellio.hxx:76
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
Reader * GetReader(const OUString &rFltName)
Return reader based on the name.
Definition: fltini.cxx:169
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:472
void SetBlockMode(bool bSet)
Definition: shellio.hxx:262
LineEnd GetSystemLineEnd()
const SwAsciiOptions & GetASCIIOpts() const
Definition: shellio.hxx:134
bool m_bIncludeHidden
Definition: shellio.hxx:65
css::uno::Reference< css::embed::XStorage > m_xStg
Definition: shellio.hxx:482
OUString msBaseURL
Definition: shellio.hxx:158
SwAsciiOptions m_aAsciiOptions
Definition: shellio.hxx:377
void GetRTFWriter(const OUString &, const OUString &, WriterRef &)
Definition: fltini.cxx:657
virtual ErrCode WriteStream()=0
SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream)
Definition: swhtml.cxx:5619
SfxMedium * mpMedium
Definition: shellio.hxx:154
const OUString & GetFltName() const
Definition: shellio.hxx:302
Reader * GetDOCXReader()
Definition: fltini.cxx:154
SwPaM * m_pOutPam
Definition: shellio.hxx:510
Reader * ReadXML
Definition: fltini.cxx:46
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:399
void GetWriter(const OUString &rNm, const OUString &rBaseURL, WriterRef &xWrt) const
Get access to the writer.
Definition: fltini.cxx:81
void SetCharSet(rtl_TextEncoding nVal)
Definition: shellio.hxx:73
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
SwPaM * m_pOrigPam
Definition: shellio.hxx:409
SwgReaderOption & GetReaderOpt()
Definition: shellio.hxx:240
Reader *(* FnGetReader)()
Definition: shellio.hxx:529
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
Definition: writer.cxx:280
SwCursorShell * m_pShell
Definition: shellio.hxx:511
css::uno::Reference< css::io::XInputStream > & GetInputStream()
Definition: shellio.hxx:138
bool m_bWriteAll
Definition: shellio.hxx:514
void SetIgnoreHTMLComments(bool bSet)
Definition: shellio.hxx:267
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &) override
Definition: parasc.cxx:81
#define LANGUAGE_SYSTEM
void GetXMLWriter(const OUString &, const OUString &, WriterRef &)
bool IsNumRules() const
Definition: shellio.hxx:128
FnGetReader fnGetReader
Definition: shellio.hxx:537
void SetIncludeHidden(bool bVal)
Definition: shellio.hxx:85
SfxMedium * m_pMedium
Definition: shellio.hxx:508
tools::SvRef< SotStorage > m_pStg
Definition: shellio.hxx:481
OUString m_aTemplateName
Definition: shellio.hxx:211
Provides access to settings of a document.
Reader * GetReader()
Get access to the reader.
Definition: fltini.cxx:69
bool IsBlockMode() const
Definition: shellio.hxx:261
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool IsTextFormats() const
Definition: shellio.hxx:125
Reader * ReadAscii
Definition: fltini.cxx:46
bool m_bTextFormats
Definition: shellio.hxx:111
SwReaderType
Definition: shellio.hxx:189
LineEnd
LineEnd m_eCRLF_Flag
Definition: shellio.hxx:63
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:182
ErrCode Read(const Reader &)
Definition: shellio.cxx:78
css::uno::Reference< css::embed::XStorage > m_xStg
Definition: shellio.hxx:507
bool IsReadUTF8() const
Definition: shellio.hxx:258
virtual void SetFltName(const OUString &rFltNm)
Definition: shellio.cxx:609
void GetASCWriter(const OUString &, const OUString &, WriterRef &)
bool GetIncludeHidden() const
Definition: shellio.hxx:84
SotStorage & GetStorage() const
Definition: shellio.hxx:499
SwgReaderOption m_aOption
Definition: shellio.hxx:223
SvRefBase & operator=(const SvRefBase &)
void ResetAllFormatsOnly()
Definition: shellio.hxx:116
bool mbSkipImages
Definition: shellio.hxx:159
SwAsciiOptions m_aASCIIOpts
Definition: shellio.hxx:108
SW_DLLPUBLIC Reader * SwGetReaderXML()
Definition: fltini.cxx:89
const OUString * GetOrigFileName() const
Definition: shellio.hxx:439
SAL_DLLPUBLIC_EXPORT void FlushFontCache()
Definition: swfntcch.cxx:67
void setSotStorageRef(const tools::SvRef< SotStorage > &pStgRef)
Definition: shellio.hxx:278
std::unique_ptr< SwImpBlocks > m_pImp
Definition: shellio.hxx:313
SfxMedium * m_pMedium
Definition: shellio.hxx:221
SvStream * m_pStream
Definition: shellio.hxx:218
css::uno::Reference< css::io::XInputStream > m_xInputStream
Definition: shellio.hxx:114
void SetIncludeBOM(bool bVal)
Definition: shellio.hxx:82
Reader * GetRtfReader()
Definition: fltini.cxx:149
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:410
rtl::Reference< SwDoc > mxTemplate
Definition: shellio.hxx:210
OUString m_sBaseURL
Definition: shellio.hxx:378
const OUString * m_pOrigFileName
Definition: shellio.hxx:390
LanguageType m_nLanguage
Definition: shellio.hxx:62
Access to the style pool.
SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream)
Definition: xmlimp.cxx:1808
css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: shellio.hxx:220
SwDoc & m_rDoc
Definition: shellio.hxx:512
void GetWriter(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Return writer based on the name.
Definition: fltini.cxx:159
LineEnd GetParaFlags() const
Definition: shellio.hxx:78
void SetASCIIOpts(const SwAsciiOptions &rOpts)
Definition: shellio.hxx:135
void SetAsciiOptions(const SwAsciiOptions &rOpt)
Definition: shellio.hxx:442
const SwAsciiOptions & GetAsciiOptions() const
Definition: shellio.hxx:441
DateTime m_aCheckDateTime
Definition: shellio.hxx:215
bool m_bFrameFormats
Definition: shellio.hxx:109
FnGetWriter fnGetWriter
Definition: shellio.hxx:538
bool IsOrganizerMode() const
Definition: shellio.hxx:264
void Reset()
Definition: shellio.hxx:87
SwReaderWriterEntry(const FnGetReader fnReader, const FnGetWriter fnWriter, bool bDel)
Definition: shellio.hxx:541
void SetFrameFormats(const bool bNew)
Definition: shellio.hxx:120
virtual bool IsStgWriter() const
Definition: fltini.cxx:188
bool HasGlossaries(const Reader &)
Definition: shellio.cxx:642
virtual SwReaderType GetReaderType()
Definition: shellio.cxx:604
void GetHTMLWriter(const OUString &, const OUString &, WriterRef &)
Definition: wrthtml.cxx:1580
void SetInputStream(const css::uno::Reference< css::io::XInputStream > &xInputStream)
Definition: shellio.hxx:139
SwDoc * m_pDoc
Definition: shellio.hxx:408
void SetMerge(const bool bNew)
Definition: shellio.hxx:132
void SetNumRules(const bool bNew)
Definition: shellio.hxx:129
void SetFontName(const OUString &rFont)
Definition: shellio.hxx:70
SwPaM * mpCursor
Definition: shellio.hxx:156
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo