bump product version to 5.0.4.1
[LibreOffice.git] / sw / inc / lineinfo.hxx
bloba1e2695dcf2fdc37086fc05b080ddba28417bd01
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_LINEINFO_HXX
20 #define INCLUDED_SW_INC_LINEINFO_HXX
22 #include "calbck.hxx"
23 #include <editeng/numitem.hxx>
24 #include "swdllapi.h"
26 class SwCharFormat;
27 class IDocumentStylePoolAccess;
29 enum LineNumberPosition
31 LINENUMBER_POS_LEFT,
32 LINENUMBER_POS_RIGHT,
33 LINENUMBER_POS_INSIDE,
34 LINENUMBER_POS_OUTSIDE
37 class SW_DLLPUBLIC SwLineNumberInfo : public SwClient /**< purpose of derivation from SwClient:
38 character style for displaying the numbers. */
40 SvxNumberType aType; ///< e.g. roman linenumbers
41 OUString aDivider; ///< String for additional interval (vert. lines user defined)
42 sal_uInt16 nPosFromLeft; ///< Position for paint
43 sal_uInt16 nCountBy; ///< Paint only for every n line
44 sal_uInt16 nDividerCountBy; /**< Interval for display of an user defined
45 string every n lines */
46 LineNumberPosition ePos; ///< Where should the display occur (number and divicer)
47 bool bPaintLineNumbers; ///< Should anything be displayed?
48 bool bCountBlankLines; ///< Count empty lines?
49 bool bCountInFlys; ///< Count also within FlyFrames?
50 bool bRestartEachPage; /**< Restart counting at the first paragraph of each page
51 (even on follows when paragraphs are splitted) */
52 protected:
53 virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) SAL_OVERRIDE;
55 public:
56 SwLineNumberInfo();
57 SwLineNumberInfo(const SwLineNumberInfo&);
59 SwLineNumberInfo& operator=(const SwLineNumberInfo&);
60 bool operator==( const SwLineNumberInfo& rInf ) const;
62 SwCharFormat *GetCharFormat( IDocumentStylePoolAccess& rIDSPA ) const;
63 void SetCharFormat( SwCharFormat* );
65 const SvxNumberType &GetNumType() const { return aType; }
66 void SetNumType( SvxNumberType aNew ){ aType = aNew; }
68 OUString GetDivider() const { return aDivider; }
69 void SetDivider( const OUString &r ) { aDivider = r; }
70 sal_uInt16 GetDividerCountBy() const { return nDividerCountBy; }
71 void SetDividerCountBy( sal_uInt16 n ) { nDividerCountBy = n; }
73 sal_uInt16 GetPosFromLeft() const { return nPosFromLeft; }
74 void SetPosFromLeft( sal_uInt16 n) { nPosFromLeft = n; }
76 sal_uInt16 GetCountBy() const { return nCountBy; }
77 void SetCountBy( sal_uInt16 n) { nCountBy = n; }
79 LineNumberPosition GetPos() const { return ePos; }
80 void SetPos( LineNumberPosition eP ){ ePos = eP; }
82 bool IsPaintLineNumbers() const { return bPaintLineNumbers; }
83 void SetPaintLineNumbers( bool b ){ bPaintLineNumbers = b; }
85 bool IsCountBlankLines() const { return bCountBlankLines; }
86 void SetCountBlankLines( bool b ) { bCountBlankLines = b; }
88 bool IsCountInFlys() const { return bCountInFlys; }
89 void SetCountInFlys( bool b ) { bCountInFlys = b; }
91 bool IsRestartEachPage() const { return bRestartEachPage; }
92 void SetRestartEachPage( bool b ) { bRestartEachPage = b; }
94 bool HasCharFormat() const { return GetRegisteredIn() != 0; }
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */