Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / numinf.hxx
blobcea29a0c4a8d5a6daf88a0228e45d080fe3a5afe
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 <svl/itempool.hxx>
23 #include <svx/numfmtsh.hxx>
24 #include <svx/svxdllapi.h>
26 // class SvxNumberInfoItem -----------------------------------------------
31 This item is used as a transport medium for a number formatter
34 class SVX_DLLPUBLIC SvxNumberInfoItem : public SfxPoolItem
36 public:
37 TYPEINFO_OVERRIDE();
39 SvxNumberInfoItem( const sal_uInt16 nId );
40 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
41 const sal_uInt16 nId );
42 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const OUString& rVal,
43 const sal_uInt16 nId );
44 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
45 const sal_uInt16 nId );
46 // if both double and String are supplied, String is used for text formats
47 SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
48 const OUString& rValueStr, const sal_uInt16 nId );
49 SvxNumberInfoItem( const SvxNumberInfoItem& );
50 virtual ~SvxNumberInfoItem();
52 virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
53 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
54 virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const SAL_OVERRIDE;
55 virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
57 virtual bool GetPresentation( SfxItemPresentation ePres,
58 SfxMapUnit eCoreMetric,
59 SfxMapUnit ePresMetric,
60 OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
62 SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
63 const OUString& GetValueString() const { return aStringVal; }
64 double GetValueDouble() const { return nDoubleVal; }
66 const sal_uInt32* GetDelArray() const { return pDelFormatArr; }
67 void SetDelFormatArray( const sal_uInt32* pData,
68 const sal_uInt32 nCount );
70 SvxNumberValueType GetValueType() const { return eValueType; }
71 sal_uInt32 GetDelCount() const { return nDelCount; }
73 private:
74 SvNumberFormatter* pFormatter;
75 SvxNumberValueType eValueType;
76 OUString aStringVal;
77 double nDoubleVal;
79 sal_uInt32* pDelFormatArr;
80 sal_uInt32 nDelCount;
85 #endif
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */