LCOV - code coverage report
Current view: top level - include/oox/drawingml/chart - modelbase.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 18 0.0 %
Date: 2014-04-14 Functions: 0 116 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
      21             : #define INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
      22             : 
      23             : #include <oox/helper/helper.hxx>
      24             : #include <oox/helper/refmap.hxx>
      25             : #include <oox/helper/refvector.hxx>
      26             : 
      27             : namespace oox { class AttributeList; }
      28             : 
      29             : namespace oox {
      30             : namespace drawingml {
      31             : namespace chart {
      32             : 
      33             : 
      34             : 
      35             : template< typename ModelType >
      36           0 : class ModelRef : public ::boost::shared_ptr< ModelType >
      37             : {
      38             : public:
      39           0 :                  ModelRef() {}
      40           0 :                  ModelRef( const ::boost::shared_ptr< ModelType >& rxModel ) : ::boost::shared_ptr< ModelType >( rxModel ) {}
      41           0 :                  ~ModelRef() {}
      42             : 
      43           0 :     bool         is() const { return this->get() != 0; }
      44             : 
      45           0 :     ModelType&   create() { this->reset( new ModelType ); return **this; }
      46             :     template< typename Param1Type >
      47           0 :     ModelType&   create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; }
      48             : 
      49           0 :     ModelType&   getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
      50             :     template< typename Param1Type >
      51             :     ModelType&   getOrCreate( const Param1Type& rParam1 ) { if( !*this ) this->reset( new ModelType( rParam1 ) ); return **this; }
      52             : };
      53             : 
      54             : 
      55             : 
      56             : template< typename ModelType >
      57             : class ModelVector : public RefVector< ModelType >
      58             : {
      59             : public:
      60             :     typedef typename RefVector< ModelType >::value_type value_type;
      61             :     typedef typename RefVector< ModelType >::size_type  size_type;
      62             : 
      63           0 :                  ModelVector() {}
      64           0 :                  ~ModelVector() {}
      65             : 
      66           0 :     ModelType&   create() { return append( new ModelType ); }
      67             :     template< typename Param1Type >
      68           0 :     ModelType&   create( const Param1Type& rParam1 ) { return append( new ModelType( rParam1 ) ); }
      69             : 
      70             : private:
      71           0 :     ModelType&   append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; }
      72             : };
      73             : 
      74             : 
      75             : 
      76             : template< typename KeyType, typename ModelType >
      77             : class ModelMap : public RefMap< KeyType, ModelType >
      78             : {
      79             : public:
      80             :     typedef typename RefMap< KeyType, ModelType >::key_type     key_type;
      81             :     typedef typename RefMap< KeyType, ModelType >::mapped_type  mapped_type;
      82             :     typedef typename RefMap< KeyType, ModelType >::value_type   value_type;
      83             : 
      84           0 :                  ModelMap() {}
      85           0 :                  ~ModelMap() {}
      86             : 
      87           0 :     ModelType&   create( KeyType eKey ) { return insert( eKey, new ModelType ); }
      88             :     template< typename Param1Type >
      89             :     ModelType&   create( KeyType eKey, const Param1Type& rParam1 ) { return insert( eKey, new ModelType( rParam1 ) ); }
      90             : 
      91             : private:
      92           0 :     ModelType&   insert( KeyType eKey, ModelType* pModel ) { (*this)[ eKey ].reset( pModel ); return *pModel; }
      93             : };
      94             : 
      95             : 
      96             : 
      97           0 : struct NumberFormat
      98             : {
      99             :     OUString     maFormatCode;       /// Number format code.
     100             :     bool                mbSourceLinked;     /// True = number format linked to source data.
     101             : 
     102             :                         NumberFormat();
     103             : 
     104             :     void                setAttributes( const AttributeList& rAttribs );
     105             : };
     106             : 
     107             : 
     108             : 
     109             : struct LayoutModel
     110             : {
     111             :     double              mfX;                /// Left position of this object.
     112             :     double              mfY;                /// Top position of this object.
     113             :     double              mfW;                /// Width of this object.
     114             :     double              mfH;                /// Height of this object.
     115             :     sal_Int32           mnXMode;            /// Mode for left position.
     116             :     sal_Int32           mnYMode;            /// Mode for top position.
     117             :     sal_Int32           mnWMode;            /// Mode for width.
     118             :     sal_Int32           mnHMode;            /// Mode for height.
     119             :     sal_Int32           mnTarget;           /// Layout target for plot area.
     120             :     bool                mbAutoLayout;       /// True = automatic positioning.
     121             : 
     122             :                         LayoutModel();
     123             :                         ~LayoutModel();
     124             : };
     125             : 
     126             : 
     127             : 
     128             : } // namespace chart
     129             : } // namespace drawingml
     130             : } // namespace oox
     131             : 
     132             : #endif
     133             : 
     134             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10