xref: /AOO41X/main/sc/source/ui/inc/pntlock.hxx (revision 707fc0d4d52eb4f69d89a98ffec6918ca5de6326)
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 
45     void            SetModified()   { bModified = sal_True; }
46     void            IncLevel(sal_Bool bDoc)
47                         { if (bDoc) ++nDocLevel; else ++nLevel; }
48     void            DecLevel(sal_Bool bDoc)
49                         { if (bDoc) --nDocLevel; else --nLevel; }
50 
51     const ScRangeListRef&   GetRangeList() const            { return xRangeList; }
52     sal_uInt16                  GetParts() const                { return nParts; }
53     sal_uInt16                  GetLevel(sal_Bool bDoc) const
54                                 { return bDoc ? nDocLevel : nLevel; }
55     sal_Bool                    GetModified() const             { return bModified; }
56 
57                     // fuer Wiederherstellen nach Reset
58     void            SetLevel(sal_uInt16 nNew, sal_Bool bDoc)
59                         { if (bDoc) nDocLevel = nNew; else nLevel = nNew; }
60 };
61 
62 #endif
63 
64