xref: /trunk/main/sw/inc/lineinfo.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef SW_LINEINFO_HXX
24cdf0e10cSrcweir #define SW_LINEINFO_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "calbck.hxx"
27cdf0e10cSrcweir #include <editeng/numitem.hxx>
28cdf0e10cSrcweir #include "swdllapi.h"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SwCharFmt;
31cdf0e10cSrcweir class IDocumentStylePoolAccess;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir enum LineNumberPosition
34cdf0e10cSrcweir {
35cdf0e10cSrcweir     LINENUMBER_POS_LEFT,
36cdf0e10cSrcweir     LINENUMBER_POS_RIGHT,
37cdf0e10cSrcweir     LINENUMBER_POS_INSIDE,
38cdf0e10cSrcweir     LINENUMBER_POS_OUTSIDE
39cdf0e10cSrcweir };
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation from SwClient:
42cdf0e10cSrcweir                                          //character style for displaying the numbers.
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     SvxNumberType       aType;              //e.g. roman linenumbers
45*9cf3e4aaSJohn Bampton     String              aDivider;           //String for additional interval (vert. lines user defined)
46cdf0e10cSrcweir     sal_uInt16              nPosFromLeft;       //Position for paint
47cdf0e10cSrcweir     sal_uInt16              nCountBy;           //Paint only for every n line
48cdf0e10cSrcweir     sal_uInt16              nDividerCountBy;    //Interval for display of an user defined
49cdf0e10cSrcweir                                             //string every n lines
50*9cf3e4aaSJohn Bampton     LineNumberPosition  ePos;               //Where should the display occur (number and divider)
51cdf0e10cSrcweir     sal_Bool                bPaintLineNumbers;  //Should anything be displayed?
52cdf0e10cSrcweir     sal_Bool                bCountBlankLines;   //Count empty lines?
53cdf0e10cSrcweir     sal_Bool                bCountInFlys;       //Count also within FlyFrames?
54cdf0e10cSrcweir     sal_Bool                bRestartEachPage;   //Restart counting at the first paragraph of each page
55cdf0e10cSrcweir                                             //(even on follows when paragraphs are splitted)
56cdf0e10cSrcweir protected:
57cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
58cdf0e10cSrcweir 
59cdf0e10cSrcweir public:
60cdf0e10cSrcweir     SwLineNumberInfo();
61cdf0e10cSrcweir     SwLineNumberInfo(const SwLineNumberInfo&);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     SwLineNumberInfo& operator=(const SwLineNumberInfo&);
64cdf0e10cSrcweir     sal_Bool operator==( const SwLineNumberInfo& rInf ) const;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     SwCharFmt *GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) const;
67cdf0e10cSrcweir     void SetCharFmt( SwCharFmt* );
68cdf0e10cSrcweir 
GetNumType() const69cdf0e10cSrcweir     const SvxNumberType &GetNumType() const             { return aType; }
SetNumType(SvxNumberType aNew)70cdf0e10cSrcweir     void                SetNumType( SvxNumberType aNew ){ aType = aNew; }
71cdf0e10cSrcweir 
GetDivider() const72cdf0e10cSrcweir     const String &GetDivider() const    { return aDivider; }
SetDivider(const String & r)73cdf0e10cSrcweir     void SetDivider( const String &r )  { aDivider = r; }
GetDividerCountBy() const74cdf0e10cSrcweir     sal_uInt16 GetDividerCountBy() const    { return nDividerCountBy; }
SetDividerCountBy(sal_uInt16 n)75cdf0e10cSrcweir     void SetDividerCountBy( sal_uInt16 n )  { nDividerCountBy = n; }
76cdf0e10cSrcweir 
GetPosFromLeft() const77cdf0e10cSrcweir     sal_uInt16 GetPosFromLeft() const       { return nPosFromLeft; }
SetPosFromLeft(sal_uInt16 n)78cdf0e10cSrcweir     void   SetPosFromLeft( sal_uInt16 n)    { nPosFromLeft = n;    }
79cdf0e10cSrcweir 
GetCountBy() const80cdf0e10cSrcweir     sal_uInt16 GetCountBy() const           { return nCountBy; }
SetCountBy(sal_uInt16 n)81cdf0e10cSrcweir     void   SetCountBy( sal_uInt16 n)        { nCountBy = n;    }
82cdf0e10cSrcweir 
GetPos() const83cdf0e10cSrcweir     LineNumberPosition GetPos() const   { return ePos; }
SetPos(LineNumberPosition eP)84cdf0e10cSrcweir     void SetPos( LineNumberPosition eP ){ ePos = eP;   }
85cdf0e10cSrcweir 
IsPaintLineNumbers() const86cdf0e10cSrcweir     sal_Bool   IsPaintLineNumbers() const   { return bPaintLineNumbers; }
SetPaintLineNumbers(sal_Bool b)87cdf0e10cSrcweir     void   SetPaintLineNumbers( sal_Bool b ){ bPaintLineNumbers = b;    }
88cdf0e10cSrcweir 
IsCountBlankLines() const89cdf0e10cSrcweir     sal_Bool   IsCountBlankLines() const    { return bCountBlankLines;  }
SetCountBlankLines(sal_Bool b)90cdf0e10cSrcweir     void   SetCountBlankLines( sal_Bool b ) { bCountBlankLines = b;     }
91cdf0e10cSrcweir 
IsCountInFlys() const92cdf0e10cSrcweir     sal_Bool   IsCountInFlys() const        { return bCountInFlys;      }
SetCountInFlys(sal_Bool b)93cdf0e10cSrcweir     void   SetCountInFlys( sal_Bool b )     { bCountInFlys = b;         }
94cdf0e10cSrcweir 
IsRestartEachPage() const95cdf0e10cSrcweir     sal_Bool   IsRestartEachPage() const    { return bRestartEachPage;  }
SetRestartEachPage(sal_Bool b)96cdf0e10cSrcweir     void   SetRestartEachPage( sal_Bool b ) { bRestartEachPage = b;     }
97cdf0e10cSrcweir 
HasCharFormat() const98cdf0e10cSrcweir     bool   HasCharFormat() const { return GetRegisteredIn() != 0; }
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif
104