xref: /trunk/main/sw/inc/lineinfo.hxx (revision cdf0e10c)
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 #ifndef SW_LINEINFO_HXX
28 #define SW_LINEINFO_HXX
29 
30 #include "calbck.hxx"
31 #include <editeng/numitem.hxx>
32 #include "swdllapi.h"
33 
34 class SwCharFmt;
35 class IDocumentStylePoolAccess;
36 
37 enum LineNumberPosition
38 {
39 	LINENUMBER_POS_LEFT,
40 	LINENUMBER_POS_RIGHT,
41 	LINENUMBER_POS_INSIDE,
42 	LINENUMBER_POS_OUTSIDE
43 };
44 
45 class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation from SwClient:
46 										 //character style for displaying the numbers.
47 {
48 	SvxNumberType 		aType;				//e.g. roman linenumbers
49 	String				aDivider;        	//String for aditional interval (vert. lines user defined)
50 	sal_uInt16				nPosFromLeft;		//Position for paint
51 	sal_uInt16				nCountBy;			//Paint only for every n line
52 	sal_uInt16				nDividerCountBy;	//Interval for display of an user defined
53 											//string every n lines
54 	LineNumberPosition	ePos;               //Where should the display occur (number and divicer)
55 	sal_Bool				bPaintLineNumbers;	//Should anything be displayed?
56 	sal_Bool				bCountBlankLines;	//Count empty lines?
57 	sal_Bool				bCountInFlys;		//Count also within FlyFrames?
58 	sal_Bool				bRestartEachPage;	//Restart counting at the first paragraph of each page
59 											//(even on follows when paragraphs are splitted)
60 protected:
61    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
62 
63 public:
64 	SwLineNumberInfo();
65 	SwLineNumberInfo(const SwLineNumberInfo&);
66 
67 	SwLineNumberInfo& operator=(const SwLineNumberInfo&);
68 	sal_Bool operator==( const SwLineNumberInfo& rInf ) const;
69 
70     SwCharFmt *GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) const;
71 	void SetCharFmt( SwCharFmt* );
72 
73 	const SvxNumberType &GetNumType() const 			{ return aType; }
74 	void 			 	SetNumType( SvxNumberType aNew ){ aType = aNew; }
75 
76 	const String &GetDivider() const 	{ return aDivider; }
77 	void SetDivider( const String &r )	{ aDivider = r;	}
78 	sal_uInt16 GetDividerCountBy() const	{ return nDividerCountBy; }
79 	void SetDividerCountBy( sal_uInt16 n )	{ nDividerCountBy = n; }
80 
81 	sal_uInt16 GetPosFromLeft() const 		{ return nPosFromLeft; }
82 	void   SetPosFromLeft( sal_uInt16 n)	{ nPosFromLeft = n;    }
83 
84 	sal_uInt16 GetCountBy() const 			{ return nCountBy; }
85 	void   SetCountBy( sal_uInt16 n)		{ nCountBy = n;    }
86 
87 	LineNumberPosition GetPos() const	{ return ePos; }
88 	void SetPos( LineNumberPosition eP ){ ePos = eP;   }
89 
90 	sal_Bool   IsPaintLineNumbers() const	{ return bPaintLineNumbers; }
91 	void   SetPaintLineNumbers( sal_Bool b ){ bPaintLineNumbers = b;	}
92 
93 	sal_Bool   IsCountBlankLines() const 	{ return bCountBlankLines;  }
94 	void   SetCountBlankLines( sal_Bool b )	{ bCountBlankLines = b;		}
95 
96 	sal_Bool   IsCountInFlys() const		{ return bCountInFlys; 		}
97 	void   SetCountInFlys( sal_Bool b )		{ bCountInFlys = b;			}
98 
99 	sal_Bool   IsRestartEachPage() const	{ return bRestartEachPage;	}
100 	void   SetRestartEachPage( sal_Bool b )	{ bRestartEachPage = b;		}
101 
102     bool   HasCharFormat() const { return GetRegisteredIn() != 0; }
103 };
104 
105 
106 
107 #endif
108 
109