Line data Source code
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 SvXMLUnitConverter;
26 :
27 : // class SvxHyphenZoneItem -----------------------------------------------
28 :
29 : /* [Description]
30 :
31 : This item describes a hyphenation attribute (automatic?, number of
32 : characters at the end of the line and start).
33 : */
34 :
35 76398 : class EDITENG_DLLPUBLIC SvxHyphenZoneItem : public SfxPoolItem
36 : {
37 : bool bHyphen : 1;
38 : bool bPageEnd : 1;
39 : sal_uInt8 nMinLead;
40 : sal_uInt8 nMinTrail;
41 : sal_uInt8 nMaxHyphens;
42 :
43 : friend SvStream & WriteSvxHyphenZoneItem( SvStream & aS, SvxHyphenZoneItem & );
44 :
45 : public:
46 : TYPEINFO_OVERRIDE();
47 :
48 : SvxHyphenZoneItem( const bool bHyph /*= false*/,
49 : const sal_uInt16 nId );
50 :
51 : // "pure virtual Methods" from SfxPoolItem
52 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
53 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
54 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
55 :
56 : virtual bool GetPresentation( SfxItemPresentation ePres,
57 : SfxMapUnit eCoreMetric,
58 : SfxMapUnit ePresMetric,
59 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
60 :
61 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
62 : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const SAL_OVERRIDE;
63 : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
64 :
65 110 : inline void SetHyphen( const bool bNew ) { bHyphen = bNew; }
66 100478 : inline bool IsHyphen() const { return bHyphen; }
67 :
68 0 : inline void SetPageEnd( const bool bNew ) { bPageEnd = bNew; }
69 144 : inline bool IsPageEnd() const { return bPageEnd; }
70 :
71 4732 : inline sal_uInt8 &GetMinLead() { return nMinLead; }
72 162 : inline sal_uInt8 GetMinLead() const { return nMinLead; }
73 :
74 4732 : inline sal_uInt8 &GetMinTrail() { return nMinTrail; }
75 162 : inline sal_uInt8 GetMinTrail() const { return nMinTrail; }
76 :
77 92 : inline sal_uInt8 &GetMaxHyphens() { return nMaxHyphens; }
78 180707 : inline sal_uInt8 GetMaxHyphens() const { return nMaxHyphens; }
79 :
80 : inline SvxHyphenZoneItem &operator=( const SvxHyphenZoneItem &rNew )
81 : {
82 : bHyphen = rNew.IsHyphen();
83 : bPageEnd = rNew.IsPageEnd();
84 : nMinLead = rNew.GetMinLead();
85 : nMinTrail = rNew.GetMinTrail();
86 : nMaxHyphens = rNew.GetMaxHyphens();
87 : return *this;
88 : }
89 : };
90 :
91 : #endif
92 :
93 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|