19#ifndef INCLUDED_SW_INC_SHELLIO_HXX
20#define INCLUDED_SW_INC_SHELLIO_HXX
24#include <com/sun/star/uno/Reference.h>
28#include <tools/datetime.hxx>
31#include <osl/thread.h>
60#define MAX_ASCII_PARA 250000
74 void SetFontName(
const OUString& rFont ) { m_sFont = rFont; }
76 rtl_TextEncoding
GetCharSet()
const {
return m_eCharSet; }
77 void SetCharSet( rtl_TextEncoding nVal ) { m_eCharSet = nVal; }
94 void ReadUserData( std::u16string_view );
95 void WriteUserData( OUString& )
const;
136 void SetInputStream(
const css::uno::Reference<css::io::XInputStream>& xInputStream)
150 css::uno::Reference < css::embed::XStorage >
mxStg;
169 SwReader( css::uno::Reference < css::embed::XStorage > , OUString aFilename,
SwPaM& );
175 bool HasGlossaries(
const Reader& );
179 void SetBaseURL(
const OUString& rURL ) { msBaseURL = rURL; }
183typedef std::unique_ptr<SwReader, o3tl::default_delete<SwReader>>
SwReaderPtr;
230 virtual OUString GetTemplateName(
SwDoc& rDoc)
const;
239 virtual void SetFltName(
const OUString& rFltNm );
242 static void ResetFrameFormatAttrs(
SfxItemSet &rFrameSet );
246 static void ResetFrameFormats(
SwDoc& rDoc );
250 bool SetTemplate(
SwDoc& rDoc );
251 void ClearTemplate();
252 void SetTemplateName(
const OUString& rDir );
253 void MakeHTMLDummyTemplateDoc();
271 virtual size_t GetSectionList(
SfxMedium& rMedium,
272 std::vector<OUString>& rStrings)
const;
282 virtual bool SetStrmStgPtr();
300 virtual void SetFltName(
const OUString& r )
override;
320 void SetName(
const OUString& );
323 OUString GetBaseURL()
const;
324 void SetBaseURL(
const OUString& rURL );
326 sal_uInt16 GetCount()
const;
327 sal_uInt16 GetIndex(
const OUString& )
const;
328 sal_uInt16 GetLongIndex( std::u16string_view )
const;
329 OUString GetShortName( sal_uInt16 )
const;
330 OUString GetLongName( sal_uInt16 )
const;
332 bool Delete( sal_uInt16 );
333 void Rename( sal_uInt16,
const OUString*,
const OUString* );
335 const OUString& rLong );
337 bool BeginGetDoc( sal_uInt16 );
340 bool BeginPutDoc(
const OUString&,
const OUString& );
343 sal_uInt16 PutText(
const OUString&,
const OUString&,
const OUString& );
345 bool IsOnlyTextBlock( sal_uInt16 )
const;
346 bool IsOnlyTextBlock(
const OUString& rShort )
const;
348 OUString
const & GetFileName()
const;
354 bool StartPutMuchBlockEntries();
355 void EndPutMuchBlockEntries();
380 void AddFontItems_(
SfxItemPool& rPool, sal_uInt16 nWhichId );
392 bool CopyNextPam(
SwPaM ** );
394 void PutNumFormatFontsInAttrPool();
395 void PutEditEngFontsInAttrPool();
398 void SetBaseURL(
const OUString& rURL ) { m_sBaseURL = rURL; }
432 virtual void SetupFilterOptions(
SfxMedium& rMedium);
434 virtual bool IsStgWriter()
const;
446 sal_Int32 FindPos_Bkmk(
const SwPosition& rPos )
const;
449 void CreateBookmarkTable();
452 sal_Int32 nStt, sal_Int32 nEnd,
453 std::vector< const ::sw::mark::IMark* >& rArr );
456 static std::shared_ptr<SwUnoCursor> NewUnoCursor(
SwDoc & rDoc,
460 bool CopyLocalFileToINet( OUString& rFileNm );
464 void SetStream(
SvStream *
const pStream);
477 css::uno::Reference < css::embed::XStorage >
m_xStg;
480 virtual ErrCode WriteStream()
override;
489 virtual bool IsStgWriter()
const override;
502 css::uno::Reference < css::embed::XStorage >
m_xStg;
544 void GetWriter( std::u16string_view rNm,
const OUString& rBaseURL,
WriterRef& xWrt )
const;
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &) override
Provides access to settings of a document.
Access to the style pool.
bool m_bTemplateBrowseMode
bool m_bIgnoreHTMLComments
bool m_bHasAskTemplateName
tools::SvRef< SotStorage > m_pStorage
void setSotStorageRef(const tools::SvRef< SotStorage > &pStgRef)
rtl::Reference< SwDoc > mxTemplate
SwgReaderOption m_aOption
DateTime m_aCheckDateTime
void SetReadUTF8(bool bSet)
void SetBlockMode(bool bSet)
void SetIgnoreHTMLComments(bool bSet)
const tools::SvRef< SotStorage > & getSotStorageRef() const
SwgReaderOption & GetReaderOpt()
void SetOrganizerMode(bool bSet)
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &)=0
css::uno::Reference< css::embed::XStorage > m_xStorage
bool IsOrganizerMode() const
const OUString & GetFltName() const
tools::SvRef< SotStorage > m_pStg
virtual ErrCode WriteMedium(SfxMedium &)=0
SotStorage & GetStorage() const
css::uno::Reference< css::embed::XStorage > m_xStg
virtual ErrCode WriteStorage()=0
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
void SetLanguage(LanguageType nVal)
void SetFontName(const OUString &rFont)
rtl_TextEncoding GetCharSet() const
LanguageType GetLanguage() const
void SetIncludeHidden(bool bVal)
LineEnd GetParaFlags() const
void SetIncludeBOM(bool bVal)
void SetParaFlags(LineEnd eVal)
bool GetIncludeHidden() const
rtl_TextEncoding m_eCharSet
const OUString & GetFontName() const
void SetCharSet(rtl_TextEncoding nVal)
bool GetIncludeBOM() const
PaM is Point and Mark: a selection of the document model.
bool ReadGlossaries(const Reader &, SwTextBlocks &, bool bSaveRelFiles)
tools::SvRef< SotStorage > mpStg
bool HasGlossaries(const Reader &)
void SetSkipImages(bool bSkipImages)
void SetBaseURL(const OUString &rURL)
css::uno::Reference< css::embed::XStorage > mxStg
SwReader(css::uno::Reference< css::embed::XStorage >, OUString aFilename, SwPaM &)
std::unique_ptr< SwImpBlocks > m_pImp
ErrCode const & GetError() const
SwWriter(css::uno::Reference< css::embed::XStorage >, SwDoc &)
css::uno::Reference< css::embed::XStorage > m_xStg
void SetNumRules(const bool bNew)
css::uno::Reference< css::io::XInputStream > m_xInputStream
const SwAsciiOptions & GetASCIIOpts() const
bool IsFormatsOnly() const
void SetTextFormats(const bool bNew)
css::uno::Reference< css::io::XInputStream > & GetInputStream()
void SetMerge(const bool bNew)
void ResetAllFormatsOnly()
SwAsciiOptions m_aASCIIOpts
void SetASCIIOpts(const SwAsciiOptions &rOpts)
void SetPageDescs(const bool bNew)
bool IsFrameFormats() const
bool IsTextFormats() const
void SetFrameFormats(const bool bNew)
void SetInputStream(const css::uno::Reference< css::io::XInputStream > &xInputStream)
bool m_bWriteOnlyFirstTable
const OUString * GetOrigFileName() const
void SetAsciiOptions(const SwAsciiOptions &rOpt)
virtual ErrCode WriteStream()=0
SwAsciiOptions m_aAsciiOptions
bool m_bUCS2_WithStartChar
const SwAsciiOptions & GetAsciiOptions() const
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr)
void SetBaseURL(const OUString &rURL)
void SetShowProgress(bool bFlag)
Writer(Writer const &)=delete
std::shared_ptr< SwUnoCursor > m_pCurrentPam
bool m_bExportParagraphNumbering
const OUString * m_pOrigFileName
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *)
bool m_bASCII_NoLastLineEnd
bool m_bHideDeleteRedlines
Writer & operator=(Writer const &)=delete
void SetOrganizerMode(bool bSet)
std::unique_ptr< Writer_Impl > m_pImpl
bool m_bWriteClipboardDoc
const OUString & GetBaseURL() const
bool m_bASCII_ParaAsBlank
virtual OUString GetName() const override
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
void GetWriter(std::u16string_view rFltName, const OUString &rBaseURL, WriterRef &xRet)
Return writer based on the name.
Reader * GetReader(const OUString &rFltName)
Return reader based on the name.
void GetRTFWriter(std::u16string_view, const OUString &, WriterRef &)
SAL_DLLPUBLIC_EXPORT void FlushFontCache()
SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream)
void GetHTMLWriter(std::u16string_view, const OUString &, WriterRef &)
SAL_DLLPUBLIC_EXPORT bool TestImportDOCX(SvStream &rStream)
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream)
ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
void GetASCWriter(std::u16string_view, const OUString &, WriterRef &)
Reader *(* FnGetReader)()
tools::SvRef< Writer > WriterRef
SW_DLLPUBLIC Reader * SwGetReaderXML()
SAL_DLLPUBLIC_EXPORT bool TestImportDOC(SvStream &rStream, const OUString &rFltName)
void(* FnGetWriter)(std::u16string_view, const OUString &rBaseURL, WriterRef &)
void GetXMLWriter(std::u16string_view, const OUString &, WriterRef &)
bool SetHTMLTemplate(SwDoc &rDoc)
ErrCode SaveOrDelMSVBAStorage(SfxObjectShell &, SotStorage &, bool, const OUString &)
Marks a position in the document model.
Reader * GetReader()
Get access to the reader.
SwReaderWriterEntry(const FnGetReader fnReader, const FnGetWriter fnWriter, bool bDel)
void GetWriter(std::u16string_view rNm, const OUString &rBaseURL, WriterRef &xWrt) const
Get access to the writer.