xref: /trunk/main/sc/source/ui/inc/pagedata.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_PAGEDATA_HXX
29 #define SC_PAGEDATA_HXX
30 
31 #include "global.hxx"
32 #include "address.hxx"
33 
34 class ScDocShell;
35 
36 //============================================================================
37 
38 class ScPrintRangeData
39 {
40 private:
41     ScRange     aPrintRange;
42     size_t      nPagesX;
43     SCCOL*      pPageEndX;
44     size_t      nPagesY;
45     SCROW*      pPageEndY;
46     long        nFirstPage;
47     sal_Bool        bTopDown;
48     sal_Bool        bAutomatic;
49 
50 public:
51                 ScPrintRangeData();
52                 ~ScPrintRangeData();
53 
54     void            SetPrintRange( const ScRange& rNew )    { aPrintRange = rNew; }
55     const ScRange&  GetPrintRange() const                   { return aPrintRange; }
56 
57     void            SetPagesX( size_t nCount, const SCCOL* pEnd );
58     void            SetPagesY( size_t nCount, const SCROW* pEnd );
59 
60     size_t          GetPagesX() const       { return nPagesX;   }
61     const SCCOL*    GetPageEndX() const     { return pPageEndX; }
62     size_t          GetPagesY() const       { return nPagesY;   }
63     const SCROW*    GetPageEndY() const     { return pPageEndY; }
64 
65     void            SetFirstPage( long nNew )   { nFirstPage = nNew; }
66     long            GetFirstPage() const        { return nFirstPage; }
67     void            SetTopDown( sal_Bool bSet )     { bTopDown = bSet; }
68     sal_Bool            IsTopDown() const           { return bTopDown; }
69     void            SetAutomatic( sal_Bool bSet )   { bAutomatic = bSet; }
70     sal_Bool            IsAutomatic() const         { return bAutomatic; }
71 };
72 
73 class ScPageBreakData
74 {
75 private:
76     size_t              nAlloc;
77     size_t              nUsed;
78     ScPrintRangeData*   pData;          // Array
79 
80 public:
81                 ScPageBreakData(size_t nMax);
82                 ~ScPageBreakData();
83 
84     size_t              GetCount() const            { return nUsed; }
85     ScPrintRangeData&   GetData(size_t i);
86 
87     sal_Bool                IsEqual( const ScPageBreakData& rOther ) const;
88 
89     void                AddPages();
90 };
91 
92 
93 
94 #endif
95 
96