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#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
67public:
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( std::u16string_view );
98 void WriteUserData( OUString& ) const;
99
101};
102
103// Base class of possible options for a special reader.
104class Reader;
105
107{
114 css::uno::Reference<css::io::XInputStream> m_xInputStream;
115public:
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; }
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
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
161public:
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
181protected:
182 void SetBaseURL( const OUString& rURL ) { msBaseURL = rURL; }
183 void SetSkipImages( bool bSkipImages ) { mbSkipImages = bSkipImages; }
184};
185
186typedef std::unique_ptr<SwReader, o3tl::default_delete<SwReader>> SwReaderPtr;
187
188// Special Readers can be both!! (Excel, W4W, .. ).
189enum class SwReaderType {
190 NONE = 0x00,
191 Stream = 0x01,
192 Storage = 0x02
193};
194namespace o3tl {
195 template<> struct typed_flags<SwReaderType> : is_typed_flags<SwReaderType, 0x03> {};
196};
197
198extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
199extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream);
200extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream);
201extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream);
202SAL_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);
212
216
217protected:
220 css::uno::Reference < css::embed::XStorage > m_xStorage;
221 SfxMedium* m_pMedium; // Who wants to obtain a Medium (W4W).
222
226 bool m_bReadUTF8: 1; // Interpret stream as UTF-8.
232
233 virtual OUString GetTemplateName(SwDoc& rDoc) const;
234
235public:
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
280private:
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
288class AsciiReader final : public Reader
289{
290 friend class SwReader;
291 virtual ErrCode Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override;
292public:
294};
295
297{
298 OUString m_aFltName;
299
300public:
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
309class SwImpBlocks;
310
312{
313 std::unique_ptr<SwImpBlocks> m_pImp;
315
316public:
317 SwTextBlocks( const OUString& );
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
362
364
365// END source/filter/basflt/fltini.cxx
366
367extern 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
388protected:
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
407public:
409 SwPaM* m_pOrigPam; // Last Pam that has to be processed.
410 std::shared_ptr<SwUnoCursor> m_pCurrentPam;
411 bool m_bWriteAll : 1;
420
421 bool m_bBlock : 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 SwNodeOffset const nStartIdx, SwNodeOffset 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{
480protected:
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;
488
489 using Writer::Write;
490
491public:
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
516public:
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
529typedef Reader* (*FnGetReader)();
530typedef void (*FnGetWriter)(std::u16string_view, const OUString& rBaseURL, WriterRef&);
531ErrCode 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( std::u16string_view rNm, const OUString& rBaseURL, WriterRef& xWrt ) const;
550};
551
552namespace SwReaderWriter
553{
556
558 Reader* GetReader( const OUString& rFltName );
559
561 SW_DLLPUBLIC void GetWriter( std::u16string_view rFltName, const OUString& rBaseURL, WriterRef& xWrt );
562}
563
564void GetRTFWriter( std::u16string_view, const OUString&, WriterRef& );
565void GetASCWriter( std::u16string_view, const OUString&, WriterRef&);
566void GetHTMLWriter( std::u16string_view, const OUString&, WriterRef& );
567void GetXMLWriter( std::u16string_view, const OUString&, WriterRef& );
568
569#endif
570
571/* 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:261
bool m_bInsertMode
Definition: shellio.hxx:224
tools::Time m_aTimeStamp
Definition: shellio.hxx:214
SvStream * m_pStream
Definition: shellio.hxx:218
bool m_bTemplateBrowseMode
Definition: shellio.hxx:225
bool m_bIgnoreHTMLComments
Definition: shellio.hxx:230
bool m_bHasAskTemplateName
Definition: shellio.hxx:229
tools::SvRef< SotStorage > m_pStorage
Definition: shellio.hxx:219
OUString m_aTemplateName
Definition: shellio.hxx:211
void setSotStorageRef(const tools::SvRef< SotStorage > &pStgRef)
Definition: shellio.hxx:278
rtl::Reference< SwDoc > mxTemplate
Definition: shellio.hxx:210
bool m_bSkipImages
Definition: shellio.hxx:231
SwgReaderOption m_aOption
Definition: shellio.hxx:223
DateTime m_aCheckDateTime
Definition: shellio.hxx:215
void SetReadUTF8(bool bSet)
Definition: shellio.hxx:259
void SetBlockMode(bool bSet)
Definition: shellio.hxx:262
void SetIgnoreHTMLComments(bool bSet)
Definition: shellio.hxx:267
bool m_bOrganizerMode
Definition: shellio.hxx:228
const tools::SvRef< SotStorage > & getSotStorageRef() const
Definition: shellio.hxx:277
SfxMedium * m_pMedium
Definition: shellio.hxx:221
bool m_bBlockMode
Definition: shellio.hxx:227
SwgReaderOption & GetReaderOpt()
Definition: shellio.hxx:240
bool IsReadUTF8() const
Definition: shellio.hxx:258
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:265
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &)=0
css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: shellio.hxx:220
Date m_aDateStamp
Definition: shellio.hxx:213
bool IsOrganizerMode() const
Definition: shellio.hxx:264
bool m_bReadUTF8
Definition: shellio.hxx:226
const OUString & GetFltName() const
Definition: shellio.hxx:302
OUString m_aFltName
Definition: shellio.hxx:298
tools::SvRef< SotStorage > m_pStg
Definition: shellio.hxx:481
virtual ErrCode WriteMedium(SfxMedium &)=0
SotStorage & GetStorage() const
Definition: shellio.hxx:499
css::uno::Reference< css::embed::XStorage > m_xStg
Definition: shellio.hxx:482
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:65
void SetLanguage(LanguageType nVal)
Definition: shellio.hxx:76
void SetFontName(const OUString &rFont)
Definition: shellio.hxx:70
OUString m_sFont
Definition: shellio.hxx:60
LanguageType m_nLanguage
Definition: shellio.hxx:62
rtl_TextEncoding GetCharSet() const
Definition: shellio.hxx:72
LanguageType GetLanguage() const
Definition: shellio.hxx:75
void SetIncludeHidden(bool bVal)
Definition: shellio.hxx:85
LineEnd GetParaFlags() const
Definition: shellio.hxx:78
void SetIncludeBOM(bool bVal)
Definition: shellio.hxx:82
void SetParaFlags(LineEnd eVal)
Definition: shellio.hxx:79
void Reset()
Definition: shellio.hxx:87
bool GetIncludeHidden() const
Definition: shellio.hxx:84
rtl_TextEncoding m_eCharSet
Definition: shellio.hxx:61
const OUString & GetFontName() const
Definition: shellio.hxx:69
void SetCharSet(rtl_TextEncoding nVal)
Definition: shellio.hxx:73
bool GetIncludeBOM() const
Definition: shellio.hxx:81
LineEnd m_eCRLF_Flag
Definition: shellio.hxx:63
bool m_bIncludeBOM
Definition: shellio.hxx:64
Definition: doc.hxx:188
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:138
SwPaM * mpCursor
Definition: shellio.hxx:156
bool mbSkipImages
Definition: shellio.hxx:159
bool ReadGlossaries(const Reader &, SwTextBlocks &, bool bSaveRelFiles)
Definition: shellio.cxx:657
tools::SvRef< SotStorage > mpStg
Definition: shellio.hxx:152
bool HasGlossaries(const Reader &)
Definition: shellio.cxx:642
void SetSkipImages(bool bSkipImages)
Definition: shellio.hxx:183
SvStream * mpStrm
Definition: shellio.hxx:151
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:182
css::uno::Reference< css::embed::XStorage > mxStg
Definition: shellio.hxx:153
SwReader(const css::uno::Reference< css::embed::XStorage > &, const OUString &rFilename, SwPaM &)
OUString maFileName
Definition: shellio.hxx:157
SfxMedium * mpMedium
Definition: shellio.hxx:154
OUString msBaseURL
Definition: shellio.hxx:158
ErrCode m_nErr
Definition: shellio.hxx:314
std::unique_ptr< SwImpBlocks > m_pImp
Definition: shellio.hxx:313
ErrCode const & GetError() const
Definition: shellio.hxx:324
SvStream * m_pStrm
Definition: shellio.hxx:506
SfxMedium * m_pMedium
Definition: shellio.hxx:508
SwDoc & m_rDoc
Definition: shellio.hxx:512
bool m_bWriteAll
Definition: shellio.hxx:514
SwPaM * m_pOutPam
Definition: shellio.hxx:510
SwWriter(const css::uno::Reference< css::embed::XStorage > &, SwDoc &)
SwCursorShell * m_pShell
Definition: shellio.hxx:511
css::uno::Reference< css::embed::XStorage > m_xStg
Definition: shellio.hxx:507
void SetNumRules(const bool bNew)
Definition: shellio.hxx:129
bool IsPageDescs() const
Definition: shellio.hxx:122
css::uno::Reference< css::io::XInputStream > m_xInputStream
Definition: shellio.hxx:114
bool IsMerge() const
Definition: shellio.hxx:131
const SwAsciiOptions & GetASCIIOpts() const
Definition: shellio.hxx:134
bool IsFormatsOnly() const
Definition: shellio.hxx:117
bool IsNumRules() const
Definition: shellio.hxx:128
void ResetASCIIOpts()
Definition: shellio.hxx:136
void SetTextFormats(const bool bNew)
Definition: shellio.hxx:126
css::uno::Reference< css::io::XInputStream > & GetInputStream()
Definition: shellio.hxx:138
void SetMerge(const bool bNew)
Definition: shellio.hxx:132
void ResetAllFormatsOnly()
Definition: shellio.hxx:116
SwAsciiOptions m_aASCIIOpts
Definition: shellio.hxx:108
void SetASCIIOpts(const SwAsciiOptions &rOpts)
Definition: shellio.hxx:135
bool m_bFrameFormats
Definition: shellio.hxx:109
void SetPageDescs(const bool bNew)
Definition: shellio.hxx:123
bool IsFrameFormats() const
Definition: shellio.hxx:119
bool IsTextFormats() const
Definition: shellio.hxx:125
void SetFrameFormats(const bool bNew)
Definition: shellio.hxx:120
bool m_bTextFormats
Definition: shellio.hxx:111
void SetInputStream(const css::uno::Reference< css::io::XInputStream > &xInputStream)
Definition: shellio.hxx:139
bool m_bASCII_ParaAsCR
Definition: shellio.hxx:415
SwPaM * m_pOrigPam
Definition: shellio.hxx:409
bool m_bShowProgress
Definition: shellio.hxx:412
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:414
const OUString * GetOrigFileName() const
Definition: shellio.hxx:439
void SetAsciiOptions(const SwAsciiOptions &rOpt)
Definition: shellio.hxx:442
virtual ErrCode WriteStream()=0
SwAsciiOptions m_aAsciiOptions
Definition: shellio.hxx:377
bool m_bBlock
Definition: shellio.hxx:421
OUString m_sBaseURL
Definition: shellio.hxx:378
bool m_bUCS2_WithStartChar
Definition: shellio.hxx:418
bool m_bOrganizerMode
Definition: shellio.hxx:422
const SwAsciiOptions & GetAsciiOptions() const
Definition: shellio.hxx:441
SwDoc * m_pDoc
Definition: shellio.hxx:408
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr)
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:399
void SetShowProgress(bool bFlag)
Definition: shellio.hxx:437
Writer(Writer const &)=delete
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:410
bool m_bWriteAll
Definition: shellio.hxx:411
bool m_bExportParagraphNumbering
Definition: shellio.hxx:419
const OUString * m_pOrigFileName
Definition: shellio.hxx:390
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
Definition: writer.cxx:280
bool m_bASCII_NoLastLineEnd
Definition: shellio.hxx:417
bool m_bHideDeleteRedlines
Definition: shellio.hxx:423
Writer & operator=(Writer const &)=delete
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:472
std::unique_ptr< Writer_Impl > m_pImpl
Definition: shellio.hxx:383
bool m_bWriteClipboardDoc
Definition: shellio.hxx:413
const OUString & GetBaseURL() const
Definition: shellio.hxx:444
bool m_bASCII_ParaAsBlank
Definition: shellio.hxx:416
virtual OUString GetName() const override
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
#define LANGUAGE_SYSTEM
LineEnd
LineEnd GetSystemLineEnd()
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
long Long
void GetRTFWriter(std::u16string_view, const OUString &, WriterRef &)
Definition: fltini.cxx:656
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:1641
SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream)
Definition: xmlimp.cxx:1766
Reader * ReadXML
Definition: shellio.hxx:361
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: shellio.hxx:186
Reader * ReadHTML
Definition: shellio.hxx:361
SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream)
Definition: swhtml.cxx:5592
ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
Definition: fltini.cxx:727
void GetASCWriter(std::u16string_view, const OUString &, WriterRef &)
Definition: wrtasc.cxx:228
Reader *(* FnGetReader)()
Definition: shellio.hxx:529
tools::SvRef< Writer > WriterRef
Definition: shellio.hxx:475
SwReaderType
Definition: shellio.hxx:189
SW_DLLPUBLIC Reader * SwGetReaderXML()
Definition: fltini.cxx:89
SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName)
Definition: ww8par.cxx:6325
void(* FnGetWriter)(std::u16string_view, const OUString &rBaseURL, WriterRef &)
Definition: shellio.hxx:530
void GetXMLWriter(std::u16string_view, const OUString &, WriterRef &)
Definition: wrtxml.cxx:580
bool SetHTMLTemplate(SwDoc &rDoc)
Definition: shellio.cxx:907
ErrCode SaveOrDelMSVBAStorage(SfxObjectShell &, SotStorage &, bool, const OUString &)
Definition: fltini.cxx:715
Reader * ReadAscii
Definition: fltini.cxx:46
sal_uIntPtr sal_uLong
Marks a position in the document model.
Definition: pam.hxx:37
FnGetReader fnGetReader
Definition: shellio.hxx:537
Reader * GetReader()
Get access to the reader.
Definition: fltini.cxx:69
SwReaderWriterEntry(const FnGetReader fnReader, const FnGetWriter fnWriter, bool bDel)
Definition: shellio.hxx:541
FnGetWriter fnGetWriter
Definition: shellio.hxx:538
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