/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #ifndef INCLUDED_SW_INC_SHELLIO_HXX #define INCLUDED_SW_INC_SHELLIO_HXX
class SfxItemPool; class SfxItemSet; class SfxMedium; class SvStream; class SvxFontItem; class SvxMacroTableDtor; class SwContentNode; class SwCursorShell; class SwDoc; class SwPaM; class SwTextBlocks; struct SwPosition; struct Writer_Impl; namespace sw::mark { class MarkBase; } namespace com::sun::star::embed { class XStorage; }
// Defines the count of chars at which a paragraph read via ASCII/W4W-Reader // is forced to wrap. It has to be always greater than 200!!! // Note: since version 4.3, maximum character count changed to 4 GiB from 64 KiB // in a paragraph, but because of the other limitations, we set a lower wrap value // to get a working text editor e.g. without freezing and crash during loading of // a 50 MB text line, or unusably slow editing of a 5 MB text line. #define MAX_ASCII_PARA 250000
class SW_DLLPUBLIC SwAsciiOptions
{
OUString m_sFont;
rtl_TextEncoding m_eCharSet;
LanguageType m_nLanguage;
LineEnd m_eCRLF_Flag; bool m_bIncludeBOM; // Whether to include a byte-order-mark in the output. bool m_bIncludeHidden; // Whether to include hidden paragraphs and text.
// Calls reader with its options, document, cursor etc. class SW_DLLPUBLIC SwReader: public SwDocFac
{
SvStream* mpStrm;
rtl::Reference<SotStorage> mpStg;
css::uno::Reference < css::embed::XStorage > mxStg;
SfxMedium* mpMedium; // Who wants to obtain a Medium (W4W).
// Initial reading. Document is created only at Read(...) // or in case it is given, into that. // Special case for Load with Sw3Reader.
SwReader( SfxMedium&, OUString aFilename, SwDoc *pDoc = nullptr );
// Read into existing document. // Document and position in document are taken from SwPaM.
SwReader( SvStream&, OUString aFilename, const OUString& rBaseURL, SwPaM& );
SwReader( SfxMedium&, OUString aFilename, SwPaM& );
SwReader( css::uno::Reference < css::embed::XStorage > , OUString aFilename, SwPaM& );
// The only export interface is SwReader::Read(...)!!!
ErrCodeMsg Read( const Reader& );
Date m_aDateStamp;
tools::Time m_aTimeStamp;
DateTime m_aCheckDateTime;
protected:
SvStream* m_pStream;
rtl::Reference<SotStorage> m_pStorage;
css::uno::Reference < css::embed::XStorage > m_xStorage;
SfxMedium* m_pMedium; // Who wants to obtain a Medium (W4W).
// Read the sections of the document, which is equal to the medium. // Returns the count of it virtual size_t GetSectionList( SfxMedium& rMedium,
std::vector<OUString>& rStrings) const;
// The given stream has to be created dynamically and must // be requested via Stream() before the instance is deleted!
class SwImpBlocks;
/// Used for autotext handling. The list of autotexts get imported to a temporary document, and then /// this class provides the actual glossary document which is the final target for autotext. class SW_DLLPUBLIC SwTextBlocks
{
std::unique_ptr<SwImpBlocks> m_pImp;
ErrCode m_nErr;
sal_uInt16 GetCount() const; // Get count text modules.
sal_uInt16 GetIndex( const OUString& ) const; // Get index of short names.
sal_uInt16 GetLongIndex( std::u16string_view ) const; // Get index of long names. const OUString & GetShortName( sal_uInt16 ) const; // Get short name for index. const OUString & GetLongName( sal_uInt16 ) const; // Get long name for index.
// Look up next bookmark position from bookmark-table.
sal_Int32 FindPos_Bkmk( const SwPosition& rPos ) const; // Build a bookmark table, which is sort by the node position. The // OtherPos of the bookmarks also inserted. void CreateBookmarkTable(); // Search all Bookmarks in the range and return it in the Array. bool GetBookmarks( const SwContentNode& rNd,
sal_Int32 nStt, sal_Int32 nEnd,
std::vector< const ::sw::mark::MarkBase* >& rArr );
// Create new PaM at position. static std::shared_ptr<SwUnoCursor> NewUnoCursor(SwDoc & rDoc,
SwNodeOffset const nStartIdx, SwNodeOffset const nEndIdx);
// If applicable copy a local file into internet. bool CopyLocalFileToINet( OUString& rFileNm );
// Stream-specific routines. Do not use in storage-writer!
// Base class for all storage writers. class SW_DLLPUBLIC StgWriter : public Writer
{ protected:
rtl::Reference<SotStorage> m_pStg;
css::uno::Reference < css::embed::XStorage > m_xStg;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.