1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: lineinfo.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef SW_LINEINFO_HXX
31 #define SW_LINEINFO_HXX
34 //#ifndef _NUMRULE_HXX
35 //#include <numrule.hxx>
37 #include <svx/numitem.hxx>
41 class IDocumentStylePoolAccess
;
43 enum LineNumberPosition
47 LINENUMBER_POS_INSIDE
,
48 LINENUMBER_POS_OUTSIDE
51 class SW_DLLPUBLIC SwLineNumberInfo
: public SwClient
//purpose of derivation from SwClient:
52 //character style for displaying the numbers.
54 SvxNumberType aType
; //e.g. roman linenumbers
55 String aDivider
; //String for aditional interval (vert. lines user defined)
56 USHORT nPosFromLeft
; //Position for paint
57 USHORT nCountBy
; //Paint only for every n line
58 USHORT nDividerCountBy
; //Interval for display of an user defined
59 //string every n lines
60 LineNumberPosition ePos
; //Where should the display occur (number and divicer)
61 BOOL bPaintLineNumbers
; //Should anything be displayed?
62 BOOL bCountBlankLines
; //Count empty lines?
63 BOOL bCountInFlys
; //Count also within FlyFrames?
64 BOOL bRestartEachPage
; //Restart counting at the first paragraph of each page
65 //(even on follows when paragraphs are splitted)
69 SwLineNumberInfo(const SwLineNumberInfo
&);
71 SwLineNumberInfo
& operator=(const SwLineNumberInfo
&);
72 BOOL
operator==( const SwLineNumberInfo
& rInf
) const;
74 SwCharFmt
*GetCharFmt( IDocumentStylePoolAccess
& rIDSPA
) const;
75 void SetCharFmt( SwCharFmt
* );
77 const SvxNumberType
&GetNumType() const { return aType
; }
78 void SetNumType( SvxNumberType aNew
){ aType
= aNew
; }
80 const String
&GetDivider() const { return aDivider
; }
81 void SetDivider( const String
&r
) { aDivider
= r
; }
82 USHORT
GetDividerCountBy() const { return nDividerCountBy
; }
83 void SetDividerCountBy( USHORT n
) { nDividerCountBy
= n
; }
85 USHORT
GetPosFromLeft() const { return nPosFromLeft
; }
86 void SetPosFromLeft( USHORT n
) { nPosFromLeft
= n
; }
88 USHORT
GetCountBy() const { return nCountBy
; }
89 void SetCountBy( USHORT n
) { nCountBy
= n
; }
91 LineNumberPosition
GetPos() const { return ePos
; }
92 void SetPos( LineNumberPosition eP
){ ePos
= eP
; }
94 BOOL
IsPaintLineNumbers() const { return bPaintLineNumbers
; }
95 void SetPaintLineNumbers( BOOL b
){ bPaintLineNumbers
= b
; }
97 BOOL
IsCountBlankLines() const { return bCountBlankLines
; }
98 void SetCountBlankLines( BOOL b
) { bCountBlankLines
= b
; }
100 BOOL
IsCountInFlys() const { return bCountInFlys
; }
101 void SetCountInFlys( BOOL b
) { bCountInFlys
= b
; }
103 BOOL
IsRestartEachPage() const { return bRestartEachPage
; }
104 void SetRestartEachPage( BOOL b
) { bRestartEachPage
= b
; }
106 virtual void Modify( SfxPoolItem
*, SfxPoolItem
* );