LCOV - code coverage report
Current view: top level - include/oox/drawingml/chart - typegroupconverter.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 1 0.0 %
Date: 2014-04-14 Functions: 0 1 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_TYPEGROUPCONVERTER_HXX
      21             : #define INCLUDED_OOX_DRAWINGML_CHART_TYPEGROUPCONVERTER_HXX
      22             : 
      23             : #include <oox/drawingml/chart/converterbase.hxx>
      24             : 
      25             : namespace com { namespace sun { namespace star {
      26             :     namespace chart2 { class XChartType; }
      27             :     namespace chart2 { class XCoordinateSystem; }
      28             :     namespace chart2 { class XDataSeries; }
      29             :     namespace chart2 { class XDiagram; }
      30             :     namespace chart2 { namespace data { class XLabeledDataSequence; } }
      31             : } } }
      32             : 
      33             : namespace oox {
      34             : namespace drawingml {
      35             : namespace chart {
      36             : 
      37             : /** Enumerates different chart types. */
      38             : enum TypeId
      39             : {
      40             :     TYPEID_BAR,                     /// Vertical bar chart.
      41             :     TYPEID_HORBAR,                  /// Horizontal bar chart.
      42             :     TYPEID_LINE,                    /// Line chart.
      43             :     TYPEID_AREA,                    /// Area chart.
      44             :     TYPEID_STOCK,                   /// Stock chart.
      45             :     TYPEID_RADARLINE,               /// Linear radar chart.
      46             :     TYPEID_RADARAREA,               /// Filled radar chart.
      47             :     TYPEID_PIE,                     /// Pie chart.
      48             :     TYPEID_DOUGHNUT,                /// Doughnut (ring) chart.
      49             :     TYPEID_OFPIE,                   /// Pie-to-pie or pie-to-bar chart.
      50             :     TYPEID_SCATTER,                 /// Scatter (XY) chart.
      51             :     TYPEID_BUBBLE,                  /// Bubble chart.
      52             :     TYPEID_SURFACE,                 /// Surface chart.
      53             :     TYPEID_UNKNOWN                  /// Default for unknown chart types.
      54             : };
      55             : 
      56             : /** Enumerates different categories of similar chart types. */
      57             : enum TypeCategory
      58             : {
      59             :     TYPECATEGORY_BAR,               /// Bar charts (horizontal or vertical).
      60             :     TYPECATEGORY_LINE,              /// Line charts (line, area, stock charts).
      61             :     TYPECATEGORY_RADAR,             /// Radar charts (linear or filled).
      62             :     TYPECATEGORY_PIE,               /// Pie and donut charts.
      63             :     TYPECATEGORY_SCATTER,           /// Scatter and bubble charts.
      64             :     TYPECATEGORY_SURFACE            /// Surface charts.
      65             : };
      66             : 
      67             : /** Enumerates modes for varying point colors in a series. */
      68             : enum VarPointMode
      69             : {
      70             :     VARPOINTMODE_NONE,              /// No varied colors supported.
      71             :     VARPOINTMODE_SINGLE,            /// Only supported, if type group contains only one series.
      72             :     VARPOINTMODE_MULTI              /// Supported for multiple series in a chart type group.
      73             : };
      74             : 
      75             : /** Contains info for a chart type related to the OpenOffice.org chart module. */
      76             : struct TypeGroupInfo
      77             : {
      78             :     TypeId              meTypeId;               /// Unique chart type identifier.
      79             :     TypeCategory        meTypeCategory;         /// Category this chart type belongs to.
      80             :     const sal_Char*     mpcServiceName;         /// Service name of the type.
      81             :     VarPointMode        meVarPointMode;         /// Mode for varying point colors.
      82             :     sal_Int32           mnDefLabelPos;          /// Default data label position (API constant).
      83             :     bool                mbCombinable2d;         /// True = types can be combined in one axes set.
      84             :     bool                mbSupports3d;           /// True = 3D type allowed, false = only 2D type.
      85             :     bool                mbPolarCoordSystem;     /// True = polar, false = cartesian.
      86             :     bool                mbSeriesIsFrame2d;      /// True = 2D type series with area formatting.
      87             :     bool                mbSingleSeriesVis;      /// True = only first series visible (e.g. pie charts).
      88             :     bool                mbCategoryAxis;         /// True = X axis contains categories.
      89             :     bool                mbSwappedAxesSet;       /// True = X axis and Y axis are swapped.
      90             :     bool                mbSupportsStacking;     /// True = data points can be stacked on each other.
      91             :     bool                mbReverseSeries;        /// True = insert unstacked series in reverse order.
      92             :     bool                mbTicksBetweenCateg;    /// True = X axis ticks between categories.
      93             :     bool                mbPictureOptions;       /// True = bitmaps support options from c:pictureOptions.
      94             : };
      95             : 
      96             : struct UpDownBarsModel;
      97             : 
      98             : class UpDownBarsConverter : public ConverterBase< UpDownBarsModel >
      99             : {
     100             : public:
     101             :     explicit            UpDownBarsConverter( const ConverterRoot& rParent, UpDownBarsModel& rModel );
     102             :     virtual             ~UpDownBarsConverter();
     103             : 
     104             :     /** Converts the OOXML up/down bars. */
     105             :     void                convertFromModel(
     106             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType );
     107             : };
     108             : 
     109             : struct TypeGroupModel;
     110             : struct View3DModel;
     111             : 
     112             : class TypeGroupConverter : public ConverterBase< TypeGroupModel >
     113             : {
     114             : public:
     115             :     explicit            TypeGroupConverter( const ConverterRoot& rParent, TypeGroupModel& rModel );
     116             :     virtual             ~TypeGroupConverter();
     117             : 
     118             :     /** Returns the type info struct that describes this chart type group. */
     119           0 :     const TypeGroupInfo& getTypeInfo() const { return maTypeInfo; }
     120             : 
     121             :     /** Returns true, if the series in this chart type group are stacked on each other (no percentage). */
     122             :     bool                isStacked() const;
     123             :     /** Returns true, if the series in this chart type group are stacked on each other as percentage. */
     124             :     bool                isPercent() const;
     125             :     /** Returns true, if the chart is three-dimensional. */
     126             :     bool                is3dChart() const;
     127             :     /** Returns true, if chart type supports wall and floor format in 3D mode. */
     128             :     bool                isWall3dChart() const;
     129             :     /** Returns true, if the series in this chart type group are ordered on the Z axis. */
     130             :     bool                isDeep3dChart() const;
     131             : 
     132             :     /** Returns true, if this chart type supports area formatting for its series. */
     133             :     bool                isSeriesFrameFormat() const;
     134             :     /** Returns the object type for a series depending on the chart type. */
     135             :     ObjectType          getSeriesObjectType() const;
     136             : 
     137             :     /** Returns true, if this chart type has to reverse its series order. */
     138             :     bool                isReverseSeries() const;
     139             :     /** Returns series title, if the chart type group contains only one single series. */
     140             :     OUString     getSingleSeriesTitle() const;
     141             : 
     142             :     /** Creates a coordinate system according to the contained chart type. */
     143             :     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >
     144             :                         createCoordinateSystem();
     145             :     /** Creates a labeled data sequence object for axis categories. */
     146             :     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
     147             :                         createCategorySequence();
     148             : 
     149             :     /** Converts the OOXML type group model into a chart2 coordinate system. */
     150             :     void                convertFromModel(
     151             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& rxDiagram,
     152             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& rxCoordSystem,
     153             :                             sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint );
     154             : 
     155             :     /** Sets the passed OOXML marker style at the passed property set. */
     156             :     void                convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
     157             :             ModelRef< Shape > xShapeProps ) const;
     158             :     /** Sets the passed OOXML line smoothing at the passed property set. */
     159             :     void                convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const;
     160             :     /** Sets the passed OOXML bar 3D geometry at the passed property set. */
     161             :     void                convertBarGeometry( PropertySet& rPropSet, sal_Int32 nOoxShape ) const;
     162             :     /** Sets the passed OOXML pie rotation at the passed property set. */
     163             :     void                convertPieRotation( PropertySet& rPropSet, sal_Int32 nOoxAngle ) const;
     164             :     /** Sets the passed OOXML pie explosion at the passed property set. */
     165             :     void                convertPieExplosion( PropertySet& rPropSet, sal_Int32 nOoxExplosion ) const;
     166             : 
     167             : private:
     168             :     /** Inserts the passed series into the chart type. Adds additional properties to the series. */
     169             :     void                insertDataSeries(
     170             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType,
     171             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxSeries,
     172             :                             sal_Int32 nAxesSetIdx );
     173             : 
     174             : private:
     175             :     TypeGroupInfo       maTypeInfo;         /// Extended type info for contained chart type model.
     176             :     bool                mb3dChart;          /// True = type is a 3D chart type.
     177             : };
     178             : 
     179             : } // namespace chart
     180             : } // namespace drawingml
     181             : } // namespace oox
     182             : 
     183             : #endif
     184             : 
     185             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10