xref: /aoo4110/main/editeng/inc/editeng/brkitem.hxx (revision b1cdbd2c)
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_BRKITEM_HXX
24 #define _SVX_BRKITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svl/eitem.hxx>
29 #include <editeng/svxenum.hxx>
30 #include <editeng/editengdllapi.h>
31 
32 namespace rtl
33 {
34 	class OUString;
35 }
36 
37 // class SvxFmtBreakItem -------------------------------------------------
38 
39 /*
40 	[Beschreibung]
41 	Dieses Item beschreibt ein Umbruch-Attribut
42 	Automatisch?, Seiten- oder Spaltenumbruch, davor oder danach?
43 */
44 #define	FMTBREAK_NOAUTO	((sal_uInt16)0x0001)
45 
46 class EDITENG_DLLPUBLIC SvxFmtBreakItem : public SfxEnumItem
47 {
48 public:
49 	TYPEINFO();
50 
51     inline SvxFmtBreakItem( const SvxBreak eBrk /*= SVX_BREAK_NONE*/,
52                             const sal_uInt16 nWhich );
53 	inline SvxFmtBreakItem( const SvxFmtBreakItem& rBreak );
54 	inline SvxFmtBreakItem& operator=( const SvxFmtBreakItem& rCpy );
55 
56 	// "pure virtual Methoden" vom SfxPoolItem
57 	virtual int 			 operator==( const SfxPoolItem& ) const;
58 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
59 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
60 
61 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
62 									SfxMapUnit eCoreMetric,
63 									SfxMapUnit ePresMetric,
64                                     String &rText, const IntlWrapper * = 0 ) const;
65 	virtual String			 GetValueTextByPos( sal_uInt16 nPos ) const;
66 
67 	virtual SfxPoolItem*	 Clone( SfxItemPool *pPool = 0 ) const;
68 	virtual SvStream&		 Store( SvStream& , sal_uInt16 nItemVersion ) const;
69 	virtual sal_uInt16			 GetVersion( sal_uInt16 nFileVersion ) const;
70 	virtual SfxPoolItem*	 Create( SvStream&, sal_uInt16 ) const;
71 	virtual sal_uInt16			 GetValueCount() const;
72 
73 	// MS VC4.0 kommt durcheinander
SetValue(sal_uInt16 nNewVal)74 	void			 SetValue( sal_uInt16 nNewVal )
75 								{SfxEnumItem::SetValue(nNewVal); }
GetBreak() const76 	SvxBreak			 GetBreak() const { return SvxBreak( GetValue() ); }
SetBreak(const SvxBreak eNew)77 	void					 SetBreak( const SvxBreak eNew )
78 								{ SetValue( (sal_uInt16)eNew ); }
79 };
80 
81 
SvxFmtBreakItem(const SvxBreak eBreak,const sal_uInt16 _nWhich)82 inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxBreak eBreak,
83                                          const sal_uInt16 _nWhich ) :
84     SfxEnumItem( _nWhich, (sal_uInt16)eBreak )
85 {}
86 
SvxFmtBreakItem(const SvxFmtBreakItem & rBreak)87 inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxFmtBreakItem& rBreak ) :
88 	SfxEnumItem( rBreak )
89 {}
90 
operator =(const SvxFmtBreakItem & rBreak)91 inline SvxFmtBreakItem& SvxFmtBreakItem::operator=(
92 	const SvxFmtBreakItem& rBreak )
93 {
94 	SetValue( rBreak.GetValue() );
95 	return *this;
96 }
97 
98 #endif
99 
100