/src/libreoffice/sw/inc/lineinfo.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #ifndef INCLUDED_SW_INC_LINEINFO_HXX |
20 | | #define INCLUDED_SW_INC_LINEINFO_HXX |
21 | | |
22 | | #include "calbck.hxx" |
23 | | #include <editeng/numitem.hxx> |
24 | | #include "swdllapi.h" |
25 | | |
26 | | class SwCharFormat; |
27 | | class IDocumentStylePoolAccess; |
28 | | |
29 | | enum LineNumberPosition |
30 | | { |
31 | | LINENUMBER_POS_LEFT, |
32 | | LINENUMBER_POS_RIGHT, |
33 | | LINENUMBER_POS_INSIDE, |
34 | | LINENUMBER_POS_OUTSIDE |
35 | | }; |
36 | | |
37 | | class SW_DLLPUBLIC SwLineNumberInfo final : public SwClient /**< purpose of derivation from SwClient: |
38 | | character style for displaying the numbers. */ |
39 | | { |
40 | | SvxNumberType m_aType; ///< e.g. roman linenumbers |
41 | | OUString m_aDivider; ///< String for additional interval (vert. lines user defined) |
42 | | sal_uInt16 m_nPosFromLeft; ///< Position for paint |
43 | | sal_uInt16 m_nCountBy; ///< Paint only for every n line |
44 | | sal_uInt16 m_nDividerCountBy; /**< Interval for display of an user defined |
45 | | string every n lines */ |
46 | | LineNumberPosition m_ePos; ///< Where should the display occur (number and divider) |
47 | | bool m_bPaintLineNumbers; ///< Should anything be displayed? |
48 | | bool m_bCountBlankLines; ///< Count empty lines? |
49 | | bool m_bCountInFlys; ///< Count also within FlyFrames? |
50 | | bool m_bRestartEachPage; /**< Restart counting at the first paragraph of each page |
51 | | (even on follows when paragraphs are split) */ |
52 | | virtual void SwClientNotify( const SwModify&, const SfxHint& ) override; |
53 | | |
54 | | public: |
55 | | SwLineNumberInfo(); |
56 | | SwLineNumberInfo(const SwLineNumberInfo&); |
57 | | |
58 | | SwLineNumberInfo& operator=(const SwLineNumberInfo&); |
59 | | |
60 | | SwCharFormat *GetCharFormat( IDocumentStylePoolAccess& rIDSPA ) const; |
61 | | void SetCharFormat( SwCharFormat* ); |
62 | | |
63 | 26.8k | const SvxNumberType &GetNumType() const { return m_aType; } |
64 | 1.70k | void SetNumType( SvxNumberType aNew ){ m_aType = aNew; } |
65 | | |
66 | 25.5k | const OUString& GetDivider() const { return m_aDivider; } |
67 | 1.35k | void SetDivider( const OUString &r ) { m_aDivider = r; } |
68 | 25.2k | sal_uInt16 GetDividerCountBy() const { return m_nDividerCountBy; } |
69 | 0 | void SetDividerCountBy( sal_uInt16 n ) { m_nDividerCountBy = n; } |
70 | | |
71 | 25.5k | sal_uInt16 GetPosFromLeft() const { return m_nPosFromLeft; } |
72 | 1.45k | void SetPosFromLeft( sal_uInt16 n) { m_nPosFromLeft = n; } |
73 | | |
74 | 27.4k | sal_uInt16 GetCountBy() const { return m_nCountBy; } |
75 | 1.64k | void SetCountBy( sal_uInt16 n) { m_nCountBy = n; } |
76 | | |
77 | 25.5k | LineNumberPosition GetPos() const { return m_ePos; } |
78 | 1.70k | void SetPos( LineNumberPosition eP ){ m_ePos = eP; } |
79 | | |
80 | 212k | bool IsPaintLineNumbers() const { return m_bPaintLineNumbers; } |
81 | 1.72k | void SetPaintLineNumbers( bool b ){ m_bPaintLineNumbers = b; } |
82 | | |
83 | 190k | bool IsCountBlankLines() const { return m_bCountBlankLines; } |
84 | 1.70k | void SetCountBlankLines( bool b ) { m_bCountBlankLines = b; } |
85 | | |
86 | 208k | bool IsCountInFlys() const { return m_bCountInFlys; } |
87 | 1.70k | void SetCountInFlys( bool b ) { m_bCountInFlys = b; } |
88 | | |
89 | 146k | bool IsRestartEachPage() const { return m_bRestartEachPage; } |
90 | 1.71k | void SetRestartEachPage( bool b ) { m_bRestartEachPage = b; } |
91 | | |
92 | 0 | bool HasCharFormat() const { return GetRegisteredIn() != nullptr; } |
93 | | }; |
94 | | |
95 | | #endif |
96 | | |
97 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |