xref: /trunk/main/sw/inc/lineinfo.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew 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
45cdf0e10cSrcweir     String              aDivider;           //String for aditional 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
50cdf0e10cSrcweir     LineNumberPosition  ePos;               //Where should the display occur (number and divicer)
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 
69cdf0e10cSrcweir     const SvxNumberType &GetNumType() const             { return aType; }
70cdf0e10cSrcweir     void                SetNumType( SvxNumberType aNew ){ aType = aNew; }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     const String &GetDivider() const    { return aDivider; }
73cdf0e10cSrcweir     void SetDivider( const String &r )  { aDivider = r; }
74cdf0e10cSrcweir     sal_uInt16 GetDividerCountBy() const    { return nDividerCountBy; }
75cdf0e10cSrcweir     void SetDividerCountBy( sal_uInt16 n )  { nDividerCountBy = n; }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     sal_uInt16 GetPosFromLeft() const       { return nPosFromLeft; }
78cdf0e10cSrcweir     void   SetPosFromLeft( sal_uInt16 n)    { nPosFromLeft = n;    }
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     sal_uInt16 GetCountBy() const           { return nCountBy; }
81cdf0e10cSrcweir     void   SetCountBy( sal_uInt16 n)        { nCountBy = n;    }
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     LineNumberPosition GetPos() const   { return ePos; }
84cdf0e10cSrcweir     void SetPos( LineNumberPosition eP ){ ePos = eP;   }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     sal_Bool   IsPaintLineNumbers() const   { return bPaintLineNumbers; }
87cdf0e10cSrcweir     void   SetPaintLineNumbers( sal_Bool b ){ bPaintLineNumbers = b;    }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     sal_Bool   IsCountBlankLines() const    { return bCountBlankLines;  }
90cdf0e10cSrcweir     void   SetCountBlankLines( sal_Bool b ) { bCountBlankLines = b;     }
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     sal_Bool   IsCountInFlys() const        { return bCountInFlys;      }
93cdf0e10cSrcweir     void   SetCountInFlys( sal_Bool b )     { bCountInFlys = b;         }
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     sal_Bool   IsRestartEachPage() const    { return bRestartEachPage;  }
96cdf0e10cSrcweir     void   SetRestartEachPage( sal_Bool b ) { bRestartEachPage = b;     }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     bool   HasCharFormat() const { return GetRegisteredIn() != 0; }
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif
104cdf0e10cSrcweir 
105