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_FORMATBREAKITEM_HXX
20 : #define INCLUDED_EDITENG_FORMATBREAKITEM_HXX
21 :
22 : #include <svl/eitem.hxx>
23 : #include <editeng/svxenum.hxx>
24 : #include <editeng/editengdllapi.h>
25 :
26 :
27 : // class SvxFmtBreakItem -------------------------------------------------
28 :
29 : /* [Description]
30 :
31 : This item Describes a wrap-attribute
32 : Automatic?, Page or column break, before or after?
33 : */
34 : #define FMTBREAK_NOAUTO ((sal_uInt16)0x0001)
35 :
36 5456 : class EDITENG_DLLPUBLIC SvxFmtBreakItem : public SfxEnumItem
37 : {
38 : public:
39 : TYPEINFO_OVERRIDE();
40 :
41 : inline SvxFmtBreakItem( const SvxBreak eBrk /*= SVX_BREAK_NONE*/,
42 : const sal_uInt16 nWhich );
43 : inline SvxFmtBreakItem( const SvxFmtBreakItem& rBreak );
44 : inline SvxFmtBreakItem& operator=( const SvxFmtBreakItem& rCpy );
45 :
46 : // "pure virtual Methods" from SfxPoolItem
47 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
48 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
49 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
50 :
51 : virtual bool GetPresentation( SfxItemPresentation ePres,
52 : SfxMapUnit eCoreMetric,
53 : SfxMapUnit ePresMetric,
54 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
55 : virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const SAL_OVERRIDE;
56 :
57 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
58 : virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
59 : virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const SAL_OVERRIDE;
60 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 ) const SAL_OVERRIDE;
61 : virtual sal_uInt16 GetValueCount() const SAL_OVERRIDE;
62 :
63 : // MS VC4.0 messes things up
64 1172 : void SetValue( sal_uInt16 nNewVal )
65 1172 : {SfxEnumItem::SetValue(nNewVal); }
66 332220 : SvxBreak GetBreak() const { return SvxBreak( GetValue() ); }
67 : void SetBreak( const SvxBreak eNew )
68 : { SetValue( (sal_uInt16)eNew ); }
69 : };
70 :
71 :
72 718 : inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxBreak eBreak,
73 : const sal_uInt16 _nWhich ) :
74 718 : SfxEnumItem( _nWhich, (sal_uInt16)eBreak )
75 718 : {}
76 :
77 2326 : inline SvxFmtBreakItem::SvxFmtBreakItem( const SvxFmtBreakItem& rBreak ) :
78 2326 : SfxEnumItem( rBreak )
79 2326 : {}
80 :
81 0 : inline SvxFmtBreakItem& SvxFmtBreakItem::operator=(
82 : const SvxFmtBreakItem& rBreak )
83 : {
84 0 : SetValue( rBreak.GetValue() );
85 0 : return *this;
86 : }
87 :
88 : #endif
89 :
90 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|