LibreOffice Module sw (master) 1
colmgr.hxx
Go to the documentation of this file.
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_UIBASE_INC_COLMGR_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_COLMGR_HXX
21
22#include <swdllapi.h>
23#include <fmtclds.hxx>
24
25#include <climits>
26
27SW_DLLPUBLIC void FitToActualSize(SwFormatCol& rCol, sal_uInt16 nWidth);
28
30{
31public:
32 // lActWidth is passed directly from the page dialogs edits
33 SwColMgr(const SfxItemSet &rSet);
34 ~SwColMgr();
35
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);
40
41 sal_uInt16 GetColWidth(sal_uInt16 nIdx) const;
42 void SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth);
43
44 inline bool IsAutoWidth() const;
45 void SetAutoWidth(bool bOn, sal_uInt16 lGutterWidth = 0);
46
47 inline bool HasLine() const;
48 inline void SetNoLine();
49
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;
54
55 inline SwColLineAdj GetAdjust() const;
56 inline void SetAdjust(SwColLineAdj);
57
58 short GetLineHeightPercent() const;
59 void SetLineHeightPercent(short nPercent);
60
61 inline void NoCols();
62
63 const SwFormatCol& GetColumns() const { return m_aFormatCol; }
64
65 void SetActualWidth(sal_uInt16 nW);
66 sal_uInt16 GetActualSize() const { return m_nWidth; }
67
68private:
70 sal_uInt16 m_nWidth;
71};
72
73inline sal_uInt16 SwColMgr::GetCount() const
74{
75 return m_aFormatCol.GetNumCols();
76}
77
79{
81}
83{
85}
86
87inline const Color& SwColMgr::GetLineColor() const
88{
90}
91
93{
94 return m_aFormatCol.GetLineAdj();
95}
96
98{
100}
101inline bool SwColMgr::IsAutoWidth() const
102{
103 return m_aFormatCol.IsOrtho();
104}
105inline void SwColMgr::SetAutoWidth(bool bOn, sal_uInt16 nGutterWidth)
106{
107 m_aFormatCol.SetOrtho(bOn, nGutterWidth, m_nWidth);
108}
109
110inline void SwColMgr::NoCols()
111{
112 m_aFormatCol.GetColumns().clear();
113}
114inline bool SwColMgr::HasLine() const
115{
116 return GetAdjust() != COLADJ_NONE;
117}
118
120{
122}
123
124#endif
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBorderLineStyle
void SetAutoWidth(bool bOn, sal_uInt16 lGutterWidth=0)
Definition: colmgr.hxx:105
SvxBorderLineStyle GetLineStyle() const
Definition: colmgr.hxx:78
sal_uInt16 GetActualSize() const
Definition: colmgr.hxx:66
const Color & GetLineColor() const
Definition: colmgr.hxx:87
sal_uInt16 GetCount() const
Definition: colmgr.hxx:73
sal_uLong GetLineWidth() const
Definition: colmgr.hxx:82
bool IsAutoWidth() const
Definition: colmgr.hxx:101
SwFormatCol m_aFormatCol
Definition: colmgr.hxx:69
bool HasLine() const
Definition: colmgr.hxx:114
void NoCols()
Definition: colmgr.hxx:110
const SwFormatCol & GetColumns() const
Definition: colmgr.hxx:63
sal_uInt16 m_nWidth
Definition: colmgr.hxx:70
void SetAdjust(SwColLineAdj)
Definition: colmgr.hxx:97
SwColLineAdj GetAdjust() const
Definition: colmgr.hxx:92
void SetNoLine()
Definition: colmgr.hxx:119
void SetOrtho(bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This too re-arranges columns automatically if flag is set.
Definition: atrfrm.cxx:984
bool IsOrtho() const
Definition: fmtclds.hxx:121
const Color & GetLineColor() const
Definition: fmtclds.hxx:118
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
SvxBorderLineStyle GetLineStyle() const
Definition: fmtclds.hxx:116
void SetLineAdj(SwColLineAdj eNew)
Definition: fmtclds.hxx:133
sal_uLong GetLineWidth() const
Definition: fmtclds.hxx:117
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
SW_DLLPUBLIC void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
int nCount
SwColLineAdj
Definition: fmtclds.hxx:60
@ COLADJ_NONE
Definition: fmtclds.hxx:61
sal_uInt16 nPos
Color GetLineColor(Color const &rColor, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
#define SW_DLLPUBLIC
Definition: swdllapi.h:28