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 // for the automatic conversion (mail/news/...)
90 void ReadUserData( std::u16string_view );
91 void WriteUserData( OUString& ) const;
92
94};
95
96// Base class of possible options for a special reader.
97class Reader;
98
100{
107 css::uno::Reference<css::io::XInputStream> m_xInputStream;
108public:
111
112 bool IsFrameFormats() const { return m_bFrameFormats; }
113 void SetFrameFormats( const bool bNew) { m_bFrameFormats = bNew; }
114
115 bool IsPageDescs() const { return m_bPageDescs; }
116 void SetPageDescs( const bool bNew) { m_bPageDescs = bNew; }
117
118 bool IsTextFormats() const { return m_bTextFormats; }
119 void SetTextFormats( const bool bNew) { m_bTextFormats = bNew; }
120
121 bool IsNumRules() const { return m_bNumRules; }
122 void SetNumRules( const bool bNew) { m_bNumRules = bNew; }
123
124 bool IsMerge() const { return m_bMerge; }
125 void SetMerge( const bool bNew ) { m_bMerge = bNew; }
126
127 const SwAsciiOptions& GetASCIIOpts() const { return m_aASCIIOpts; }
128 void SetASCIIOpts( const SwAsciiOptions& rOpts ) { m_aASCIIOpts = rOpts; }
130
131 css::uno::Reference<css::io::XInputStream>& GetInputStream() { return m_xInputStream; }
132 void SetInputStream(const css::uno::Reference<css::io::XInputStream>& xInputStream)
133 {
134 m_xInputStream = xInputStream;
135 }
136
139};
140
141// Calls reader with its options, document, cursor etc.
143{
146 css::uno::Reference < css::embed::XStorage > mxStg;
147 SfxMedium* mpMedium; // Who wants to obtain a Medium (W4W).
148
150 OUString maFileName;
151 OUString msBaseURL;
153
154public:
155
156 // Initial reading. Document is created only at Read(...)
157 // or in case it is given, into that.
158 // Special case for Load with Sw3Reader.
159 SwReader( SfxMedium&, OUString aFilename, SwDoc *pDoc = nullptr );
160
161 // Read into existing document.
162 // Document and position in document are taken from SwPaM.
163 SwReader( SvStream&, OUString aFilename, const OUString& rBaseURL, SwPaM& );
164 SwReader( SfxMedium&, OUString aFilename, SwPaM& );
165 SwReader( css::uno::Reference < css::embed::XStorage > , OUString aFilename, SwPaM& );
166
167 // The only export interface is SwReader::Read(...)!!!
168 ErrCode Read( const Reader& );
169
170 // Ask for glossaries.
171 bool HasGlossaries( const Reader& );
172 bool ReadGlossaries( const Reader&, SwTextBlocks&, bool bSaveRelFiles );
173
174protected:
175 void SetBaseURL( const OUString& rURL ) { msBaseURL = rURL; }
176 void SetSkipImages( bool bSkipImages ) { mbSkipImages = bSkipImages; }
177};
178
179typedef std::unique_ptr<SwReader, o3tl::default_delete<SwReader>> SwReaderPtr;
180
181// Special Readers can be both!! (Excel, W4W, .. ).
182enum class SwReaderType {
183 NONE = 0x00,
184 Stream = 0x01,
185 Storage = 0x02
186};
187namespace o3tl {
188 template<> struct typed_flags<SwReaderType> : is_typed_flags<SwReaderType, 0x03> {};
189};
190
191extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
192extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream);
193extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream);
194extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream);
195SAL_DLLPUBLIC_EXPORT void FlushFontCache();
196
198{
199 friend class SwReader;
200 friend bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
201 friend bool TestImportRTF(SvStream &rStream);
202 friend bool TestImportHTML(SvStream &rStream);
205
209
210protected:
213 css::uno::Reference < css::embed::XStorage > m_xStorage;
214 SfxMedium* m_pMedium; // Who wants to obtain a Medium (W4W).
215
219 bool m_bReadUTF8: 1; // Interpret stream as UTF-8.
225
226 virtual OUString GetTemplateName(SwDoc& rDoc) const;
227
228public:
229 Reader();
230 virtual ~Reader();
231
232 virtual SwReaderType GetReaderType();
233 SwgReaderOption& GetReaderOpt() { return m_aOption; }
234
235 virtual void SetFltName( const OUString& rFltNm );
236
237 // Adapt item-set of a Frame-Format to the old format.
238 static void ResetFrameFormatAttrs( SfxItemSet &rFrameSet );
239
240 // Adapt Frame-/Graphics-/OLE- styles to the old format
241 // (without borders etc.).
242 static void ResetFrameFormats( SwDoc& rDoc );
243
244 // Load filter template, set it and release it again.
245 SwDoc* GetTemplateDoc(SwDoc& rDoc);
246 bool SetTemplate( SwDoc& rDoc );
247 void ClearTemplate();
248 void SetTemplateName( const OUString& rDir );
249 void MakeHTMLDummyTemplateDoc();
250
251 bool IsReadUTF8() const { return m_bReadUTF8; }
252 void SetReadUTF8( bool bSet ) { m_bReadUTF8 = bSet; }
253
254 bool IsBlockMode() const { return m_bBlockMode; }
255 void SetBlockMode( bool bSet ) { m_bBlockMode = bSet; }
256
257 bool IsOrganizerMode() const { return m_bOrganizerMode; }
258 void SetOrganizerMode( bool bSet ) { m_bOrganizerMode = bSet; }
259
260 void SetIgnoreHTMLComments( bool bSet ) { m_bIgnoreHTMLComments = bSet; }
261
262 virtual bool HasGlossaries() const;
263 virtual bool ReadGlossaries( SwTextBlocks&, bool bSaveRelFiles ) const;
264
265 // Read the sections of the document, which is equal to the medium.
266 // Returns the count of it
267 virtual size_t GetSectionList( SfxMedium& rMedium,
268 std::vector<OUString>& rStrings) const;
269
270 const tools::SvRef<SotStorage>& getSotStorageRef() const { return m_pStorage; };
271 void setSotStorageRef(const tools::SvRef<SotStorage>& pStgRef) { m_pStorage = pStgRef; };
272
273private:
274 virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &)=0;
275
276 // Everyone who does not need the streams / storages open
277 // has to override the method (W4W!!).
278 virtual bool SetStrmStgPtr();
279};
280
281class AsciiReader final : public Reader
282{
283 friend class SwReader;
284 virtual ErrCode Read( SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override;
285public:
287};
288
290{
291 OUString m_aFltName;
292
293public:
294 virtual SwReaderType GetReaderType() override;
295 const OUString& GetFltName() const { return m_aFltName; }
296 virtual void SetFltName( const OUString& r ) override;
297};
298
299// The given stream has to be created dynamically and must
300// be requested via Stream() before the instance is deleted!
301
302class SwImpBlocks;
303
305{
306 std::unique_ptr<SwImpBlocks> m_pImp;
308
309public:
310 SwTextBlocks( const OUString& );
312
313 SwDoc* GetDoc();
314 void ClearDoc(); // Delete Doc-contents.
315 OUString GetName() const;
316 void SetName( const OUString& );
317 ErrCode const & GetError() const { return m_nErr; }
318
319 OUString GetBaseURL() const;
320 void SetBaseURL( const OUString& rURL );
321
322 sal_uInt16 GetCount() const; // Get count text modules.
323 sal_uInt16 GetIndex( const OUString& ) const; // Get index of short names.
324 sal_uInt16 GetLongIndex( std::u16string_view ) const; // Get index of long names.
325 OUString GetShortName( sal_uInt16 ) const; // Get short name for index.
326 OUString GetLongName( sal_uInt16 ) const; // Get long name for index.
327
328 bool Delete( sal_uInt16 );
329 void Rename( sal_uInt16, const OUString*, const OUString* );
330 ErrCode const & CopyBlock( SwTextBlocks const & rSource, OUString& rSrcShort,
331 const OUString& rLong );
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
357
359
360// END source/filter/basflt/fltini.cxx
361
362extern 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
383protected:
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
402public:
404 SwPaM* m_pOrigPam; // Last Pam that has to be processed.
405 std::shared_ptr<SwUnoCursor> m_pCurrentPam;
406 bool m_bWriteAll : 1;
415
416 bool m_bBlock : 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 SwNodeOffset const nStartIdx, SwNodeOffset 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{
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:254
bool m_bInsertMode
Definition: shellio.hxx:217
tools::Time m_aTimeStamp
Definition: shellio.hxx:207
SvStream * m_pStream
Definition: shellio.hxx:211
bool m_bTemplateBrowseMode
Definition: shellio.hxx:218
bool m_bIgnoreHTMLComments
Definition: shellio.hxx:223
bool m_bHasAskTemplateName
Definition: shellio.hxx:222
tools::SvRef< SotStorage > m_pStorage
Definition: shellio.hxx:212
OUString m_aTemplateName
Definition: shellio.hxx:204
void setSotStorageRef(const tools::SvRef< SotStorage > &pStgRef)
Definition: shellio.hxx:271
rtl::Reference< SwDoc > mxTemplate
Definition: shellio.hxx:203
bool m_bSkipImages
Definition: shellio.hxx:224
SwgReaderOption m_aOption
Definition: shellio.hxx:216
DateTime m_aCheckDateTime
Definition: shellio.hxx:208
void SetReadUTF8(bool bSet)
Definition: shellio.hxx:252
void SetBlockMode(bool bSet)
Definition: shellio.hxx:255
void SetIgnoreHTMLComments(bool bSet)
Definition: shellio.hxx:260
bool m_bOrganizerMode
Definition: shellio.hxx:221
const tools::SvRef< SotStorage > & getSotStorageRef() const
Definition: shellio.hxx:270
SfxMedium * m_pMedium
Definition: shellio.hxx:214
bool m_bBlockMode
Definition: shellio.hxx:220
SwgReaderOption & GetReaderOpt()
Definition: shellio.hxx:233
bool IsReadUTF8() const
Definition: shellio.hxx:251
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:258
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &)=0
css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: shellio.hxx:213
Date m_aDateStamp
Definition: shellio.hxx:206
bool IsOrganizerMode() const
Definition: shellio.hxx:257
bool m_bReadUTF8
Definition: shellio.hxx:219
const OUString & GetFltName() const
Definition: shellio.hxx:295
OUString m_aFltName
Definition: shellio.hxx:291
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: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.cxx:81
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:194
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
SwPaM * mpCursor
Definition: shellio.hxx:149
bool mbSkipImages
Definition: shellio.hxx:152
bool ReadGlossaries(const Reader &, SwTextBlocks &, bool bSaveRelFiles)
Definition: shellio.cxx:665
tools::SvRef< SotStorage > mpStg
Definition: shellio.hxx:145
bool HasGlossaries(const Reader &)
Definition: shellio.cxx:650
void SetSkipImages(bool bSkipImages)
Definition: shellio.hxx:176
SvStream * mpStrm
Definition: shellio.hxx:144
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:175
css::uno::Reference< css::embed::XStorage > mxStg
Definition: shellio.hxx:146
SwReader(css::uno::Reference< css::embed::XStorage >, OUString aFilename, SwPaM &)
OUString maFileName
Definition: shellio.hxx:150
SfxMedium * mpMedium
Definition: shellio.hxx:147
OUString msBaseURL
Definition: shellio.hxx:151
ErrCode m_nErr
Definition: shellio.hxx:307
std::unique_ptr< SwImpBlocks > m_pImp
Definition: shellio.hxx:306
ErrCode const & GetError() const
Definition: shellio.hxx:317
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:122
bool IsPageDescs() const
Definition: shellio.hxx:115
css::uno::Reference< css::io::XInputStream > m_xInputStream
Definition: shellio.hxx:107
bool IsMerge() const
Definition: shellio.hxx:124
const SwAsciiOptions & GetASCIIOpts() const
Definition: shellio.hxx:127
bool IsFormatsOnly() const
Definition: shellio.hxx:110
bool IsNumRules() const
Definition: shellio.hxx:121
void ResetASCIIOpts()
Definition: shellio.hxx:129
void SetTextFormats(const bool bNew)
Definition: shellio.hxx:119
css::uno::Reference< css::io::XInputStream > & GetInputStream()
Definition: shellio.hxx:131
void SetMerge(const bool bNew)
Definition: shellio.hxx:125
void ResetAllFormatsOnly()
Definition: shellio.hxx:109
SwAsciiOptions m_aASCIIOpts
Definition: shellio.hxx:101
void SetASCIIOpts(const SwAsciiOptions &rOpts)
Definition: shellio.hxx:128
bool m_bFrameFormats
Definition: shellio.hxx:102
void SetPageDescs(const bool bNew)
Definition: shellio.hxx:116
bool IsFrameFormats() const
Definition: shellio.hxx:112
bool IsTextFormats() const
Definition: shellio.hxx:118
void SetFrameFormats(const bool bNew)
Definition: shellio.hxx:113
bool m_bTextFormats
Definition: shellio.hxx:104
void SetInputStream(const css::uno::Reference< css::io::XInputStream > &xInputStream)
Definition: shellio.hxx:132
bool m_bASCII_ParaAsCR
Definition: shellio.hxx:410
SwPaM * m_pOrigPam
Definition: shellio.hxx:404
bool m_bShowProgress
Definition: shellio.hxx:407
bool m_bWriteOnlyFirstTable
Definition: shellio.hxx:409
const OUString * GetOrigFileName() const
Definition: shellio.hxx:434
void SetAsciiOptions(const SwAsciiOptions &rOpt)
Definition: shellio.hxx:437
virtual ErrCode WriteStream()=0
SwAsciiOptions m_aAsciiOptions
Definition: shellio.hxx:372
bool m_bBlock
Definition: shellio.hxx:416
OUString m_sBaseURL
Definition: shellio.hxx:373
bool m_bUCS2_WithStartChar
Definition: shellio.hxx:413
bool m_bOrganizerMode
Definition: shellio.hxx:417
const SwAsciiOptions & GetAsciiOptions() const
Definition: shellio.hxx:436
SwDoc * m_pDoc
Definition: shellio.hxx:403
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr)
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:394
void SetShowProgress(bool bFlag)
Definition: shellio.hxx:432
Writer(Writer const &)=delete
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:405
bool m_bWriteAll
Definition: shellio.hxx:406
bool m_bExportParagraphNumbering
Definition: shellio.hxx:414
const OUString * m_pOrigFileName
Definition: shellio.hxx:385
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
Definition: writer.cxx:279
bool m_bASCII_NoLastLineEnd
Definition: shellio.hxx:412
bool m_bHideDeleteRedlines
Definition: shellio.hxx:418
Writer & operator=(Writer const &)=delete
void SetOrganizerMode(bool bSet)
Definition: shellio.hxx:467
std::unique_ptr< Writer_Impl > m_pImpl
Definition: shellio.hxx:378
bool m_bWriteClipboardDoc
Definition: shellio.hxx:408
const OUString & GetBaseURL() const
Definition: shellio.hxx:439
bool m_bASCII_ParaAsBlank
Definition: shellio.hxx:411
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
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:1659
SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream)
Definition: xmlimp.cxx:1773
Reader * ReadXML
Definition: shellio.hxx:356
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: shellio.hxx:179
Reader * ReadHTML
Definition: shellio.hxx:356
SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream)
Definition: swhtml.cxx:5596
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:524
tools::SvRef< Writer > WriterRef
Definition: shellio.hxx:470
SwReaderType
Definition: shellio.hxx:182
SW_DLLPUBLIC Reader * SwGetReaderXML()
Definition: fltini.cxx:89
SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName)
Definition: ww8par.cxx:6355
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:915
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: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