xref: /AOO41X/main/sc/source/ui/inc/pagedata.hxx (revision 54628ca40d27d15cc98fe861da7fff7e60c2f7d6)
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_PAGEDATA_HXX
25 #define SC_PAGEDATA_HXX
26 
27 #include "global.hxx"
28 #include "address.hxx"
29 
30 class ScDocShell;
31 
32 //============================================================================
33 
34 class ScPrintRangeData
35 {
36 private:
37     ScRange     aPrintRange;
38     size_t      nPagesX;
39     SCCOL*      pPageEndX;
40     size_t      nPagesY;
41     SCROW*      pPageEndY;
42     long        nFirstPage;
43     sal_Bool        bTopDown;
44     sal_Bool        bAutomatic;
45 
46 public:
47                 ScPrintRangeData();
48                 ~ScPrintRangeData();
49 
50     void            SetPrintRange( const ScRange& rNew )    { aPrintRange = rNew; }
51     const ScRange&  GetPrintRange() const                   { return aPrintRange; }
52 
53     void            SetPagesX( size_t nCount, const SCCOL* pEnd );
54     void            SetPagesY( size_t nCount, const SCROW* pEnd );
55 
56     size_t          GetPagesX() const       { return nPagesX;   }
57     const SCCOL*    GetPageEndX() const     { return pPageEndX; }
58     size_t          GetPagesY() const       { return nPagesY;   }
59     const SCROW*    GetPageEndY() const     { return pPageEndY; }
60 
61     void            SetFirstPage( long nNew )   { nFirstPage = nNew; }
62     long            GetFirstPage() const        { return nFirstPage; }
63     void            SetTopDown( sal_Bool bSet )     { bTopDown = bSet; }
64     sal_Bool            IsTopDown() const           { return bTopDown; }
65     void            SetAutomatic( sal_Bool bSet )   { bAutomatic = bSet; }
66     sal_Bool            IsAutomatic() const         { return bAutomatic; }
67 };
68 
69 class ScPageBreakData
70 {
71 private:
72     size_t              nAlloc;
73     size_t              nUsed;
74     ScPrintRangeData*   pData;          // Array
75 
76 public:
77                 ScPageBreakData(size_t nMax);
78                 ~ScPageBreakData();
79 
80     size_t              GetCount() const            { return nUsed; }
81     ScPrintRangeData&   GetData(size_t i);
82 
83     sal_Bool                IsEqual( const ScPageBreakData& rOther ) const;
84 
85     void                AddPages();
86 };
87 
88 
89 
90 #endif
91 
92