bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / colmgr.hxx
blob98690bcbe49efda9aa647e722de130e40c6b2193
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _COLMGR_HXX
20 #define _COLMGR_HXX
22 #include "swdllapi.h"
23 #include <fmtclds.hxx>
25 SW_DLLPUBLIC void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth);
27 class SW_DLLPUBLIC SwColMgr
29 public:
30 // lActWidth is passed directly from the page dialogs edits
31 SwColMgr(const SfxItemSet &rSet, sal_uInt16 nActWidth = USHRT_MAX);
32 ~SwColMgr();
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);
40 sal_uInt16 GetColWidth(sal_uInt16 nIdx) const;
41 void SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth);
43 inline sal_Bool IsAutoWidth() const;
44 void SetAutoWidth(sal_Bool bOn = sal_True, sal_uInt16 lGutterWidth = 0);
46 inline bool HasLine() const;
47 inline void SetNoLine();
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;
54 inline SwColLineAdj GetAdjust() const;
55 inline void SetAdjust(SwColLineAdj);
57 short GetLineHeightPercent() const;
58 void SetLineHeightPercent(short nPercent);
60 inline void NoCols();
61 void Update();
63 const SwFmtCol& GetColumns() const { return aFmtCol; }
65 void SetActualWidth(sal_uInt16 nW);
66 sal_uInt16 GetActualSize() const { return nWidth; }
69 private:
71 SwFmtCol aFmtCol;
72 sal_uInt16 nWidth;
75 // INLINE METHOD --------------------------------------------------------
76 inline sal_uInt16 SwColMgr::GetCount() const
78 return aFmtCol.GetNumCols();
81 inline ::editeng::SvxBorderStyle SwColMgr::GetLineStyle() const
83 return aFmtCol.GetLineStyle();
85 inline sal_uLong SwColMgr::GetLineWidth() const
87 return aFmtCol.GetLineWidth();
90 inline const Color& SwColMgr::GetLineColor() const
92 return aFmtCol.GetLineColor();
95 inline SwColLineAdj SwColMgr::GetAdjust() const
97 return aFmtCol.GetLineAdj();
100 inline void SwColMgr::SetAdjust(SwColLineAdj eAdj)
102 aFmtCol.SetLineAdj(eAdj);
104 inline sal_Bool SwColMgr::IsAutoWidth() const
106 return aFmtCol.IsOrtho();
108 inline void SwColMgr::SetAutoWidth(sal_Bool bOn, sal_uInt16 nGutterWidth)
110 aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth);
113 inline void SwColMgr::NoCols()
115 aFmtCol.GetColumns().clear();
117 inline bool SwColMgr::HasLine() const
119 return GetAdjust() != COLADJ_NONE;
122 inline void SwColMgr::SetNoLine()
124 SetAdjust(COLADJ_NONE);
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */