LibreOffice Module oox (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
oox::core::FilterBase Class Referenceabstract

#include <filterbase.hxx>

Inheritance diagram for oox::core::FilterBase:
[legend]
Collaboration diagram for oox::core::FilterBase:
[legend]

Public Member Functions

 FilterBase (const css::uno::Reference< css::uno::XComponentContext > &rxContext)
 
virtual ~FilterBase () override
 
bool isImportFilter () const
 Returns true, if filter is an import filter. More...
 
bool isExportFilter () const
 Returns true, if filter is an export filter. More...
 
OoxmlVersion getVersion () const
 
virtual bool importDocument ()=0
 Derived classes implement import of the entire document. More...
 
virtual bool exportDocument ()=0
 Derived classes implement export of the entire document. More...
 
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext () const
 Returns the component context passed in the filter constructor (always existing). More...
 
const css::uno::Reference< css::frame::XModel > & getModel () const
 Returns the document model (always existing). More...
 
const css::uno::Reference< css::lang::XMultiServiceFactory > & getModelFactory () const
 Returns the service factory provided by the document model (always existing). More...
 
const css::uno::Reference< css::frame::XFrame > & getTargetFrame () const
 Returns the frame that will contain the document model (may be null). More...
 
const css::uno::Reference< css::task::XStatusIndicator > & getStatusIndicator () const
 Returns the status indicator (may be null). More...
 
::comphelper::SequenceAsHashMapgetFilterData () const
 Returns the FilterData. More...
 
utl::MediaDescriptorgetMediaDescriptor () const
 Returns the media descriptor. More...
 
const OUString & getFileUrl () const
 Returns the URL of the imported or exported file. More...
 
OUString getAbsoluteUrl (const OUString &rUrl) const
 Returns an absolute URL for the passed relative or absolute URL. More...
 
StorageRef const & getStorage () const
 Returns the base storage of the imported/exported file. More...
 
css::uno::Reference< css::io::XInputStream > openInputStream (const OUString &rStreamName) const
 Opens and returns the specified input stream from the base storage. More...
 
css::uno::Reference< css::io::XOutputStream > openOutputStream (const OUString &rStreamName) const
 Opens and returns the specified output stream from the base storage. More...
 
void commitStorage () const
 Commits changes to base storage (and substorages) More...
 
GraphicHelpergetGraphicHelper () const
 Returns a helper for the handling of graphics and graphic objects. More...
 
ModelObjectHelpergetModelObjectHelper () const
 Returns a helper with containers for various named drawing objects for the imported document. More...
 
ModelObjectHelpergetModelObjectHelperForModel (const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory) const
 
::oox::ole::OleObjectHelpergetOleObjectHelper () const
 Returns a helper for the handling of OLE objects. More...
 
::oox::ole::VbaProjectgetVbaProject () const
 Returns the VBA project manager. More...
 
bool importBinaryData (StreamDataSequence &orDataSeq, const OUString &rStreamName)
 Imports the raw binary data from the specified stream. More...
 
virtual sal_Bool SAL_CALL supportsService (const OUString &rServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &rArgs) override
 Receives user defined arguments. More...
 
virtual void SAL_CALL setTargetDocument (const css::uno::Reference< css::lang::XComponent > &rxDocument) override
 
virtual void SAL_CALL setSourceDocument (const css::uno::Reference< css::lang::XComponent > &rxDocument) override
 
virtual sal_Bool SAL_CALL filter (const css::uno::Sequence< css::beans::PropertyValue > &rMediaDescSeq) override
 
virtual void SAL_CALL cancel () override
 
bool exportVBA () const
 
bool isExportTemplate () const
 

Protected Member Functions

virtual css::uno::Reference< css::io::XInputStream > implGetInputStream (utl::MediaDescriptor &rMediaDesc) const
 
virtual css::uno::Reference< css::io::XStream > implGetOutputStream (utl::MediaDescriptor &rMediaDesc) const
 
virtual bool implFinalizeExport (utl::MediaDescriptor &rMediaDescriptor)
 
css::uno::Reference< css::io::XStream > const & getMainDocumentStream () const
 

Private Member Functions

void setMediaDescriptor (const css::uno::Sequence< css::beans::PropertyValue > &rMediaDescSeq)
 
virtual GraphicHelperimplCreateGraphicHelper () const
 Derived classes may create a specialized graphic helper, e.g. More...
 
virtual ::oox::ole::VbaProjectimplCreateVbaProject () const =0
 Derived classes create a VBA project manager object. More...
 
virtual StorageRef implCreateStorage (const css::uno::Reference< css::io::XInputStream > &rxInStream) const =0
 
virtual StorageRef implCreateStorage (const css::uno::Reference< css::io::XStream > &rxOutStream) const =0
 

Private Attributes

std::unique_ptr< FilterBaseImplmxImpl
 

Detailed Description

Definition at line 96 of file filterbase.hxx.

Constructor & Destructor Documentation

◆ FilterBase()

oox::core::FilterBase::FilterBase ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext)
explicit
Exceptions
css::uno::RuntimeException

