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