LCOV - code coverage report
Current view: top level - cppcanvas/source/inc - action.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 2 0.0 %
Date: 2012-08-25 Functions: 0 3 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 2 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _CPPCANVAS_ACTION_HXX
      30                 :            : #define _CPPCANVAS_ACTION_HXX
      31                 :            : 
      32                 :            : #include <sal/types.h>
      33                 :            : 
      34                 :            : #include <boost/shared_ptr.hpp>
      35                 :            : 
      36                 :            : namespace basegfx
      37                 :            : {
      38                 :            :     class B2DHomMatrix;
      39                 :            :     class B2DRange;
      40                 :            : }
      41                 :            : 
      42                 :            : 
      43                 :            : /* Definition of Action interface */
      44                 :            : 
      45                 :            : namespace cppcanvas
      46                 :            : {
      47                 :            :     namespace internal
      48                 :            :     {
      49                 :            :         /** Interface for internal render actions
      50                 :            : 
      51                 :            :             This interface is implemented by all objects generated
      52                 :            :             from the metafile renderer, and corresponds roughly to the
      53                 :            :             VCL meta action.
      54                 :            :          */
      55                 :          0 :         class Action
      56                 :            :         {
      57                 :            :         public:
      58                 :            :             /** Used for rendering action subsets
      59                 :            : 
      60                 :            :                 There are several cases where an Action might have
      61                 :            :                 subsettable content, e.g. text, or referenced
      62                 :            :                 metafiles, like the transparent action.
      63                 :            : 
      64                 :            :                 Generally, at the metafile renderer, all actions are
      65                 :            :                 'flattened' out, i.e. a meta action rendering the
      66                 :            :                 string "Hello" counts five indices, and a transparent
      67                 :            :                 action containing a metafile with 100 actions counts
      68                 :            :                 at least 100 indices (contained transparency or text
      69                 :            :                 actions recursively add to this value). From the
      70                 :            :                 outside, the subset to render is referenced via this
      71                 :            :                 flat index range
      72                 :            :              */
      73                 :            :             struct Subset
      74                 :            :             {
      75                 :            :                 /** Denotes start of the subset.
      76                 :            : 
      77                 :            :                     The index given here specifies the first subaction
      78                 :            :                     to render.
      79                 :            :                  */
      80                 :            :                 sal_Int32   mnSubsetBegin;
      81                 :            : 
      82                 :            :                 /** Denotes end of the subset
      83                 :            : 
      84                 :            :                     The index given here specifies the first subaction
      85                 :            :                     <em>not<em> to render, i.e. one action behind the
      86                 :            :                     subset to be rendered
      87                 :            :                  */
      88                 :            :                 sal_Int32   mnSubsetEnd;
      89                 :            :             };
      90                 :            : 
      91         [ #  # ]:          0 :             virtual ~Action() {}
      92                 :            : 
      93                 :            :             /** Render this action to the associated canvas
      94                 :            : 
      95                 :            :                 @param rTransformation
      96                 :            :                 Transformation matrix to apply before rendering
      97                 :            : 
      98                 :            :                 @return true, if rendering was successful. If
      99                 :            :                 rendering failed, false is returned.
     100                 :            :              */
     101                 :            :             virtual bool render( const ::basegfx::B2DHomMatrix& rTransformation ) const = 0;
     102                 :            : 
     103                 :            :             /** Render the given part of the action to the associated
     104                 :            :                 canvas.
     105                 :            : 
     106                 :            :                 @param rTransformation
     107                 :            :                 Transformation matrix to apply before rendering
     108                 :            : 
     109                 :            :                 @param rSubset
     110                 :            :                 Subset of the action to render. See Subset description
     111                 :            :                 for index semantics.
     112                 :            : 
     113                 :            :                 @return true, if rendering was successful. If the
     114                 :            :                 specified subset is invalid for this action, or if
     115                 :            :                 rendering failed for other reasons, false is returned.
     116                 :            :              */
     117                 :            :             virtual bool renderSubset( const ::basegfx::B2DHomMatrix& rTransformation,
     118                 :            :                                        const Subset&                  rSubset ) const = 0;
     119                 :            : 
     120                 :            :             /** Query bounds of this action on the associated canvas
     121                 :            : 
     122                 :            :                 @param rTransformation
     123                 :            :                 Transformation matrix to apply
     124                 :            : 
     125                 :            :                 @return the bounds for this action in device
     126                 :            :                 coordinate space.
     127                 :            :              */
     128                 :            :             virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const = 0;
     129                 :            : 
     130                 :            :             /** Query bounds for the given part of the action on the
     131                 :            :                 associated canvas.
     132                 :            : 
     133                 :            :                 @param rTransformation
     134                 :            :                 Transformation matrix to apply.
     135                 :            : 
     136                 :            :                 @param rSubset
     137                 :            :                 Subset of the action to query. See Subset description
     138                 :            :                 for index semantics.
     139                 :            : 
     140                 :            :                 @return the bounds for the given subset in device
     141                 :            :                 coordinate space.
     142                 :            :              */
     143                 :            :             virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix&   rTransformation,
     144                 :            :                                                    const Subset&                    rSubset ) const = 0;
     145                 :            : 
     146                 :            :             /** Query action count.
     147                 :            : 
     148                 :            :                 This method returns the number of subset actions
     149                 :            :                 contained in this action. The render( Subset ) method
     150                 :            :                 must accept subset ranges up to the value returned
     151                 :            :                 here.
     152                 :            : 
     153                 :            :                 @return the number of subset actions
     154                 :            :              */
     155                 :            :             virtual sal_Int32 getActionCount() const = 0;
     156                 :            :         };
     157                 :            : 
     158                 :            :         typedef ::boost::shared_ptr< Action > ActionSharedPtr;
     159                 :            : 
     160                 :            :     }
     161                 :            : }
     162                 :            : 
     163                 :            : #endif /* _CPPCANVAS_ACTION_HXX */
     164                 :            : 
     165                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10