Definition at line 191 of file filterbase.cxx.

◆ ~FilterBase()

oox::core::FilterBase::~FilterBase ( )
overridevirtual

Definition at line 196 of file filterbase.cxx.

Member Function Documentation

◆ cancel()

void SAL_CALL oox::core::FilterBase::cancel ( )
overridevirtual

Definition at line 503 of file filterbase.cxx.

◆ commitStorage()

void oox::core::FilterBase::commitStorage ( ) const

Commits changes to base storage (and substorages)

Definition at line 339 of file filterbase.cxx.

References mxImpl.

Referenced by oox::core::XmlFilterBase::implFinalizeExport().

◆ exportDocument()

virtual bool oox::core::FilterBase::exportDocument ( )
pure virtual

Derived classes implement export of the entire document.

Implemented in oox::ppt::PowerPointImport, oox::drawingml::ThemeFilterBase, and oox::shape::ShapeFilterBase.

References getComponentContext(), getSupportedServiceNames(), and supportsService().

Referenced by filter().

◆ exportVBA()

bool oox::core::FilterBase::exportVBA ( ) const

Definition at line 584 of file filterbase.cxx.

References mxImpl.

Referenced by oox::ppt::PowerPointImport::filter().

◆ filter()

sal_Bool SAL_CALL oox::core::FilterBase::filter ( const css::uno::Sequence< css::beans::PropertyValue > &  rMediaDescSeq)
overridevirtual

◆ getAbsoluteUrl()

OUString oox::core::FilterBase::getAbsoluteUrl ( const OUString &  rUrl) const

◆ getComponentContext()

const Reference< XComponentContext > & oox::core::FilterBase::getComponentContext ( ) const

◆ getFileUrl()

const OUString & oox::core::FilterBase::getFileUrl ( ) const

Returns the URL of the imported or exported file.

Definition at line 250 of file filterbase.cxx.

References mxImpl.

Referenced by oox::vml::ComplexShape::implConvertAndInsert(), and oox::ppt::PowerPointImport::importDocument().

◆ getFilterData()

SequenceAsHashMap & oox::core::FilterBase::getFilterData ( ) const

Returns the FilterData.

Definition at line 245 of file filterbase.cxx.

References mxImpl.

Referenced by oox::ppt::PresentationFragmentHandler::finalizeImport().

◆ getGraphicHelper()

GraphicHelper & oox::core::FilterBase::getGraphicHelper ( ) const

◆ getMainDocumentStream()

Reference< XStream > const & oox::core::FilterBase::getMainDocumentStream ( ) const
protected

Definition at line 524 of file filterbase.cxx.

References mxImpl.

Referenced by oox::core::XmlFilterBase::implFinalizeExport().

◆ getMediaDescriptor()

MediaDescriptor & oox::core::FilterBase::getMediaDescriptor ( ) const

Returns the media descriptor.

Definition at line 240 of file filterbase.cxx.

References mxImpl.

Referenced by oox::drawingml::Shape::createAndInsert(), filter(), and oox::core::XmlFilterBase::importDocumentProperties().

◆ getModel()

const Reference< XModel > & oox::core::FilterBase::getModel ( ) const

◆ getModelFactory()

const Reference< XMultiServiceFactory > & oox::core::FilterBase::getModelFactory ( ) const

Returns the service factory provided by the document model (always existing).

Definition at line 225 of file filterbase.cxx.

References mxImpl.

Referenced by oox::vml::Drawing::createAndInsertXShape(), and oox::drawingml::ChartExport::parseFormula().

◆ getModelObjectHelper()

