xref: /trunk/main/svx/inc/svx/numinf.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_NUMINF_HXX
24cdf0e10cSrcweir #define _SVX_NUMINF_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // include ---------------------------------------------------------------
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <svl/itempool.hxx>
29cdf0e10cSrcweir #include <svx/numfmtsh.hxx>
30cdf0e10cSrcweir #include "svx/svxdllapi.h"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // class SvxNumberInfoItem -----------------------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir /*
37cdf0e10cSrcweir [Beschreibung]
38cdf0e10cSrcweir Dieses Item dient als Transport-Medium fuer einen Number-Formatter.
39cdf0e10cSrcweir */
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SVX_DLLPUBLIC SvxNumberInfoItem : public SfxPoolItem
42cdf0e10cSrcweir {
43cdf0e10cSrcweir public:
44cdf0e10cSrcweir     TYPEINFO();
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     SvxNumberInfoItem( const sal_uInt16 nId  );
47cdf0e10cSrcweir     SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
48cdf0e10cSrcweir                        const sal_uInt16 nId  );
49cdf0e10cSrcweir     SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const String& rVal,
50cdf0e10cSrcweir                        const sal_uInt16 nId  );
51cdf0e10cSrcweir     SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
52cdf0e10cSrcweir                        const sal_uInt16 nId  );
53cdf0e10cSrcweir     // if both double and String are supplied, String is used for text formats
54cdf0e10cSrcweir     SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal,
55cdf0e10cSrcweir                        const String& rValueStr, const sal_uInt16 nId );
56cdf0e10cSrcweir     SvxNumberInfoItem( const SvxNumberInfoItem& );
57cdf0e10cSrcweir     ~SvxNumberInfoItem();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     virtual int              operator==( const SfxPoolItem& ) const;
60cdf0e10cSrcweir     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
61cdf0e10cSrcweir     virtual SfxPoolItem*     Create( SvStream& rStream, sal_uInt16 nVer ) const;
62cdf0e10cSrcweir     virtual SvStream&        Store( SvStream& , sal_uInt16 nItemVersion ) const;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
65cdf0e10cSrcweir                                     SfxMapUnit eCoreMetric,
66cdf0e10cSrcweir                                     SfxMapUnit ePresMetric,
67cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
68cdf0e10cSrcweir 
GetNumberFormatter() const69cdf0e10cSrcweir     SvNumberFormatter*      GetNumberFormatter() const { return pFormatter; }
70cdf0e10cSrcweir     void                    SetNumberFormatter( SvNumberFormatter* pNumFrmt );
GetValueString() const71cdf0e10cSrcweir     const String&           GetValueString() const { return aStringVal; }
72cdf0e10cSrcweir     void                    SetStringValue( const String& rNewVal );
GetValueDouble() const73cdf0e10cSrcweir     double                  GetValueDouble() const  { return nDoubleVal; }
74cdf0e10cSrcweir     void                    SetDoubleValue( const double& rNewVal );
75cdf0e10cSrcweir 
GetDelArray() const76cdf0e10cSrcweir     const sal_uInt32*       GetDelArray() const { return pDelFormatArr; }
77cdf0e10cSrcweir     void                    SetDelFormatArray( const sal_uInt32* pData,
78cdf0e10cSrcweir                                                const sal_uInt32  nCount );
79cdf0e10cSrcweir 
GetValueType() const80cdf0e10cSrcweir     SvxNumberValueType      GetValueType() const { return eValueType; }
GetDelCount() const81cdf0e10cSrcweir     sal_uInt32              GetDelCount() const  { return nDelCount; }
82cdf0e10cSrcweir 
83cdf0e10cSrcweir private:
84cdf0e10cSrcweir     SvNumberFormatter*  pFormatter;
85cdf0e10cSrcweir     SvxNumberValueType  eValueType;
86cdf0e10cSrcweir     String              aStringVal;
87cdf0e10cSrcweir     double              nDoubleVal;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     sal_uInt32*         pDelFormatArr;
90cdf0e10cSrcweir     sal_uInt32          nDelCount;
91cdf0e10cSrcweir };
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir #endif
96