LCOV - code coverage report
Current view: top level - include/vcl - mapmod.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 10 10 100.0 %
Date: 2014-04-11 Functions: 5 5 100.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_VCL_MAPMOD_HXX
      21             : #define INCLUDED_VCL_MAPMOD_HXX
      22             : 
      23             : #include <tools/gen.hxx>
      24             : #include <tools/fract.hxx>
      25             : #include <tools/solar.h>
      26             : #include <vcl/dllapi.h>
      27             : #include <tools/resid.hxx>
      28             : #include <tools/mapunit.hxx>
      29             : 
      30             : class SvStream;
      31             : 
      32             : 
      33             : // - ImplMapMode -
      34             : 
      35             : 
      36             : class   OutputDevice;
      37             : 
      38             : class ImplMapMode
      39             : {
      40             :     friend class    MapMode;
      41             :     friend class    OutputDevice;
      42             : 
      43             : private:
      44             :     sal_uLong           mnRefCount;
      45             :     MapUnit         meUnit;
      46             :     Point           maOrigin;
      47             :     Fraction        maScaleX;
      48             :     Fraction        maScaleY;
      49             :     bool            mbSimple;
      50             : 
      51             :     friend SvStream& ReadImplMapMode( SvStream& rIStm, ImplMapMode& rMapMode );
      52             :     friend SvStream& WriteImplMapMode( SvStream& rOStm, const ImplMapMode& rMapMode );
      53             : 
      54             :     static ImplMapMode* ImplGetStaticMapMode( MapUnit eUnit );
      55             : public:
      56             :                     ImplMapMode();
      57             :                     ImplMapMode( const ImplMapMode& rImpMapMode );
      58             : };
      59             : 
      60             : 
      61             : // - MapMode -
      62             : 
      63             : 
      64             : class VCL_DLLPUBLIC MapMode
      65             : {
      66             :     friend class        OutputDevice;
      67             : 
      68             : private:
      69             :     ImplMapMode*        mpImplMapMode;
      70             : 
      71             :     SAL_DLLPRIVATE void ImplMakeUnique();
      72             : 
      73             : public:
      74             :                     MapMode();
      75             :                     MapMode( const MapMode& rMapMode );
      76             :                     MapMode( MapUnit eUnit );
      77             :                     MapMode( MapUnit eUnit, const Point& rLogicOrg,
      78             :                              const Fraction& rScaleX, const Fraction& rScaleY );
      79             :                     ~MapMode();
      80             : 
      81             :     void            SetMapUnit( MapUnit eUnit );
      82     2844063 :     MapUnit         GetMapUnit() const
      83     2844063 :                         { return mpImplMapMode->meUnit; }
      84             : 
      85             :     void            SetOrigin( const Point& rOrigin );
      86     1170847 :     const Point&    GetOrigin() const
      87     1170847 :                         { return mpImplMapMode->maOrigin; }
      88             : 
      89             :     void            SetScaleX( const Fraction& rScaleX );
      90     2148696 :     const Fraction& GetScaleX() const
      91     2148696 :                         { return mpImplMapMode->maScaleX; }
      92             :     void            SetScaleY( const Fraction& rScaleY );
      93     2142539 :     const Fraction& GetScaleY() const
      94     2142539 :                         { return mpImplMapMode->maScaleY; }
      95             : 
      96             :     MapMode&        operator=( const MapMode& rMapMode );
      97             :     bool            operator==( const MapMode& rMapMode ) const;
      98       55508 :     bool            operator!=( const MapMode& rMapMode ) const
      99       55508 :                         { return !(MapMode::operator==( rMapMode )); }
     100             :     bool            IsDefault() const;
     101             :     bool            IsSameInstance( const MapMode& rMapMode ) const
     102             :                         { return (mpImplMapMode == rMapMode.mpImplMapMode); }
     103             : 
     104             :     friend VCL_DLLPUBLIC SvStream& ReadMapMode( SvStream& rIStm, MapMode& rMapMode );
     105             :     friend VCL_DLLPUBLIC SvStream& WriteMapMode( SvStream& rOStm, const MapMode& rMapMode );
     106             : };
     107             : 
     108             : #endif // INCLUDED_VCL_MAPMOD_HXX
     109             : 
     110             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10