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_SVX_ALGITEM_HXX 20 #define INCLUDED_SVX_ALGITEM_HXX 21 22 #include <editeng/svxenum.hxx> 23 #include <rtl/ustring.hxx> 24 #include <sal/types.h> 25 #include <svl/poolitem.hxx> 26 #include <svl/eitem.hxx> 27 #include <svx/svxdllapi.h> 28 29 class IntlWrapper; 30 class SfxItemPool; 31 32 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem final : public SfxEnumItem<SvxCellOrientation> 33 { 34 public: 35 SvxOrientationItem( 36 const SvxCellOrientation eOrientation, 37 const sal_uInt16 nId ); 38 39 SvxOrientationItem( 40 sal_Int32 nRotation, bool bStacked, 41 const sal_uInt16 nId ); 42 43 virtual bool GetPresentation( SfxItemPresentation ePres, 44 MapUnit eCoreMetric, 45 MapUnit ePresMetric, 46 OUString &rText, const IntlWrapper& ) const override; 47 48 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; 49 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; 50 51 virtual sal_uInt16 GetValueCount() const override; 52 static OUString GetValueText( SvxCellOrientation nVal ); 53 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; 54 55 /** Returns sal_True, if the item represents STACKED state. */ 56 bool IsStacked() const; 57 /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */ 58 sal_Int32 GetRotation( sal_Int32 nStdAngle ) const; 59 }; 60 61 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxMarginItem final : public SfxPoolItem 62 { 63 sal_Int16 nLeftMargin; 64 sal_Int16 nTopMargin; 65 sal_Int16 nRightMargin; 66 sal_Int16 nBottomMargin; 67 public: 68 static SfxPoolItem* CreateDefault(); 69 SvxMarginItem( const sal_uInt16 nId ); 70 SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/, 71 sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/, 72 const sal_uInt16 nId ); 73 74 virtual bool GetPresentation( SfxItemPresentation ePres, 75 MapUnit eCoreMetric, 76 MapUnit ePresMetric, 77 OUString &rText, const IntlWrapper& ) const override; 78 79 virtual bool operator==( const SfxPoolItem& ) const override; 80 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; 81 82 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; 83 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; 84 GetLeftMargin() const85 sal_Int16 GetLeftMargin() const {return nLeftMargin; } 86 void SetLeftMargin(sal_Int16 nLeft); GetTopMargin() const87 sal_Int16 GetTopMargin() const {return nTopMargin; } 88 void SetTopMargin(sal_Int16 nTop); GetRightMargin() const89 sal_Int16 GetRightMargin() const {return nRightMargin; } 90 void SetRightMargin(sal_Int16 nRight); GetBottomMargin() const91 sal_Int16 GetBottomMargin() const {return nBottomMargin; } 92 void SetBottomMargin(sal_Int16 nBottom); 93 }; 94 95 #endif 96 97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 98