| /************************************************************** |
| * |
| * 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 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| * |
| *************************************************************/ |
| |
| |
| |
| #include <osl/diagnose.h> |
| |
| #include "oox/drawingml/diagram/diagramfragmenthandler.hxx" |
| #include "oox/drawingml/diagram/datamodelcontext.hxx" |
| #include "diagramdefinitioncontext.hxx" |
| |
| using namespace ::oox::core; |
| using namespace ::com::sun::star::xml::sax; |
| using namespace ::com::sun::star::uno; |
| using ::rtl::OUString; |
| |
| namespace oox { namespace drawingml { |
| |
| DiagramDataFragmentHandler::DiagramDataFragmentHandler( XmlFilterBase& rFilter, |
| const OUString& rFragmentPath, |
| const DiagramDataPtr pDataPtr ) |
| throw( ) |
| : FragmentHandler( rFilter, rFragmentPath ) |
| , mpDataPtr( pDataPtr ) |
| { |
| } |
| |
| DiagramDataFragmentHandler::~DiagramDataFragmentHandler( ) throw () |
| { |
| |
| } |
| |
| void SAL_CALL DiagramDataFragmentHandler::endDocument() |
| throw (SAXException, RuntimeException) |
| { |
| |
| } |
| |
| |
| Reference< XFastContextHandler > SAL_CALL |
| DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement, |
| const Reference< XFastAttributeList >& ) |
| throw ( SAXException, RuntimeException) |
| { |
| Reference< XFastContextHandler > xRet; |
| |
| switch( aElement ) |
| { |
| case DGM_TOKEN( dataModel ): |
| xRet.set( new DataModelContext( *this, mpDataPtr ) ); |
| break; |
| default: |
| break; |
| } |
| |
| if( !xRet.is() ) |
| xRet = getFastContextHandler(); |
| |
| return xRet; |
| } |
| |
| /////////////////// |
| |
| DiagramLayoutFragmentHandler::DiagramLayoutFragmentHandler( XmlFilterBase& rFilter, |
| const OUString& rFragmentPath, |
| const DiagramLayoutPtr pDataPtr ) |
| throw( ) |
| : FragmentHandler( rFilter, rFragmentPath ) |
| , mpDataPtr( pDataPtr ) |
| { |
| } |
| |
| DiagramLayoutFragmentHandler::~DiagramLayoutFragmentHandler( ) throw () |
| { |
| |
| } |
| |
| void SAL_CALL DiagramLayoutFragmentHandler::endDocument() |
| throw (SAXException, RuntimeException) |
| { |
| |
| } |
| |
| |
| Reference< XFastContextHandler > SAL_CALL |
| DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement, |
| const Reference< XFastAttributeList >& xAttribs ) |
| throw ( SAXException, RuntimeException) |
| { |
| Reference< XFastContextHandler > xRet; |
| |
| switch( aElement ) |
| { |
| case DGM_TOKEN( layoutDef ): |
| xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) ); |
| break; |
| default: |
| break; |
| } |
| |
| if( !xRet.is() ) |
| xRet = getFastContextHandler(); |
| |
| return xRet; |
| } |
| |
| /////////////////////// |
| |
| DiagramQStylesFragmentHandler::DiagramQStylesFragmentHandler( XmlFilterBase& rFilter, |
| const OUString& rFragmentPath, |
| const DiagramQStylesPtr pDataPtr ) |
| throw( ) |
| : FragmentHandler( rFilter, rFragmentPath ) |
| , mpDataPtr( pDataPtr ) |
| { |
| } |
| |
| DiagramQStylesFragmentHandler::~DiagramQStylesFragmentHandler( ) throw () |
| { |
| |
| } |
| |
| void SAL_CALL DiagramQStylesFragmentHandler::endDocument() |
| throw (SAXException, RuntimeException) |
| { |
| |
| } |
| |
| |
| Reference< XFastContextHandler > SAL_CALL |
| DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement, |
| const Reference< XFastAttributeList >& ) |
| throw ( SAXException, RuntimeException) |
| { |
| Reference< XFastContextHandler > xRet; |
| |
| switch( aElement ) |
| { |
| case DGM_TOKEN( styleDef ): |
| // TODO |
| break; |
| default: |
| break; |
| } |
| |
| if( !xRet.is() ) |
| xRet = getFastContextHandler(); |
| |
| return xRet; |
| } |
| |
| ///////////////////// |
| |
| DiagramColorsFragmentHandler::DiagramColorsFragmentHandler( XmlFilterBase& rFilter, |
| const OUString& rFragmentPath, |
| const DiagramColorsPtr pDataPtr ) |
| throw( ) |
| : FragmentHandler( rFilter, rFragmentPath ) |
| , mpDataPtr( pDataPtr ) |
| { |
| } |
| |
| DiagramColorsFragmentHandler::~DiagramColorsFragmentHandler( ) throw () |
| { |
| |
| } |
| |
| void SAL_CALL DiagramColorsFragmentHandler::endDocument() |
| throw (SAXException, RuntimeException) |
| { |
| |
| } |
| |
| |
| Reference< XFastContextHandler > SAL_CALL |
| DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement, |
| const Reference< XFastAttributeList >& ) |
| throw ( SAXException, RuntimeException) |
| { |
| Reference< XFastContextHandler > xRet; |
| |
| switch( aElement ) |
| { |
| case DGM_TOKEN( colorsDef ): |
| // TODO |
| break; |
| default: |
| break; |
| } |
| |
| if( !xRet.is() ) |
| xRet = getFastContextHandler(); |
| |
| return xRet; |
| } |
| |
| |
| |
| |
| } } |