LCOV - code coverage report
Current view: top level - include/cppcanvas - renderer.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 2 2 100.0 %
Date: 2015-06-13 12:38:46 Functions: 4 7 57.1 %
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_CPPCANVAS_RENDERER_HXX
      21             : #define INCLUDED_CPPCANVAS_RENDERER_HXX
      22             : 
      23             : #include <sal/types.h>
      24             : #include <rtl/ustring.hxx>
      25             : 
      26             : #include <boost/shared_ptr.hpp>
      27             : #include <boost/optional.hpp>
      28             : #include <basegfx/matrix/b2dhommatrix.hxx>
      29             : #include <cppcanvas/canvasgraphic.hxx>
      30             : #include <cppcanvas/color.hxx>
      31             : 
      32             : namespace basegfx
      33             : {
      34             :     class B2DRange;
      35             : }
      36             : 
      37             : /* Definition of Renderer interface */
      38             : 
      39             : namespace cppcanvas
      40             : {
      41             : 
      42           4 :     class Renderer : public virtual CanvasGraphic
      43             :     {
      44             :     public:
      45             :         /** Render subset of metafile to given canvas
      46             : 
      47             :             This method renders the given subset of the content to the
      48             :             associated canvas.
      49             : 
      50             :             @param nStartIndex
      51             :             The index of the first action to be rendered (the indices
      52             :             correspond roughly to the action indices of the
      53             :             originating GDIMetaFile. Note, although, that certain
      54             :             actions, e.g. text, accounts for more than one index: a
      55             :             text produces as many addressable indices as it has
      56             :             characters).
      57             : 
      58             :             @param nEndIndex
      59             :             The index of the first action _not_ painted anymore,
      60             :             i.e. the action after the last action rendered (the
      61             :             indices correspond roughly to the action indices of the
      62             :             originating GDIMetaFile. Note, although, that certain
      63             :             actions, e.g. text, accounts for more than one index: a
      64             :             text produces as many addressable indices as it has
      65             :             characters).
      66             : 
      67             :             @return whether the rendering finished successfully.
      68             :          */
      69             :         virtual bool drawSubset( sal_Int32  nStartIndex,
      70             :                                  sal_Int32  nEndIndex ) const = 0;
      71             : 
      72             :         /** Query bounding box of metafile subset
      73             : 
      74             :             This method queries the actual bounding box of the given
      75             :             subset, when rendered on the associated canvas.
      76             : 
      77             :             @param nStartIndex
      78             :             The index of the first action to be rendered (the indices
      79             :             correspond roughly to the action indices of the
      80             :             originating GDIMetaFile. Note, although, that certain
      81             :             actions, e.g. text, accounts for more than one index: a
      82             :             text produces as many addressable indices as it has
      83             :             characters).
      84             : 
      85             :             @param nEndIndex
      86             :             The index of the first action _not_ painted anymore,
      87             :             i.e. the action after the last action rendered (the
      88             :             indices correspond roughly to the action indices of the
      89             :             originating GDIMetaFile. Note, although, that certain
      90             :             actions, e.g. text, accounts for more than one index: a
      91             :             text produces as many addressable indices as it has
      92             :             characters).
      93             : 
      94             :             @return the bounding box of the specified subset
      95             :          */
      96             :         virtual ::basegfx::B2DRange getSubsetArea( sal_Int32    nStartIndex,
      97             :                                                    sal_Int32    nEndIndex ) const = 0;
      98             : 
      99             :         /** Parameters for the Renderer
     100             :          */
     101           4 :         struct Parameters
     102             :         {
     103             :             /// Optionally forces the fill color attribute for all actions
     104             :             ::boost::optional< Color::IntSRGBA >            maFillColor;
     105             : 
     106             :             /// Optionally forces the line color attribute for all actions
     107             :             ::boost::optional< Color::IntSRGBA >        maLineColor;
     108             : 
     109             :             /// Optionally forces the text color attribute for all actions
     110             :             ::boost::optional< Color::IntSRGBA >        maTextColor;
     111             : 
     112             :             /// Optionally forces the given fontname for all text actions
     113             :             ::boost::optional< OUString >        maFontName;
     114             : 
     115             :             /** Optionally transforms all text output actions with the
     116             :                 given matrix (in addition to the overall canvas
     117             :                 transformation).
     118             : 
     119             :                 Note that the matrix given here is applied to the unit
     120             :                 rect coordinate system, i.e. the metafile is assumed
     121             :                 to be contained in the unit rect.
     122             :              */
     123             :             ::boost::optional< ::basegfx::B2DHomMatrix >    maTextTransformation;
     124             : 
     125             :             /// Optionally forces the given font weight for all text actions
     126             :             ::boost::optional< sal_Int8 >                   maFontWeight;
     127             : 
     128             :             /// Optionally forces the given font letter form (italics etc.) for all text actions
     129             :             ::boost::optional< sal_Int8 >                   maFontLetterForm;
     130             : 
     131             :             /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
     132             :             ::boost::optional< sal_Int8 >                   maFontProportion;
     133             : 
     134             :             /// Optionally forces underlining for all text actions
     135             :             ::boost::optional< bool >                       maFontUnderline;
     136             :         };
     137             :     };
     138             : 
     139             :     typedef ::boost::shared_ptr< ::cppcanvas::Renderer > RendererSharedPtr;
     140             : }
     141             : 
     142             : #endif // INCLUDED_CPPCANVAS_RENDERER_HXX
     143             : 
     144             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11