ModelObjectHelper & oox::core::FilterBase::getModelObjectHelper ( ) const

Returns a helper with containers for various named drawing objects for the imported document.

Definition at line 353 of file filterbase.cxx.

References mxImpl.

Referenced by oox::vml::ShapeBase::convertShapeProperties(), oox::drawingml::Shape::createAndInsert(), and oox::vml::ComplexShape::implConvertAndInsert().

◆ getModelObjectHelperForModel()

ModelObjectHelper & oox::core::FilterBase::getModelObjectHelperForModel ( const css::uno::Reference< css::lang::XMultiServiceFactory > &  xFactory) const

◆ getOleObjectHelper()

OleObjectHelper & oox::core::FilterBase::getOleObjectHelper ( ) const

Returns a helper for the handling of OLE objects.

Definition at line 368 of file filterbase.cxx.

References mxImpl.

Referenced by oox::drawingml::Shape::finalizeServiceName().

◆ getStatusIndicator()

const Reference< XStatusIndicator > & oox::core::FilterBase::getStatusIndicator ( ) const

Returns the status indicator (may be null).

Definition at line 235 of file filterbase.cxx.

References mxImpl.

◆ getStorage()

StorageRef const & oox::core::FilterBase::getStorage ( ) const

Returns the base storage of the imported/exported file.

Definition at line 322 of file filterbase.cxx.

References mxImpl.

Referenced by oox::core::XmlFilterBase::addRelation().

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL oox::core::FilterBase::getSupportedServiceNames ( )
overridevirtual

Definition at line 406 of file filterbase.cxx.

◆ getTargetFrame()

const Reference< XFrame > & oox::core::FilterBase::getTargetFrame ( ) const

Returns the frame that will contain the document model (may be null).

Definition at line 230 of file filterbase.cxx.

References mxImpl.

◆ getVbaProject()

VbaProject & oox::core::FilterBase::getVbaProject ( ) const

Returns the VBA project manager.

Definition at line 375 of file filterbase.cxx.

References implCreateVbaProject(), and mxImpl.

◆ getVersion()

OoxmlVersion oox::core::FilterBase::getVersion ( ) const

◆ implCreateGraphicHelper()

GraphicHelper * oox::core::FilterBase::implCreateGraphicHelper ( ) const
privatevirtual

Derived classes may create a specialized graphic helper, e.g.

for resolving palette colors.

Reimplemented in oox::ppt::PowerPointImport, and oox::shape::ShapeFilterBase.

Definition at line 578 of file filterbase.cxx.

References mxImpl.

Referenced by getGraphicHelper().

◆ implCreateStorage() [1/2]

virtual StorageRef oox::core::FilterBase::implCreateStorage ( const css::uno::Reference< css::io::XInputStream > &  rxInStream) const
privatepure virtual

Implemented in oox::core::XmlFilterBase.

Referenced by filter().

◆ implCreateStorage() [2/2]

virtual StorageRef oox::core::FilterBase::implCreateStorage ( const css::uno::Reference< css::io::XStream > &  rxOutStream) const
privatepure virtual

Implemented in oox::core::XmlFilterBase.

◆ implCreateVbaProject()

virtual ::oox::ole::VbaProject * oox::core::FilterBase::implCreateVbaProject ( ) const
privatepure virtual

Derived classes create a VBA project manager object.

Implemented in oox::drawingml::ThemeFilterBase, oox::ppt::PowerPointImport, and oox::shape::ShapeFilterBase.

Referenced by getVbaProject().

◆ implFinalizeExport()

bool oox::core::FilterBase::implFinalizeExport ( utl::MediaDescriptor rMediaDescriptor)
protectedvirtual

Reimplemented in oox::core::XmlFilterBase.

Definition at line 519 of file filterbase.cxx.

Referenced by filter().

◆ implGetInputStream()

Reference< XInputStream > oox::core::FilterBase::implGetInputStream ( utl::MediaDescriptor rMediaDesc) const
protectedvirtual

Reimplemented in oox::core::XmlFilterBase.

Definition at line 509 of file filterbase.cxx.

References utl::MediaDescriptor::PROP_INPUTSTREAM.

Referenced by setMediaDescriptor().

◆ implGetOutputStream()

Reference< XStream > oox::core::FilterBase::implGetOutputStream ( utl::MediaDescriptor rMediaDesc) const
protectedvirtual

