xref: /trunk/main/sc/source/ui/inc/pntlock.hxx (revision 38d50f7b)
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 
24 #ifndef SC_PNTLOCK_HXX
25 #define SC_PNTLOCK_HXX
26 
27 #include "rangelst.hxx"
28 
29 class ScPaintLockData
30 {
31 private:
32 	ScRangeListRef	xRangeList;
33 	sal_uInt16			nMode;
34 	sal_uInt16			nLevel;
35 	sal_uInt16			nDocLevel;
36 	sal_uInt16			nParts;
37 	sal_Bool			bModified;
38 
39 public:
40 					ScPaintLockData(sal_uInt16 nNewMode);
41 					~ScPaintLockData();
42 
43 	void			AddRange( const ScRange& rRange, sal_uInt16 nP );
44 
SetModified()45 	void			SetModified()	{ bModified = sal_True; }
IncLevel(sal_Bool bDoc)46 	void			IncLevel(sal_Bool bDoc)
47 						{ if (bDoc) ++nDocLevel; else ++nLevel; }
DecLevel(sal_Bool bDoc)48 	void			DecLevel(sal_Bool bDoc)
49 						{ if (bDoc) --nDocLevel; else --nLevel; }
50 
GetRangeList() const51 	const ScRangeListRef&	GetRangeList() const			{ return xRangeList; }
GetParts() const52 	sal_uInt16					GetParts() const				{ return nParts; }
GetLevel(sal_Bool bDoc) const53 	sal_uInt16					GetLevel(sal_Bool bDoc) const
54 								{ return bDoc ? nDocLevel : nLevel; }
GetModified() const55 	sal_Bool					GetModified() const				{ return bModified; }
56 
57 					// fuer Wiederherstellen nach Reset
SetLevel(sal_uInt16 nNew,sal_Bool bDoc)58 	void			SetLevel(sal_uInt16 nNew, sal_Bool bDoc)
59 						{ if (bDoc) nDocLevel = nNew; else nLevel = nNew; }
60 };
61 
62 #endif
63 
64