Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/editeng/hyphenzoneitem.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_EDITENG_HYPHENZONEITEM_HXX
20
#define INCLUDED_EDITENG_HYPHENZONEITEM_HXX
21
22
#include <svl/poolitem.hxx>
23
#include <editeng/editengdllapi.h>
24
25
// class SvxHyphenZoneItem -----------------------------------------------
26
27
/*  [Description]
28
29
    This item describes a hyphenation attribute  (automatic?, number of
30
    characters at the end of the line and start).
31
*/
32
33
class EDITENG_DLLPUBLIC SvxHyphenZoneItem final : public SfxPoolItem
34
{
35
    bool      bHyphen  : 1;
36
    bool      bKeep : 1;        // avoid hyphenation across page etc., see ParagraphHyphenationKeep
37
    bool      bNoCapsHyphenation : 1;
38
    bool      bNoLastWordHyphenation : 1;
39
    sal_uInt8 nMinLead;
40
    sal_uInt8 nMinTrail;
41
    sal_uInt8 nMaxHyphens;      // max. consecutive lines with hyphenation
42
    sal_uInt8 nMinWordLength;   // hyphenate only words with at least nMinWordLength characters
43
    sal_uInt16 nTextHyphenZone; // don't force hyphenation at line end, allow this extra white space
44
    sal_uInt16 nTextHyphenZoneAlways; // don't force hyphenation at paragraph end, allow this extra white space
45
    sal_uInt16 nTextHyphenZoneColumn; // don't force hyphenation at column end, allow this extra white space
46
    sal_uInt16 nTextHyphenZonePage;   // don't force hyphenation at page end, allow this extra white space
47
    sal_uInt16 nTextHyphenZoneSpread; // don't force hyphenation at spread end, allow this extra white space
48
    sal_uInt8 nKeepType;        // avoid hyphenation across page etc., see ParagraphHyphenationKeep
49
    bool      bKeepLine : 1;    // if bKeep, shift the hyphenated word (true), or the full line
50
    sal_uInt8 nCompoundMinLead; // min. characters between compound word boundary and hyphenation
51
52
public:
53
    static SfxPoolItem* CreateDefault();
54
55
    DECLARE_ITEM_TYPE_FUNCTION(SvxHyphenZoneItem)
56
    SvxHyphenZoneItem( const bool bHyph /*= false*/,
57
                       const sal_uInt16 nId  );
58
59
    // "pure virtual Methods" from SfxPoolItem
60
    virtual bool            operator==( const SfxPoolItem& ) const override;
61
    virtual bool            QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
62
    virtual bool            PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
63
64
    virtual bool GetPresentation( SfxItemPresentation ePres,
65
                                  MapUnit eCoreMetric,
66
                                  MapUnit ePresMetric,
67
                                  OUString &rText, const IntlWrapper& ) const override;
68
69
    virtual SvxHyphenZoneItem* Clone( SfxItemPool *pPool = nullptr ) const override;
70
71
11.4k
    void SetHyphen( const bool bNew ) { bHyphen = bNew; }
72
245k
    bool IsHyphen() const { return bHyphen; }
73
74
826
    void SetKeep( const bool bNew ) { bKeep = bNew; }
75
99
    bool IsKeep() const { return bKeep; }
76
77
0
    void SetNoCapsHyphenation( const bool bNew ) { bNoCapsHyphenation = bNew; }
78
99
    bool IsNoCapsHyphenation() const { return bNoCapsHyphenation; }
79
0
    void SetNoLastWordHyphenation( const bool bNew ) { bNoLastWordHyphenation = bNew; }
80
99
    bool IsNoLastWordHyphenation() const { return bNoLastWordHyphenation; }
81
82
85.3k
    sal_uInt8 &GetMinLead() { return nMinLead; }
83
99
    sal_uInt8 GetMinLead() const { return nMinLead; }
84
85
85.3k
    sal_uInt8 &GetMinTrail() { return nMinTrail; }
86
99
    sal_uInt8 GetMinTrail() const { return nMinTrail; }
87
88
0
    sal_uInt8 &GetCompoundMinLead() { return nCompoundMinLead; }
89
99
    sal_uInt8 GetCompoundMinLead() const { return nCompoundMinLead; }
90
91
2.85k
    sal_uInt8 &GetMaxHyphens() { return nMaxHyphens; }
92
287k
    sal_uInt8 GetMaxHyphens() const { return nMaxHyphens; }
93
94
82.5k
    sal_uInt8 &GetMinWordLength() { return nMinWordLength; }
95
99
    sal_uInt8 GetMinWordLength() const { return nMinWordLength; }
96
97
0
    sal_uInt16 &GetTextHyphenZone() { return nTextHyphenZone; }
98
99.6k
    sal_uInt16 GetTextHyphenZone() const { return nTextHyphenZone; }
99
100
0
    sal_uInt16 &GetTextHyphenZoneAlways() { return nTextHyphenZoneAlways; }
101
99.6k
    sal_uInt16 GetTextHyphenZoneAlways() const { return nTextHyphenZoneAlways; }
102
103
0
    sal_uInt16 &GetTextHyphenZoneColumn() { return nTextHyphenZoneColumn; }
104
99.5k
    sal_uInt16 GetTextHyphenZoneColumn() const { return nTextHyphenZoneColumn; }
105
106
0
    sal_uInt16 &GetTextHyphenZonePage() { return nTextHyphenZonePage; }
107
99.5k
    sal_uInt16 GetTextHyphenZonePage() const { return nTextHyphenZonePage; }
108
109
0
    sal_uInt16 &GetTextHyphenZoneSpread() { return nTextHyphenZoneSpread; }
110
99.5k
    sal_uInt16 GetTextHyphenZoneSpread() const { return nTextHyphenZoneSpread; }
111
112
0
    sal_uInt8 &GetKeepType() { return nKeepType; }
113
99
    sal_uInt8 GetKeepType() const { return nKeepType; }
114
115
0
    void SetKeepLine( const bool bNew ) { bKeepLine = bNew; }
116
99
    bool IsKeepLine() const { return bKeepLine; }
117
};
118
119
#endif
120
121
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */