Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / numinf.hxx
blob58a503fb74dcbff322f38ea650d4efadfdd25e7b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_NUMINF_HXX
20 #define INCLUDED_SVX_NUMINF_HXX
22 #include <memory>
23 #include <svl/poolitem.hxx>
24 #include <svx/numfmtsh.hxx>
25 #include <svx/svxdllapi.h>
27 // class SvxNumberInfoItem -----------------------------------------------
31 This item is used as a transport medium for a number formatter
34 class SVX_DLLPUBLIC SvxNumberInfoItem : public SfxPoolItem
36 public:
38 SvxNumberInfoItem( const sal_uInt16 nId );
39 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
40 const sal_uInt16 nId );
41 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const OUString& rVal,
42 const sal_uInt16 nId );
43 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
44 const sal_uInt16 nId );
45 // if both double and String are supplied, String is used for text formats
46 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
47 const OUString& rValueStr, const sal_uInt16 nId );
48 SvxNumberInfoItem( const SvxNumberInfoItem& );
49 virtual ~SvxNumberInfoItem() override;
51 virtual bool operator==( const SfxPoolItem& ) const override;
52 virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
53 virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const override;
54 virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const override;
56 virtual bool GetPresentation( SfxItemPresentation ePres,
57 MapUnit eCoreMetric,
58 MapUnit ePresMetric,
59 OUString &rText, const IntlWrapper * = nullptr ) const override;
61 SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
62 const OUString& GetValueString() const { return aStringVal; }
63 double GetValueDouble() const { return nDoubleVal; }
65 const sal_uInt32* GetDelArray() const { return pDelFormatArr.get(); }
66 void SetDelFormatArray( const sal_uInt32* pData,
67 const sal_uInt32 nCount );
69 SvxNumberValueType GetValueType() const { return eValueType; }
70 sal_uInt32 GetDelCount() const { return nDelCount; }
72 private:
73 SvNumberFormatter* pFormatter;
74 SvxNumberValueType eValueType;
75 OUString aStringVal;
76 double nDoubleVal;
78 std::unique_ptr<sal_uInt32[]>
79 pDelFormatArr;
80 sal_uInt32 nDelCount;
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */