20#ifndef INCLUDED_OOX_CORE_XMLFILTERBASE_HXX
21#define INCLUDED_OOX_CORE_XMLFILTERBASE_HXX
27#include <com/sun/star/uno/Reference.hxx>
32#include <rtl/ustring.hxx>
36 namespace document {
class XDocumentProperties; }
37 namespace io {
class XInputStream; }
38 namespace io {
class XOutputStream; }
39 namespace io {
class XStream; }
40 namespace text {
class XText; }
41 namespace text {
class XTextCursor; }
42 namespace text {
class XTextField; }
43 namespace uno {
class XComponentContext; }
44 namespace xml::dom {
class XDocument; }
45 namespace xml::sax {
class XFastSAXSerializable; }
49 namespace drawingml {
class Theme; }
50 namespace drawingml::chart {
class ChartConverter; }
51 namespace drawingml::table {
55 namespace vml {
class Drawing; }
58namespace rtl {
template <
class reference_type>
class Reference; }
61 class FastSerializerHelper;
66namespace utl {
class MediaDescriptor; }
78struct XmlFilterBaseImpl;
81 = std::map<std::shared_ptr<drawingml::Shape>, css::uno::Reference<css::drawing::XShape>>;
89 const css::uno::Reference< css::uno::XComponentContext >& rxContext );
97 virtual std::shared_ptr<::oox::drawingml::Theme> getCurrentThemePtr()
const;
113 OUString getFragmentPathFromFirstTypeFromOfficeDoc( std::u16string_view rPart );
130 css::uno::Reference< css::xml::dom::XDocument>
importFragment(
const OUString& rFragmentPath );
144 const css::uno::Reference< css::xml::sax::XFastSAXSerializable >& rxSerializer );
150 RelationsRef importRelations(
const OUString& rFragmentPath );
162 OUString addRelation(
const OUString& rType, std::u16string_view rTarget );
177 OUString
addRelation(
const css::uno::Reference< css::io::XOutputStream >& rOutputStream,
const OUString& rType, std::u16string_view rTarget,
bool bExternal =
false );
193 css::uno::Reference< css::io::XOutputStream >
195 const OUString& rStreamName,
196 const OUString& rMediaType );
214 openFragmentStreamWithSerializer(
215 const OUString& rStreamName,
216 const OUString& rMediaType );
232 void exportDocumentProperties(
const css::uno::Reference< css::document::XDocumentProperties >& xProperties,
bool bSecurityOptOpenReadOnly );
235 void exportCustomFragments();
238 void importDocumentProperties();
240 static void putPropertiesToDocumentGrabBag(
const css::uno::Reference<css::lang::XComponent>& xDstDoc,
245 bool isMSO2007Document()
const;
246 bool isMSODocument()
const;
250 void setMissingExtDrawing();
255 void checkDocumentProperties(
256 const css::uno::Reference<css::document::XDocumentProperties>& xDocProps);
258 OUString getNamespaceURL(sal_Int32 nNSID)
const;
261 virtual css::uno::Reference< css::io::XInputStream >
264 virtual css::uno::Reference< css::io::XStream >
271 const css::uno::Reference< css::io::XInputStream >& rxInStream )
const override;
273 const css::uno::Reference< css::io::XStream >& rxOutStream )
const override;
275 void importCustomFragments(css::uno::Reference<css::embed::XStorage>
const & xDocumentStorage);
278 ::std::unique_ptr< XmlFilterBaseImpl >
mxImpl;
Wrapper for a fast SAX parser that works on automatically generated OOXML token and namespace identif...
virtual ::oox::vml::Drawing * getVmlDrawing()=0
Has to be implemented by each filter to return the collection of VML shapes.
sal_Int32 GetUniqueId()
Returns new unique ID for exported document.
virtual ::oox::drawingml::table::TableStyleListPtr getTableStyles()=0
Has to be implemented by each filter to return the table style list.
virtual ::oox::drawingml::chart::ChartConverter * getChartConverter()=0
Has to be implemented by each filter, returns a filter-specific chart converter object,...
void SetMaxDocId(sal_Int32 maxDocId)
bool importFragment(const ::rtl::Reference< FragmentHandler > &rxHandler, const css::uno::Reference< css::xml::sax::XFastSAXSerializable > &rxSerializer)
Imports a fragment from an xml::dom::XDocument using the passed fragment handler.
virtual StorageRef implCreateStorage(const css::uno::Reference< css::io::XStream > &rxOutStream) const override
OUString addRelation(const css::uno::Reference< css::io::XOutputStream > &rOutputStream, const OUString &rType, std::u16string_view rTarget, bool bExternal=false)
Adds new relation to part's relations.
::std::unique_ptr< XmlFilterBaseImpl > mxImpl
virtual void useInternalChartDataTable(bool)
Helper to switch chart data table - specifically for xlsx imports.
virtual StorageRef implCreateStorage(const css::uno::Reference< css::io::XInputStream > &rxInStream) const override
virtual const ::oox::drawingml::Theme * getCurrentTheme() const =0
Has to be implemented by each filter, returns the current theme.
std::shared_ptr< Relations > RelationsRef
std::map< std::shared_ptr< drawingml::Shape >, css::uno::Reference< css::drawing::XShape > > ShapePairs
std::map< OUString, ShapePairs > NamedShapePairs
std::shared_ptr< TableStyleList > TableStyleListPtr
static void importFragment(core::XmlFilterBase &rFilter, const uno::Reference< xml::dom::XDocument > &rXDom, const OUString &rDocName, const DiagramPtr &pDiagram, const rtl::Reference< core::FragmentHandler > &rxHandler)
std::shared_ptr< StorageBase > StorageRef
std::shared_ptr< FastSerializerHelper > FSHelperPtr