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