◆ importBinaryData()

bool oox::core::FilterBase::importBinaryData ( StreamDataSequence orDataSeq,
const OUString &  rStreamName 
)

◆ importDocument()

virtual bool oox::core::FilterBase::importDocument ( )
pure virtual

Derived classes implement import of the entire document.

Implemented in oox::drawingml::ThemeFilterBase, oox::ppt::PowerPointImport, and oox::shape::ShapeFilterBase.

Referenced by filter().

◆ initialize()

void SAL_CALL oox::core::FilterBase::initialize ( const css::uno::Sequence< css::uno::Any > &  rArgs)
overridevirtual

Receives user defined arguments.

Parameters
rArgsthe sequence of arguments passed to the filter. The implementation expects one or two arguments. The first argument shall be the com.sun.star.lang.XMultiServiceFactory interface of the global service factory. The optional second argument may contain a sequence of com.sun.star.beans.NamedValue objects. The different filter implementations may support different arguments.

Definition at line 413 of file filterbase.cxx.

References aSeq, Exception, comphelper::findValue(), and mxImpl.

◆ isExportFilter()

bool oox::core::FilterBase::isExportFilter ( ) const

Returns true, if filter is an export filter.

Definition at line 205 of file filterbase.cxx.

References mxImpl.

Referenced by oox::ppt::PowerPointImport::filter().

◆ isExportTemplate()

bool oox::core::FilterBase::isExportTemplate ( ) const

Definition at line 589 of file filterbase.cxx.

References mxImpl.

Referenced by oox::ppt::PowerPointImport::filter().

◆ isImportFilter()

bool oox::core::FilterBase::isImportFilter ( ) const

Returns true, if filter is an import filter.

Definition at line 200 of file filterbase.cxx.

References mxImpl.

◆ openInputStream()

Reference< XInputStream > oox::core::FilterBase::openInputStream ( const OUString &  rStreamName) const

Opens and returns the specified input stream from the base storage.

Parameters
rStreamNameThe name of the embedded storage stream. The name may contain slashes to open streams from embedded substorages. If base stream access has been enabled in the storage, the base stream can be accessed by passing an empty string as stream name.

Definition at line 327 of file filterbase.cxx.

References mxImpl.

Referenced by oox::vml::SimpleShape::implConvertAndInsert(), importBinaryData(), oox::core::XmlFilterBase::importCustomFragments(), oox::core::XmlFilterBase::importFragment(), lcl_GetMediaStream(), and oox::drawingml::Shape::resolveRelationshipsOfTypeFromOfficeDoc().

◆ openOutputStream()

Reference< XOutputStream > oox::core::FilterBase::openOutputStream ( const OUString &  rStreamName) const

Opens and returns the specified output stream from the base storage.

Parameters
rStreamNameThe name of the embedded storage stream. The name may contain slashes to open streams from embedded substorages. If base stream access has been enabled in the storage, the base stream can be accessed by passing an empty string as stream name.

Definition at line 334 of file filterbase.cxx.

References mxImpl.

Referenced by oox::core::XmlFilterBase::exportCustomFragments(), and oox::core::XmlFilterBase::openFragmentStream().

◆ setMediaDescriptor()

void oox::core::FilterBase::setMediaDescriptor ( const css::uno::Sequence< css::beans::PropertyValue > &  rMediaDescSeq)
private

◆ setSourceDocument()

void SAL_CALL oox::core::FilterBase::setSourceDocument ( const css::uno::Reference< css::lang::XComponent > &  rxDocument)
overridevirtual

Definition at line 456 of file filterbase.cxx.

References mxImpl.

◆ setTargetDocument()

void SAL_CALL oox::core::FilterBase::setTargetDocument ( const css::uno::Reference< css::lang::XComponent > &  rxDocument)
overridevirtual

Definition at line 448 of file filterbase.cxx.

References mxImpl.

◆ supportsService()

sal_Bool SAL_CALL oox::core::FilterBase::supportsService ( const OUString &  rServiceName)
overridevirtual

Definition at line 401 of file filterbase.cxx.

References cppu::supportsService().

Member Data Documentation

◆ mxImpl

std::unique_ptr< FilterBaseImpl > oox::core::FilterBase::mxImpl
private

The documentation for this class was generated from the following files: