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