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