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