1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_SW_SOURCE_UIBASE_INC_COLMGR_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_COLMGR_HXX
23 #include <fmtclds.hxx>
27 SW_DLLPUBLIC
void FitToActualSize(SwFormatCol
& rCol
, sal_uInt16 nWidth
);
29 class SW_DLLPUBLIC SwColMgr
32 // lActWidth is passed directly from the page dialogs edits
33 SwColMgr(const SfxItemSet
&rSet
);
36 inline sal_uInt16
GetCount() const;
37 void SetCount(sal_uInt16 nCount
, sal_uInt16 nGutterWidth
);
38 sal_uInt16
GetGutterWidth(sal_uInt16 nPos
= USHRT_MAX
) const;
39 void SetGutterWidth(sal_uInt16 nWidth
, sal_uInt16 nPos
= USHRT_MAX
);
41 sal_uInt16
GetColWidth(sal_uInt16 nIdx
) const;
42 void SetColWidth(sal_uInt16 nIdx
, sal_uInt16 nWidth
);
44 inline bool IsAutoWidth() const;
45 void SetAutoWidth(bool bOn
, sal_uInt16 lGutterWidth
= 0);
47 inline bool HasLine() const;
48 inline void SetNoLine();
50 void SetLineWidthAndColor(SvxBorderLineStyle eStyle
, sal_uLong nWidth
, const Color
& rCol
);
51 inline SvxBorderLineStyle
GetLineStyle() const;
52 inline sal_uLong
GetLineWidth() const;
53 inline const Color
& GetLineColor() const;
55 inline SwColLineAdj
GetAdjust() const;
56 inline void SetAdjust(SwColLineAdj
);
58 short GetLineHeightPercent() const;
59 void SetLineHeightPercent(short nPercent
);
63 const SwFormatCol
& GetColumns() const { return aFormatCol
; }
65 void SetActualWidth(sal_uInt16 nW
);
66 sal_uInt16
GetActualSize() const { return nWidth
; }
69 SwFormatCol aFormatCol
;
73 inline sal_uInt16
SwColMgr::GetCount() const
75 return aFormatCol
.GetNumCols();
78 inline SvxBorderLineStyle
SwColMgr::GetLineStyle() const
80 return aFormatCol
.GetLineStyle();
82 inline sal_uLong
SwColMgr::GetLineWidth() const
84 return aFormatCol
.GetLineWidth();
87 inline const Color
& SwColMgr::GetLineColor() const
89 return aFormatCol
.GetLineColor();
92 inline SwColLineAdj
SwColMgr::GetAdjust() const
94 return aFormatCol
.GetLineAdj();
97 inline void SwColMgr::SetAdjust(SwColLineAdj eAdj
)
99 aFormatCol
.SetLineAdj(eAdj
);
101 inline bool SwColMgr::IsAutoWidth() const
103 return aFormatCol
.IsOrtho();
105 inline void SwColMgr::SetAutoWidth(bool bOn
, sal_uInt16 nGutterWidth
)
107 aFormatCol
.SetOrtho(bOn
, nGutterWidth
, nWidth
);
110 inline void SwColMgr::NoCols()
112 aFormatCol
.GetColumns().clear();
114 inline bool SwColMgr::HasLine() const
116 return GetAdjust() != COLADJ_NONE
;
119 inline void SwColMgr::SetNoLine()
121 SetAdjust(COLADJ_NONE
);
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */