xref: /trunk/main/editeng/inc/editeng/hyznitem.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_HYZNITEM_HXX
24 #define _SVX_HYZNITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svl/poolitem.hxx>
29 #include <editeng/editengdllapi.h>
30 
31 class SvXMLUnitConverter;
32 namespace rtl
33 {
34     class OUString;
35 }
36 
37 // class SvxHyphenZoneItem -----------------------------------------------
38 
39 /*
40 [Beschreibung]
41 Dieses Item beschreibt ein Silbentrennungsattribut (Automatisch?, Anzahl der
42 Zeichen am Zeilenende und -anfang).
43 */
44 
45 class EDITENG_DLLPUBLIC SvxHyphenZoneItem : public SfxPoolItem
46 {
47     sal_Bool bHyphen:  1;
48     sal_Bool bPageEnd: 1;
49     sal_uInt8 nMinLead;
50     sal_uInt8 nMinTrail;
51     sal_uInt8 nMaxHyphens;
52 
53     friend SvStream & operator<<( SvStream & aS, SvxHyphenZoneItem & );
54 
55 public:
56     TYPEINFO();
57 
58     SvxHyphenZoneItem( const sal_Bool bHyph /*= sal_False*/,
59                        const sal_uInt16 nId  );
60 
61     // "pure virtual Methoden" vom SfxPoolItem
62     virtual int              operator==( const SfxPoolItem& ) const;
63     virtual sal_Bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
64     virtual sal_Bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
65 
66     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
67                                     SfxMapUnit eCoreMetric,
68                                     SfxMapUnit ePresMetric,
69                                     String &rText, const IntlWrapper * = 0 ) const;
70 
71     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
72     virtual SfxPoolItem*     Create(SvStream &, sal_uInt16) const;
73     virtual SvStream&        Store(SvStream &, sal_uInt16 nItemVersion ) const;
74 
SetHyphen(const sal_Bool bNew)75     inline void SetHyphen( const sal_Bool bNew ) { bHyphen = bNew; }
IsHyphen() const76     inline sal_Bool IsHyphen() const { return bHyphen; }
77 
SetPageEnd(const sal_Bool bNew)78     inline void SetPageEnd( const sal_Bool bNew ) { bPageEnd = bNew; }
IsPageEnd() const79     inline sal_Bool IsPageEnd() const { return bPageEnd; }
80 
GetMinLead()81     inline sal_uInt8 &GetMinLead() { return nMinLead; }
GetMinLead() const82     inline sal_uInt8 GetMinLead() const { return nMinLead; }
83 
GetMinTrail()84     inline sal_uInt8 &GetMinTrail() { return nMinTrail; }
GetMinTrail() const85     inline sal_uInt8 GetMinTrail() const { return nMinTrail; }
86 
GetMaxHyphens()87     inline sal_uInt8 &GetMaxHyphens() { return nMaxHyphens; }
GetMaxHyphens() const88     inline sal_uInt8 GetMaxHyphens() const { return nMaxHyphens; }
89 
operator =(const SvxHyphenZoneItem & rNew)90     inline SvxHyphenZoneItem &operator=( const SvxHyphenZoneItem &rNew )
91     {
92         bHyphen = rNew.IsHyphen();
93         bPageEnd = rNew.IsPageEnd();
94         nMinLead = rNew.GetMinLead();
95         nMinTrail = rNew.GetMinTrail();
96         nMaxHyphens = rNew.GetMaxHyphens();
97         return *this;
98     }
99 };
100 
101 #endif
102