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

           Branch data     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 _SVX_XDASH_HXX
      21                 :            : #define _SVX_XDASH_HXX
      22                 :            : 
      23                 :            : //-------------
      24                 :            : // class XDash
      25                 :            : //-------------
      26                 :            : 
      27                 :            : #include <svx/xenum.hxx>
      28                 :            : #include "svx/svxdllapi.h"
      29                 :            : 
      30                 :            : #include <vector>
      31                 :            : 
      32                 :            : class SVX_DLLPUBLIC XDash
      33                 :            : {
      34                 :            : protected:
      35                 :            :     XDashStyle  eDash;
      36                 :            :     sal_uInt16      nDots;
      37                 :            :     sal_uIntPtr       nDotLen;
      38                 :            :     sal_uInt16      nDashes;
      39                 :            :     sal_uIntPtr       nDashLen;
      40                 :            :     sal_uIntPtr       nDistance;
      41                 :            : 
      42                 :            : public:
      43                 :            :           XDash(XDashStyle eDash = XDASH_RECT,
      44                 :            :                 sal_uInt16 nDots = 1, sal_uIntPtr nDotLen = 20,
      45                 :            :                 sal_uInt16 nDashes = 1, sal_uIntPtr nDashLen = 20, sal_uIntPtr nDistance = 20);
      46                 :            : 
      47                 :            :     bool operator==(const XDash& rDash) const;
      48                 :            : 
      49                 :       1550 :     void SetDashStyle(XDashStyle eNewStyle) { eDash = eNewStyle; }
      50                 :       1550 :     void SetDots(sal_uInt16 nNewDots)           { nDots = nNewDots; }
      51                 :       1550 :     void SetDotLen(sal_uIntPtr nNewDotLen)        { nDotLen = nNewDotLen; }
      52                 :       1550 :     void SetDashes(sal_uInt16 nNewDashes)       { nDashes = nNewDashes; }
      53                 :       1550 :     void SetDashLen(sal_uIntPtr nNewDashLen)      { nDashLen = nNewDashLen; }
      54                 :       1550 :     void SetDistance(sal_uIntPtr nNewDistance)    { nDistance = nNewDistance; }
      55                 :            : 
      56                 :       2602 :     XDashStyle  GetDashStyle() const        { return eDash; }
      57                 :       8800 :     sal_uInt16      GetDots() const             { return nDots; }
      58                 :       3232 :     sal_uIntPtr       GetDotLen() const           { return nDotLen; }
      59                 :       8521 :     sal_uInt16      GetDashes() const           { return nDashes; }
      60                 :       2602 :     sal_uIntPtr       GetDashLen() const          { return nDashLen; }
      61                 :       3232 :     sal_uIntPtr       GetDistance() const         { return nDistance; }
      62                 :            : 
      63                 :            :     // XDash is translated into an array of doubles which describe the lengths of the
      64                 :            :     // dashes, dots and empty passages. It returns the complete length of the full DashDot
      65                 :            :     // sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it).
      66                 :            :     double CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const;
      67                 :            : };
      68                 :            : 
      69                 :            : #endif
      70                 :            : 
      71                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10