LCOV - code coverage report
Current view: top level - libreoffice/sw/source/ui/inc - colmgr.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 28 0.0 %
Date: 2012-12-27 Functions: 0 13 0.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             : #ifndef _COLMGR_HXX
      20             : #define _COLMGR_HXX
      21             : 
      22             : #include "swdllapi.h"
      23             : #include <fmtclds.hxx>
      24             : 
      25             : SW_DLLPUBLIC void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth);
      26             : 
      27             : class SW_DLLPUBLIC SwColMgr
      28             : {
      29             : public:
      30             :         // lActWidth is passed directly from the page dialogs edits
      31             :     SwColMgr(const SfxItemSet &rSet, sal_uInt16 nActWidth = USHRT_MAX);
      32             :     ~SwColMgr();
      33             : 
      34             : 
      35             :     inline sal_uInt16       GetCount() const;
      36             :     void                SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth);
      37             :     sal_uInt16              GetGutterWidth(sal_uInt16 nPos = USHRT_MAX) const;
      38             :     void                SetGutterWidth(sal_uInt16 nWidth, sal_uInt16 nPos = USHRT_MAX);
      39             : 
      40             :     sal_uInt16              GetColWidth(sal_uInt16 nIdx) const;
      41             :     void                SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth);
      42             : 
      43             :     inline sal_Bool         IsAutoWidth() const;
      44             :     void                SetAutoWidth(sal_Bool bOn = sal_True, sal_uInt16 lGutterWidth = 0);
      45             : 
      46             :     inline sal_Bool         HasLine() const;
      47             :     inline void         SetNoLine();
      48             : 
      49             :     void                SetLineWidthAndColor(::editeng::SvxBorderStyle eStyle, sal_uLong nWidth, const Color& rCol);
      50             :     inline ::editeng::SvxBorderStyle    GetLineStyle() const;
      51             :     inline sal_uLong        GetLineWidth() const;
      52             :     inline const Color& GetLineColor() const;
      53             : 
      54             :     inline SwColLineAdj GetAdjust() const;
      55             :     inline void         SetAdjust(SwColLineAdj);
      56             : 
      57             :     short               GetLineHeightPercent() const;
      58             :     void                SetLineHeightPercent(short nPercent);
      59             : 
      60             :     inline void         NoCols();
      61             :     void                Update();
      62             : 
      63           0 :     const SwFmtCol&     GetColumns() const { return aFmtCol; }
      64             : 
      65             :     void                SetActualWidth(sal_uInt16 nW);
      66           0 :     sal_uInt16              GetActualSize() const { return nWidth; }
      67             : 
      68             : 
      69             : private:
      70             : 
      71             :     SwFmtCol            aFmtCol;
      72             :     sal_uInt16              nWidth;
      73             : };
      74             : 
      75             : // INLINE METHOD --------------------------------------------------------
      76           0 : inline  sal_uInt16 SwColMgr::GetCount() const
      77             : {
      78           0 :     return aFmtCol.GetNumCols();
      79             : }
      80             : 
      81           0 : inline ::editeng::SvxBorderStyle SwColMgr::GetLineStyle() const
      82             : {
      83           0 :     return aFmtCol.GetLineStyle();
      84             : }
      85           0 : inline sal_uLong        SwColMgr::GetLineWidth() const
      86             : {
      87           0 :     return aFmtCol.GetLineWidth();
      88             : }
      89             : 
      90           0 : inline const Color& SwColMgr::GetLineColor() const
      91             : {
      92           0 :     return aFmtCol.GetLineColor();
      93             : }
      94             : 
      95           0 : inline  SwColLineAdj SwColMgr::GetAdjust() const
      96             : {
      97           0 :     return aFmtCol.GetLineAdj();
      98             : }
      99             : 
     100           0 : inline  void SwColMgr::SetAdjust(SwColLineAdj eAdj)
     101             : {
     102           0 :     aFmtCol.SetLineAdj(eAdj);
     103           0 : }
     104           0 : inline sal_Bool SwColMgr::IsAutoWidth() const
     105             : {
     106           0 :     return aFmtCol.IsOrtho();
     107             : }
     108           0 : inline void SwColMgr::SetAutoWidth(sal_Bool bOn, sal_uInt16 nGutterWidth)
     109             : {
     110           0 :     aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth);
     111           0 : }
     112             : 
     113           0 : inline void SwColMgr::NoCols()
     114             : {
     115           0 :     aFmtCol.GetColumns().clear();
     116           0 : }
     117           0 : inline sal_Bool SwColMgr::HasLine() const
     118             : {
     119           0 :     return GetAdjust() != COLADJ_NONE;
     120             : }
     121             : 
     122           0 : inline void SwColMgr::SetNoLine()
     123             : {
     124           0 :     SetAdjust(COLADJ_NONE);
     125           0 : }
     126             : 
     127             : #endif
     128             : 
     129             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10