2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2014-06-03 10:01:18 +02:00
|
|
|
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_COLMGR_HXX
|
|
|
|
#define INCLUDED_SW_SOURCE_UIBASE_INC_COLMGR_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 07:57:34 +00:00
|
|
|
#include "swdllapi.h"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <fmtclds.hxx>
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
SW_DLLPUBLIC void FitToActualSize(SwFormatCol& rCol, sal_uInt16 nWidth);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 07:57:34 +00:00
|
|
|
class SW_DLLPUBLIC SwColMgr
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-04-21 16:51:03 +02:00
|
|
|
// lActWidth is passed directly from the page dialogs edits
|
2011-01-17 15:06:54 +01:00
|
|
|
SwColMgr(const SfxItemSet &rSet, sal_uInt16 nActWidth = USHRT_MAX);
|
2000-09-18 16:15:01 +00:00
|
|
|
~SwColMgr();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetCount() const;
|
|
|
|
void SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth);
|
|
|
|
sal_uInt16 GetGutterWidth(sal_uInt16 nPos = USHRT_MAX) const;
|
|
|
|
void SetGutterWidth(sal_uInt16 nWidth, sal_uInt16 nPos = USHRT_MAX);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const;
|
|
|
|
void SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool IsAutoWidth() const;
|
|
|
|
void SetAutoWidth(bool bOn = true, sal_uInt16 lGutterWidth = 0);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-01-26 20:14:11 +09:00
|
|
|
inline bool HasLine() const;
|
2000-09-18 16:15:01 +00:00
|
|
|
inline void SetNoLine();
|
|
|
|
|
2011-03-25 15:51:54 +01:00
|
|
|
void SetLineWidthAndColor(::editeng::SvxBorderStyle eStyle, sal_uLong nWidth, const Color& rCol);
|
|
|
|
inline ::editeng::SvxBorderStyle GetLineStyle() const;
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uLong GetLineWidth() const;
|
2000-09-18 16:15:01 +00:00
|
|
|
inline const Color& GetLineColor() const;
|
|
|
|
|
|
|
|
inline SwColLineAdj GetAdjust() const;
|
|
|
|
inline void SetAdjust(SwColLineAdj);
|
|
|
|
|
|
|
|
short GetLineHeightPercent() const;
|
|
|
|
void SetLineHeightPercent(short nPercent);
|
|
|
|
|
|
|
|
inline void NoCols();
|
|
|
|
void Update();
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
const SwFormatCol& GetColumns() const { return aFormatCol; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetActualWidth(sal_uInt16 nW);
|
|
|
|
sal_uInt16 GetActualSize() const { return nWidth; }
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2015-05-20 13:05:49 +02:00
|
|
|
SwFormatCol aFormatCol;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nWidth;
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 SwColMgr::GetCount() const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.GetNumCols();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2011-03-25 15:51:54 +01:00
|
|
|
inline ::editeng::SvxBorderStyle SwColMgr::GetLineStyle() const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.GetLineStyle();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uLong SwColMgr::GetLineWidth() const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.GetLineWidth();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
inline const Color& SwColMgr::GetLineColor() const
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.GetLineColor();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
inline SwColLineAdj SwColMgr::GetAdjust() const
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.GetLineAdj();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
inline void SwColMgr::SetAdjust(SwColLineAdj eAdj)
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
aFormatCol.SetLineAdj(eAdj);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
inline bool SwColMgr::IsAutoWidth() const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
return aFormatCol.IsOrtho();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2014-04-25 14:00:35 +02:00
|
|
|
inline void SwColMgr::SetAutoWidth(bool bOn, sal_uInt16 nGutterWidth)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
aFormatCol.SetOrtho(bOn, nGutterWidth, nWidth);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
inline void SwColMgr::NoCols()
|
|
|
|
{
|
2015-05-20 13:05:49 +02:00
|
|
|
aFormatCol.GetColumns().clear();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2013-01-26 20:14:11 +09:00
|
|
|
inline bool SwColMgr::HasLine() const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
return GetAdjust() != COLADJ_NONE;
|
|
|
|
}
|
2010-10-13 10:32:10 +05:30
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
inline void SwColMgr::SetNoLine()
|
|
|
|
{
|
|
|
|
SetAdjust(COLADJ_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|