xref: /trunk/main/svl/inc/svl/aeitem.hxx (revision 39a19a47)
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 _AEITEM_HXX
24 #define _AEITEM_HXX
25 
26 #include "svl/svldllapi.h"
27 #include <svl/poolitem.hxx>
28 #include <svl/eitem.hxx>
29 
30 class SfxAllEnumValueArr;
31 class SvUShorts;
32 
33 class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem
34 {
35 	SfxAllEnumValueArr*		pValues;
36 	SvUShorts*				pDisabledValues;
37 
38 protected:
39 	sal_uInt16					_GetPosByValue( sal_uInt16 nValue ) const;
40 
41 public:
42 	TYPEINFO();
43 							SfxAllEnumItem();
44                             SfxAllEnumItem( sal_uInt16 nWhich);
45 							SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal );
46 							SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal, const XubString &rText );
47 							SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream );
48 							SfxAllEnumItem( const SfxAllEnumItem & );
49 							~SfxAllEnumItem();
50 
51 	void                    InsertValue( sal_uInt16 nValue );
52 	void					InsertValue( sal_uInt16 nValue, const XubString &rText );
53 	void                    RemoveValue( sal_uInt16 nValue );
54 	void					RemoveAllValues();
55 
56 	sal_uInt16					GetPosByValue( sal_uInt16 nValue ) const;
57 
58 	virtual sal_uInt16			GetValueCount() const;
59 	virtual sal_uInt16			GetValueByPos( sal_uInt16 nPos ) const;
60 	virtual XubString		GetValueTextByPos( sal_uInt16 nPos ) const;
61 	virtual SfxPoolItem*	Clone( SfxItemPool *pPool = 0 ) const;
62 	virtual SfxPoolItem*	Create(SvStream &, sal_uInt16 nVersion) const;
63 	virtual sal_Bool			IsEnabled( sal_uInt16 ) const;
64 	void					DisableValue( sal_uInt16 );
65 };
66 
67 #endif
68