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 SW_DLLPUBLIC void FitToActualSize(SwFormatCol& rCol, sal_uInt16 nWidth);
26 
28 {
29 public:
30  // lActWidth is passed directly from the page dialogs edits
31  SwColMgr(const SfxItemSet &rSet);
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 bool IsAutoWidth() const;
43  void SetAutoWidth(bool bOn, sal_uInt16 lGutterWidth = 0);
44 
45  inline bool HasLine() const;
46  inline void SetNoLine();
47 
48  void SetLineWidthAndColor(SvxBorderLineStyle eStyle, sal_uLong nWidth, const Color& rCol);
49  inline SvxBorderLineStyle 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 
61  const SwFormatCol& GetColumns() const { return aFormatCol; }
62 
63  void SetActualWidth(sal_uInt16 nW);
64  sal_uInt16 GetActualSize() const { return nWidth; }
65 
66 private:
68  sal_uInt16 nWidth;
69 };
70 
71 inline sal_uInt16 SwColMgr::GetCount() const
72 {
73  return aFormatCol.GetNumCols();
74 }
75 
77 {
78  return aFormatCol.GetLineStyle();
79 }
81 {
82  return aFormatCol.GetLineWidth();
83 }
84 
85 inline const Color& SwColMgr::GetLineColor() const
86 {
87  return aFormatCol.GetLineColor();
88 }
89 
91 {
92  return aFormatCol.GetLineAdj();
93 }
94 
96 {
97  aFormatCol.SetLineAdj(eAdj);
98 }
99 inline bool SwColMgr::IsAutoWidth() const
100 {
101  return aFormatCol.IsOrtho();
102 }
103 inline void SwColMgr::SetAutoWidth(bool bOn, sal_uInt16 nGutterWidth)
104 {
105  aFormatCol.SetOrtho(bOn, nGutterWidth, nWidth);
106 }
107 
108 inline void SwColMgr::NoCols()
109 {
110  aFormatCol.GetColumns().clear();
111 }
112 inline bool SwColMgr::HasLine() const
113 {
114  return GetAdjust() != COLADJ_NONE;
115 }
116 
117 inline void SwColMgr::SetNoLine()
118 {
120 }
121 
122 #endif
123 
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const Color & GetLineColor() const
Definition: colmgr.hxx:85
bool IsOrtho() const
Definition: fmtclds.hxx:121
sal_uIntPtr sal_uLong
sal_uLong GetLineWidth() const
Definition: colmgr.hxx:80
const Color & GetLineColor() const
Definition: fmtclds.hxx:118
SvxBorderLineStyle GetLineStyle() const
Definition: fmtclds.hxx:116
void SetOrtho(bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This too re-arranges columns automatically if flag is set.
Definition: atrfrm.cxx:962
void SetLineAdj(SwColLineAdj eNew)
Definition: fmtclds.hxx:133
SvxBorderLineStyle
bool IsAutoWidth() const
Definition: colmgr.hxx:99
sal_uInt16 nWidth
Definition: colmgr.hxx:68
bool HasLine() const
Definition: colmgr.hxx:112
sal_uInt16 GetActualSize() const
Definition: colmgr.hxx:64
const SwFormatCol & GetColumns() const
Definition: colmgr.hxx:61
void SetNoLine()
Definition: colmgr.hxx:117
SW_DLLPUBLIC void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
SvxBorderLineStyle GetLineStyle() const
Definition: colmgr.hxx:76
void SetAutoWidth(bool bOn, sal_uInt16 lGutterWidth=0)
Definition: colmgr.hxx:103
SwFormatCol aFormatCol
Definition: colmgr.hxx:67
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SwColLineAdj GetAdjust() const
Definition: colmgr.hxx:90
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:259
sal_uLong GetLineWidth() const
Definition: fmtclds.hxx:117
void SetAdjust(SwColLineAdj)
Definition: colmgr.hxx:95
void NoCols()
Definition: colmgr.hxx:108
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
SwColLineAdj
Definition: fmtclds.hxx:59
sal_uInt16 GetCount() const
Definition: colmgr.hxx:71
sal_Int32 nPos
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120