xref: /aoo4110/main/editeng/inc/editeng/protitem.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_PROTITEM_HXX
24 #define _SVX_PROTITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 
29 #include <svl/poolitem.hxx>
30 #include "editeng/editengdllapi.h"
31 
32 class SvXMLUnitConverter;
33 namespace rtl
34 {
35 	class OUString;
36 }
37 
38 // class SvxProtectItem --------------------------------------------------
39 
40 
41 /*
42 [Beschreibung]
43 Dieses Item beschreibt, ob Inhalt, Groesse oder Position geschuetzt werden
44 sollen.
45 */
46 
47 class EDITENG_DLLPUBLIC SvxProtectItem : public SfxPoolItem
48 {
49 	sal_Bool bCntnt :1;     //Inhalt geschuetzt
50 	sal_Bool bSize  :1;     //Groesse geschuetzt
51 	sal_Bool bPos   :1;     //Position geschuetzt
52 
53 public:
54 	TYPEINFO();
55 
56     inline SvxProtectItem( const sal_uInt16 nId  );
57 	inline SvxProtectItem &operator=( const SvxProtectItem &rCpy );
58 
59 	// "pure virtual Methoden" vom SfxPoolItem
60 	virtual int 			 operator==( const SfxPoolItem& ) const;
61 
62 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
63 									SfxMapUnit eCoreMetric,
64 									SfxMapUnit ePresMetric,
65                                     String &rText, const IntlWrapper * = 0 ) const;
66 
67 
68 	virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
69 	virtual SfxPoolItem*	 Create(SvStream &, sal_uInt16) const;
70 	virtual SvStream&		 Store(SvStream &, sal_uInt16 nItemVersion ) const;
71 
IsCntntProtected() const72 	sal_Bool IsCntntProtected() const { return bCntnt; }
IsSizeProtected() const73 	sal_Bool IsSizeProtected()  const { return bSize;  }
IsPosProtected() const74 	sal_Bool IsPosProtected()   const { return bPos;   }
SetCntntProtect(sal_Bool bNew)75 	void SetCntntProtect( sal_Bool bNew ) { bCntnt = bNew; }
SetSizeProtect(sal_Bool bNew)76 	void SetSizeProtect ( sal_Bool bNew ) { bSize  = bNew; }
SetPosProtect(sal_Bool bNew)77 	void SetPosProtect  ( sal_Bool bNew ) { bPos   = bNew; }
78 
79 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
80 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
81 };
82 
SvxProtectItem(const sal_uInt16 nId)83 inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId )
84 	: SfxPoolItem( nId )
85 {
86 	bCntnt = bSize = bPos = sal_False;
87 }
88 
operator =(const SvxProtectItem & rCpy)89 inline SvxProtectItem &SvxProtectItem::operator=( const SvxProtectItem &rCpy )
90 {
91 	bCntnt = rCpy.IsCntntProtected();
92 	bSize  = rCpy.IsSizeProtected();
93 	bPos   = rCpy.IsPosProtected();
94 	return *this;
95 }
96 
97 
98 
99 
100 #endif
101 
102