LCOV - code coverage report
Current view: top level - sw/inc - lineinfo.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 22 22 100.0 %
Date: 2012-08-25 Functions: 23 23 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 6 50.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                 :            : #ifndef SW_LINEINFO_HXX
      20                 :            : #define SW_LINEINFO_HXX
      21                 :            : 
      22                 :            : #include "calbck.hxx"
      23                 :            : #include <editeng/numitem.hxx>
      24                 :            : #include "swdllapi.h"
      25                 :            : 
      26                 :            : class SwCharFmt;
      27                 :            : class IDocumentStylePoolAccess;
      28                 :            : 
      29                 :            : enum LineNumberPosition
      30                 :            : {
      31                 :            :     LINENUMBER_POS_LEFT,
      32                 :            :     LINENUMBER_POS_RIGHT,
      33                 :            :     LINENUMBER_POS_INSIDE,
      34                 :            :     LINENUMBER_POS_OUTSIDE
      35                 :            : };
      36                 :            : 
      37 [ +  - ][ +  - ]:       3503 : class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation from SwClient:
                 [ -  + ]
      38                 :            :                                          //character style for displaying the numbers.
      39                 :            : {
      40                 :            :     SvxNumberType       aType;              //e.g. roman linenumbers
      41                 :            :     String              aDivider;           //String for aditional interval (vert. lines user defined)
      42                 :            :     sal_uInt16              nPosFromLeft;       //Position for paint
      43                 :            :     sal_uInt16              nCountBy;           //Paint only for every n line
      44                 :            :     sal_uInt16              nDividerCountBy;    //Interval for display of an user defined
      45                 :            :                                             //string every n lines
      46                 :            :     LineNumberPosition  ePos;               //Where should the display occur (number and divicer)
      47                 :            :     sal_Bool                bPaintLineNumbers;  //Should anything be displayed?
      48                 :            :     sal_Bool                bCountBlankLines;   //Count empty lines?
      49                 :            :     sal_Bool                bCountInFlys;       //Count also within FlyFrames?
      50                 :            :     sal_Bool                bRestartEachPage;   //Restart counting at the first paragraph of each page
      51                 :            :                                             //(even on follows when paragraphs are splitted)
      52                 :            : protected:
      53                 :            :    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
      54                 :            : 
      55                 :            : public:
      56                 :            :     SwLineNumberInfo();
      57                 :            :     SwLineNumberInfo(const SwLineNumberInfo&);
      58                 :            : 
      59                 :            :     SwLineNumberInfo& operator=(const SwLineNumberInfo&);
      60                 :            :     sal_Bool operator==( const SwLineNumberInfo& rInf ) const;
      61                 :            : 
      62                 :            :     SwCharFmt *GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) const;
      63                 :            :     void SetCharFmt( SwCharFmt* );
      64                 :            : 
      65                 :       1268 :     const SvxNumberType &GetNumType() const             { return aType; }
      66                 :         65 :     void                SetNumType( SvxNumberType aNew ){ aType = aNew; }
      67                 :            : 
      68                 :       1229 :     const String &GetDivider() const    { return aDivider; }
      69                 :         65 :     void SetDivider( const String &r )  { aDivider = r; }
      70                 :       1178 :     sal_uInt16 GetDividerCountBy() const    { return nDividerCountBy; }
      71                 :          2 :     void SetDividerCountBy( sal_uInt16 n )  { nDividerCountBy = n; }
      72                 :            : 
      73                 :       1229 :     sal_uInt16 GetPosFromLeft() const       { return nPosFromLeft; }
      74                 :         65 :     void   SetPosFromLeft( sal_uInt16 n)    { nPosFromLeft = n;    }
      75                 :            : 
      76                 :       1233 :     sal_uInt16 GetCountBy() const           { return nCountBy; }
      77                 :         65 :     void   SetCountBy( sal_uInt16 n)        { nCountBy = n;    }
      78                 :            : 
      79                 :       1229 :     LineNumberPosition GetPos() const   { return ePos; }
      80                 :         65 :     void SetPos( LineNumberPosition eP ){ ePos = eP;   }
      81                 :            : 
      82                 :      88763 :     sal_Bool   IsPaintLineNumbers() const   { return bPaintLineNumbers; }
      83                 :         65 :     void   SetPaintLineNumbers( sal_Bool b ){ bPaintLineNumbers = b;    }
      84                 :            : 
      85                 :      21553 :     sal_Bool   IsCountBlankLines() const    { return bCountBlankLines;  }
      86                 :         65 :     void   SetCountBlankLines( sal_Bool b ) { bCountBlankLines = b;     }
      87                 :            : 
      88                 :      88563 :     sal_Bool   IsCountInFlys() const        { return bCountInFlys;      }
      89                 :         65 :     void   SetCountInFlys( sal_Bool b )     { bCountInFlys = b;         }
      90                 :            : 
      91                 :       7216 :     sal_Bool   IsRestartEachPage() const    { return bRestartEachPage;  }
      92                 :         63 :     void   SetRestartEachPage( sal_Bool b ) { bRestartEachPage = b;     }
      93                 :            : 
      94                 :         23 :     bool   HasCharFormat() const { return GetRegisteredIn() != 0; }
      95                 :            : };
      96                 :            : 
      97                 :            : 
      98                 :            : 
      99                 :            : #endif
     100                 :            : 
     101                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10