xref: /trunk/main/sc/source/ui/inc/pagedata.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_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 
SetPrintRange(const ScRange & rNew)50 	void			SetPrintRange( const ScRange& rNew )	{ aPrintRange = rNew; }
GetPrintRange() const51 	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 
GetPagesX() const56 	size_t			GetPagesX() const		{ return nPagesX;   }
GetPageEndX() const57 	const SCCOL*	GetPageEndX() const		{ return pPageEndX; }
GetPagesY() const58 	size_t			GetPagesY() const		{ return nPagesY;   }
GetPageEndY() const59 	const SCROW*	GetPageEndY() const		{ return pPageEndY; }
60 
SetFirstPage(long nNew)61 	void			SetFirstPage( long nNew )	{ nFirstPage = nNew; }
GetFirstPage() const62 	long			GetFirstPage() const		{ return nFirstPage; }
SetTopDown(sal_Bool bSet)63 	void			SetTopDown( sal_Bool bSet )		{ bTopDown = bSet; }
IsTopDown() const64 	sal_Bool			IsTopDown() const			{ return bTopDown; }
SetAutomatic(sal_Bool bSet)65 	void			SetAutomatic( sal_Bool bSet )	{ bAutomatic = bSet; }
IsAutomatic() const66 	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 
GetCount() const80 	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