update dev300-m58
[ooovba.git] / sw / source / ui / inc / colmgr.hxx
blob03d78209182d96bcc56d85656d88687aee7cd51a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: colmgr.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _COLMGR_HXX
31 #define _COLMGR_HXX
33 #include "swdllapi.h"
34 #include <fmtclds.hxx>
36 SW_DLLPUBLIC void FitToActualSize(SwFmtCol& rCol, USHORT nWidth);
38 class SW_DLLPUBLIC SwColMgr
40 public:
41 // lActWidth wird aus den Edits des Seitendialogs
42 // direkt uebergeben
43 SwColMgr(const SfxItemSet &rSet, USHORT nActWidth = USHRT_MAX);
44 ~SwColMgr();
47 inline USHORT GetCount() const;
48 void SetCount(USHORT nCount, USHORT nGutterWidth);
49 USHORT GetGutterWidth(USHORT nPos = USHRT_MAX) const;
50 void SetGutterWidth(USHORT nWidth, USHORT nPos = USHRT_MAX);
52 USHORT GetColWidth(USHORT nIdx) const;
53 void SetColWidth(USHORT nIdx, USHORT nWidth);
55 inline BOOL IsAutoWidth() const;
56 void SetAutoWidth(BOOL bOn = TRUE, USHORT lGutterWidth = 0);
58 inline BOOL HasLine() const;
59 inline void SetNoLine();
61 inline void SetLineWidthAndColor(ULONG nWidth, const Color& rCol);
62 inline ULONG GetLineWidth() const;
63 inline const Color& GetLineColor() const;
65 inline SwColLineAdj GetAdjust() const;
66 inline void SetAdjust(SwColLineAdj);
68 short GetLineHeightPercent() const;
69 void SetLineHeightPercent(short nPercent);
71 inline void NoCols();
72 void Update();
74 const SwFmtCol& GetColumns() const { return aFmtCol; }
76 void SetActualWidth(USHORT nW);
77 USHORT GetActualSize() const { return nWidth; }
80 private:
82 SwFmtCol aFmtCol;
83 USHORT nWidth;
86 // INLINE METHODE --------------------------------------------------------
88 inline USHORT SwColMgr::GetCount() const
90 return aFmtCol.GetNumCols();
92 inline void SwColMgr::SetLineWidthAndColor(ULONG nLWidth, const Color& rCol)
94 aFmtCol.SetLineWidth(nLWidth);
95 aFmtCol.SetLineColor(rCol);
97 inline ULONG SwColMgr::GetLineWidth() const
99 return aFmtCol.GetLineWidth();
101 inline const Color& SwColMgr::GetLineColor() const
103 return aFmtCol.GetLineColor();
105 inline SwColLineAdj SwColMgr::GetAdjust() const
107 return aFmtCol.GetLineAdj();
109 inline void SwColMgr::SetAdjust(SwColLineAdj eAdj)
111 aFmtCol.SetLineAdj(eAdj);
113 inline BOOL SwColMgr::IsAutoWidth() const
115 return aFmtCol.IsOrtho();
117 inline void SwColMgr::SetAutoWidth(BOOL bOn, USHORT nGutterWidth)
119 aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth);
121 inline void SwColMgr::NoCols()
123 aFmtCol.GetColumns().DeleteAndDestroy(0, aFmtCol.GetColumns().Count());
125 inline BOOL SwColMgr::HasLine() const
127 return GetAdjust() != COLADJ_NONE;
129 inline void SwColMgr::SetNoLine()
131 SetAdjust(COLADJ_NONE);
134 #endif