LCOV - code coverage report
Current view: top level - sw/source/core/uibase/inc - colmgr.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 28 0.0 %
Date: 2014-04-11 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 INCLUDED_SW_SOURCE_UI_INC_COLMGR_HXX
      20             : #define INCLUDED_SW_SOURCE_UI_INC_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             :     inline sal_uInt16       GetCount() const;
      35             :     void                SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth);
      36             :     sal_uInt16              GetGutterWidth(sal_uInt16 nPos = USHRT_MAX) const;
      37             :     void                SetGutterWidth(sal_uInt16 nWidth, sal_uInt16 nPos = USHRT_MAX);
      38             : 
      39             :     sal_uInt16              GetColWidth(sal_uInt16 nIdx) const;
      40             :     void                SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth);
      41             : 
      42             :     inline sal_Bool         IsAutoWidth() const;
      43             :     void                SetAutoWidth(sal_Bool bOn = sal_True, sal_uInt16 lGutterWidth = 0);
      44             : 
      45             :     inline bool         HasLine() const;
      46             :     inline void         SetNoLine();
      47             : 
      48             :     void                SetLineWidthAndColor(::editeng::SvxBorderStyle eStyle, sal_uLong nWidth, const Color& rCol);
      49             :     inline ::editeng::SvxBorderStyle    GetLineStyle() const;
      50             :     inline sal_uLong        GetLineWidth() const;
      51             :     inline const Color& GetLineColor() const;
      52             : 
      53             :     inline SwColLineAdj GetAdjust() const;
      54             :     inline void         SetAdjust(SwColLineAdj);
      55             : 
      56             :     short               GetLineHeightPercent() const;
      57             :     void                SetLineHeightPercent(short nPercent);
      58             : 
      59             :     inline void         NoCols();
      60             :     void                Update();
      61             : 
      62           0 :     const SwFmtCol&     GetColumns() const { return aFmtCol; }
      63             : 
      64             :     void                SetActualWidth(sal_uInt16 nW);
      65           0 :     sal_uInt16              GetActualSize() const { return nWidth; }
      66             : 
      67             : private:
      68             : 
      69             :     SwFmtCol            aFmtCol;
      70             :     sal_uInt16              nWidth;
      71             : };
      72             : 
      73             : // INLINE METHOD --------------------------------------------------------
      74           0 : inline  sal_uInt16 SwColMgr::GetCount() const
      75             : {
      76           0 :     return aFmtCol.GetNumCols();
      77             : }
      78             : 
      79           0 : inline ::editeng::SvxBorderStyle SwColMgr::GetLineStyle() const
      80             : {
      81           0 :     return aFmtCol.GetLineStyle();
      82             : }
      83           0 : inline sal_uLong        SwColMgr::GetLineWidth() const
      84             : {
      85           0 :     return aFmtCol.GetLineWidth();
      86             : }
      87             : 
      88           0 : inline const Color& SwColMgr::GetLineColor() const
      89             : {
      90           0 :     return aFmtCol.GetLineColor();
      91             : }
      92             : 
      93           0 : inline  SwColLineAdj SwColMgr::GetAdjust() const
      94             : {
      95           0 :     return aFmtCol.GetLineAdj();
      96             : }
      97             : 
      98           0 : inline  void SwColMgr::SetAdjust(SwColLineAdj eAdj)
      99             : {
     100           0 :     aFmtCol.SetLineAdj(eAdj);
     101           0 : }
     102           0 : inline sal_Bool SwColMgr::IsAutoWidth() const
     103             : {
     104           0 :     return aFmtCol.IsOrtho();
     105             : }
     106           0 : inline void SwColMgr::SetAutoWidth(sal_Bool bOn, sal_uInt16 nGutterWidth)
     107             : {
     108           0 :     aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth);
     109           0 : }
     110             : 
     111           0 : inline void SwColMgr::NoCols()
     112             : {
     113           0 :     aFmtCol.GetColumns().clear();
     114           0 : }
     115           0 : inline bool SwColMgr::HasLine() const
     116             : {
     117           0 :     return GetAdjust() != COLADJ_NONE;
     118             : }
     119             : 
     120           0 : inline void SwColMgr::SetNoLine()
     121             : {
     122           0 :     SetAdjust(COLADJ_NONE);
     123           0 : }
     124             : 
     125             : #endif
     126             : 
     127             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10