From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- include/svx/rulritem.hxx | 232 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 include/svx/rulritem.hxx (limited to 'include/svx/rulritem.hxx') diff --git a/include/svx/rulritem.hxx b/include/svx/rulritem.hxx new file mode 100644 index 000000000..2f0df198f --- /dev/null +++ b/include/svx/rulritem.hxx @@ -0,0 +1,232 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ +#ifndef INCLUDED_SVX_RULRITEM_HXX +#define INCLUDED_SVX_RULRITEM_HXX + +#include +#include +#include +#include + +class SVX_DLLPUBLIC SvxLongLRSpaceItem final : public SfxPoolItem +{ + long mlLeft; // nLeft or the negative first-line indentation + long mlRight; // the unproblematic right edge + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxLongLRSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId); + SvxLongLRSpaceItem(); + + long GetLeft() const { return mlLeft;} + long GetRight() const { return mlRight;} + void SetLeft(long lArgLeft); + void SetRight(long lArgRight); +}; + +class SVX_DLLPUBLIC SvxLongULSpaceItem final : public SfxPoolItem +{ + long mlLeft; // nLeft or the negative first-line indentation + long mlRight; // the unproblematic right edge + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxLongULSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId); + SvxLongULSpaceItem(); + + long GetUpper() const { return mlLeft;} + long GetLower() const { return mlRight;} + void SetUpper(long lArgLeft); + void SetLower(long lArgRight); +}; + +class SVX_DLLPUBLIC SvxPagePosSizeItem final : public SfxPoolItem +{ + Point aPos; + long lWidth; + long lHeight; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxPagePosSizeItem* Clone( SfxItemPool *pPool = nullptr ) const override; + +private: + const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) = delete; +public: + static SfxPoolItem* CreateDefault(); + SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight); + SvxPagePosSizeItem(); + + const Point &GetPos() const { return aPos; } + long GetWidth() const { return lWidth; } + long GetHeight() const { return lHeight; } +}; + +struct SVX_DLLPUBLIC SvxColumnDescription +{ + long nStart; /* Start of the column */ + long nEnd; /* End of the column */ + bool bVisible; /* Visibility */ + + long nEndMin; //min. possible position of end + long nEndMax; //max. possible position of end + + SvxColumnDescription(long start, long end, bool bVis); + + SvxColumnDescription(long start, long end, + long endMin, long endMax, bool bVis); + + bool operator==(const SvxColumnDescription &rCmp) const; + bool operator!=(const SvxColumnDescription &rCmp) const; + long GetWidth() const; +}; + +template +inline std::basic_ostream & operator <<( + std::basic_ostream & stream, SvxColumnDescription const& dsc) +{ + return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd + << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin + << " nEndMax " << dsc.nEndMax << " }"; +} + + +class SVX_DLLPUBLIC SvxColumnItem final : public SfxPoolItem +{ + std::vector aColumns; // Column array + + long nLeft; // Left edge for the table + long nRight; // Right edge for the table; for columns always + // equal to the surrounding frame + sal_uInt16 nActColumn; // the current column + bool bTable; // table? + bool bOrtho; // evenly spread columns + + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, + const IntlWrapper& ) const override; + + virtual SvxColumnItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + +public: + static SfxPoolItem* CreateDefault(); + // right edge of the surrounding frame + // nLeft, nRight each the distance to the surrounding frame + SvxColumnItem(sal_uInt16 nAct = 0); + SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders + + SvxColumnDescription& operator[](sal_uInt16 index); + const SvxColumnDescription& operator[](sal_uInt16 index) const; + SvxColumnDescription& At(sal_uInt16 index); + SvxColumnDescription& GetActiveColumnDescription(); + + sal_uInt16 Count() const; + void Append(const SvxColumnDescription& rDesc); + void SetLeft(long aLeft); + void SetRight(long aRight); + sal_uInt16 GetActColumn() const { return nActColumn;} + bool IsFirstAct() const; + bool IsLastAct() const; + long GetLeft() const { return nLeft;} + long GetRight() const { return nRight;} + bool IsTable() const { return bTable;} + bool CalcOrtho() const; + void SetOrtho(bool bVal); + bool IsConsistent() const; +}; + +class SVX_DLLPUBLIC SvxObjectItem final : public SfxPoolItem +{ + long nStartX; /* Start in x direction */ + long nEndX; /* End in x direction */ + long nStartY; /* Start in y direction */ + long nEndY; /* End in y direction */ + bool bLimits; /* boundary limit control by the application */ + + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxObjectItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const SvxObjectItem &operator=(const SvxObjectItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxObjectItem(long nStartX, long nEndX, + long nStartY, long nEndY); + + long GetStartX() const { return nStartX;} + long GetEndX() const { return nEndX;} + long GetStartY() const { return nStartY;} + long GetEndY() const { return nEndY;} + + void SetStartX(long lValue); + void SetEndX(long lValue); + void SetStartY(long lValue); + void SetEndY(long lValue); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3