/* -*- 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 .
*/
namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::beans { struct NamedValue; } namespace com::sun::star::document { class XEmbeddedObjectResolver; } namespace com::sun::star::document { class XGraphicStorageHandler; } namespace com::sun::star::embed { class XStorage; } namespace com::sun::star::graphic { class XGraphic; } namespace com::sun::star::task { class XStatusIndicator; } namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::util { class XNumberFormatsSupplier; } namespace com::sun::star::xml::sax { class XAttributeList; } namespace com::sun::star::xml::sax { class XFastAttributeList; } namespace com::sun::star { namespace frame { class XModel; } namespace io { class XOutputStream; } namespace rdf { class XMetadatable; }
}
namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; } namespace comphelper { class AttributeList; }
namespace xmloff { class RDFaImportHelper;
} namespace xmloff::token { class FastTokenHandler;
} class EmbeddedFontsHelper; class ProgressBarHelper; class SvXMLImport_Impl; class SvXMLUnitConverter; class SvXMLNumFmtHelper; class XMLFontStylesContext; class XMLEventImportHelper; class XMLErrors; class StyleMap;
constexpr sal_Int32 LAST_NAMESPACE = 121; // last value in xmloff/xmnspe.hxx
constexpr size_t NMSP_SHIFT = 16;
constexpr sal_Int32 TOKEN_MASK = 0xffff;
constexpr sal_Int32 NMSP_MASK = 0xffff0000;
#define XML_ELEMENT( prefix, name ) ( NAMESPACE_TOKEN(XML_NAMESPACE_##prefix) | name )
// tdf#69060 & tdf#137643 import embedded fonts and activate them in a // batch in EmbeddedFontsHelper's dtor
std::unique_ptr<EmbeddedFontsHelper, o3tl::default_delete<EmbeddedFontsHelper>> mxEmbeddedFontHelper;
// Create top-level element context. // This method is called after the namespace map has been updated, but // before a context for the current element has been pushed. // This base class implementation returns a context that ignores everything. virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList );
// XServiceInfo virtual OUString SAL_CALL getImplementationName( ) final override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) final override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) final override;
// may be called by certain subclasses that handle document meta-data // override to provide customized handling of document statistics // the base class implementation initializes the progress bar and should // be called by overriding methods virtualvoid SetStatistics(const css::uno::Sequence< css::beans::NamedValue > & i_rStats);
// get import helper for text inline rtl::Reference< XMLTextImportHelper > const & GetTextImport(); bool HasTextImport() const { return mxTextImport.is(); } inline SvXMLNumFmtHelper* GetDataStylesImport();
// get import helper for shapes inline rtl::Reference< XMLShapeImportHelper > const & GetShapeImport();
// get import helper for charts inline rtl::Reference< SchXMLImportHelper > const & GetChartImport();
// get import helper for form layer inline rtl::Reference< ::xmloff::OFormLayerXMLImport > const & GetFormImport();
// get XPropertySet with import information const css::uno::Reference< css::beans::XPropertySet >& getImportInfo() const { returnmxImportInfo; }
// get import helper for events
XMLEventImportHelper& GetEventImport();
OUString GetODFVersion() const; bool IsOOoXML() const; // legacy non-ODF format? /// Determines if the document was generated by Microsoft Office. bool IsMSO() const;
/** * Record an error condition that occurred during import. The * behavior of SetError can be modified using the error flag * constants.
*/ void SetError( /// error ID, may contain an error flag
sal_Int32 nId, /// string parameters for the error message const css::uno::Sequence< OUString > & rMsgParams, /// original exception message (if applicable) const OUString& rExceptionMessage, /// error location (if applicable) const css::uno::Reference< css::xml::sax::XLocator> & rLocator );
/// set the XmlId attribute of given UNO object (for RDF metadata) void SetXmlId(css::uno::Reference<
css::uno::XInterface> const & i_xIfc,
OUString const & i_rXmlId);
/// do not dllexport this; only for advanced cases (bookmark-start)
SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper();
// #i31958# XForms helper method // (to be implemented by applications supporting XForms) virtualvoid initXForms();
/** returns the upd and build id (f.e. "680m124$Build-8964" gives rMaster = 680 and rBuild = 8964) from the metafile. this only works if the meta.xml was already imported and the import propertyset contains the string property "BuildId". If false is returned the build ids are not available (yet).
**/ bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const;
staticconst sal_uInt16 OOo_1x = 10; staticconst sal_uInt16 OOo_2x = 20; staticconst sal_uInt16 OOo_30x = 30; staticconst sal_uInt16 OOo_31x = 31; staticconst sal_uInt16 OOo_32x = 32; staticconst sal_uInt16 OOo_33x = 33; staticconst sal_uInt16 OOo_34x = 34; // for AOO, no release overlaps with OOo, so continue OOo version numbers staticconst sal_uInt16 AOO_40x = 40; // @ATTENTION: it's not usually ok to use the "4x" "wildcard" in an "==" // comparison, since that will match unreleased versions too; it is also // risky to use it in "<" comparison, because it requires checking and // possibly adapting all such uses when a new value for a more specific // version is added. staticconst sal_uInt16 AOO_4x = 41; staticconst sal_uInt16 LO_flag = 0x100; staticconst sal_uInt16 LO_3x = 30 | LO_flag; staticconst sal_uInt16 LO_41x = 41 | LO_flag; staticconst sal_uInt16 LO_42x = 42 | LO_flag; staticconst sal_uInt16 LO_43x = 43 | LO_flag; staticconst sal_uInt16 LO_44x = 44 | LO_flag; staticconst sal_uInt16 LO_5x = 50 | LO_flag; /// @ATTENTION: when adding a new value more specific than "6x", grep for /// all current uses and adapt them!!! staticconst sal_uInt16 LO_6x = 60 | LO_flag; staticconst sal_uInt16 LO_63x = 63 | LO_flag; staticconst sal_uInt16 LO_7x = 70 | LO_flag; staticconst sal_uInt16 LO_76 = 76 | LO_flag; staticconst sal_uInt16 LO_242 = 80 | LO_flag; staticconst sal_uInt16 LO_248 = 81 | LO_flag; staticconst sal_uInt16 LO_New = 100 | LO_flag; staticconst sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16;
/** depending on whether the generator version indicates LO, compare
against either the given LO or given OOo version */ bool isGeneratorVersionOlderThan(
sal_uInt16 const nOOoVersion, sal_uInt16 const nLOVersion);
/** this checks the build ID and returns
* OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter) * OOo_2x for files created with OpenOffice.org 2.x or StarOffice 8 * OOo_30x for files created with OpenOffice.org 3.0/3.0.1 or StarOffice 9/9 PU01 * OOo_31x for files created with OpenOffice.org 3.1/3.1.1 or StarOffice 9 PU02/9 PU03 * OOo_32x for files created with OpenOffice.org 3.2/3.2.1 or StarOffice 9 PU04 or Oracle Open Office 3.2.1 * OOo_33x for files created with OpenOffice.org 3.3 (and minors) or Oracle Open Office 3.3 (and minors) * OOo_34x for files created with OpenOffice.org 3.4 Beta or Oracle Open Office 3.4 Beta * ProductVersionUnknown for files not created with OpenOffice.org, StarOffice or Oracle Open Office
*/
sal_uInt16 getGeneratorVersion() const;
/** Returns true if the embedded font document URL has already been processed. Otherwise returns false and consequent calls with the same URL will return true.
*/ bool embeddedFontAlreadyProcessed( const OUString& url );
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.