1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef SW_LINEINFO_HXX
28 #define SW_LINEINFO_HXX
31 //#ifndef _NUMRULE_HXX
32 //#include <numrule.hxx>
34 #include <editeng/numitem.hxx>
38 class IDocumentStylePoolAccess
;
40 enum LineNumberPosition
44 LINENUMBER_POS_INSIDE
,
45 LINENUMBER_POS_OUTSIDE
48 class SW_DLLPUBLIC SwLineNumberInfo
: public SwClient
//purpose of derivation from SwClient:
49 //character style for displaying the numbers.
51 SvxNumberType aType
; //e.g. roman linenumbers
52 String aDivider
; //String for aditional interval (vert. lines user defined)
53 USHORT nPosFromLeft
; //Position for paint
54 USHORT nCountBy
; //Paint only for every n line
55 USHORT nDividerCountBy
; //Interval for display of an user defined
56 //string every n lines
57 LineNumberPosition ePos
; //Where should the display occur (number and divicer)
58 BOOL bPaintLineNumbers
; //Should anything be displayed?
59 BOOL bCountBlankLines
; //Count empty lines?
60 BOOL bCountInFlys
; //Count also within FlyFrames?
61 BOOL bRestartEachPage
; //Restart counting at the first paragraph of each page
62 //(even on follows when paragraphs are splitted)
66 SwLineNumberInfo(const SwLineNumberInfo
&);
68 SwLineNumberInfo
& operator=(const SwLineNumberInfo
&);
69 BOOL
operator==( const SwLineNumberInfo
& rInf
) const;
71 SwCharFmt
*GetCharFmt( IDocumentStylePoolAccess
& rIDSPA
) const;
72 void SetCharFmt( SwCharFmt
* );
74 const SvxNumberType
&GetNumType() const { return aType
; }
75 void SetNumType( SvxNumberType aNew
){ aType
= aNew
; }
77 const String
&GetDivider() const { return aDivider
; }
78 void SetDivider( const String
&r
) { aDivider
= r
; }
79 USHORT
GetDividerCountBy() const { return nDividerCountBy
; }
80 void SetDividerCountBy( USHORT n
) { nDividerCountBy
= n
; }
82 USHORT
GetPosFromLeft() const { return nPosFromLeft
; }
83 void SetPosFromLeft( USHORT n
) { nPosFromLeft
= n
; }
85 USHORT
GetCountBy() const { return nCountBy
; }
86 void SetCountBy( USHORT n
) { nCountBy
= n
; }
88 LineNumberPosition
GetPos() const { return ePos
; }
89 void SetPos( LineNumberPosition eP
){ ePos
= eP
; }
91 BOOL
IsPaintLineNumbers() const { return bPaintLineNumbers
; }
92 void SetPaintLineNumbers( BOOL b
){ bPaintLineNumbers
= b
; }
94 BOOL
IsCountBlankLines() const { return bCountBlankLines
; }
95 void SetCountBlankLines( BOOL b
) { bCountBlankLines
= b
; }
97 BOOL
IsCountInFlys() const { return bCountInFlys
; }
98 void SetCountInFlys( BOOL b
) { bCountInFlys
= b
; }
100 BOOL
IsRestartEachPage() const { return bRestartEachPage
; }
101 void SetRestartEachPage( BOOL b
) { bRestartEachPage
= b
; }
103 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );