Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FMTFTNTX_HXX
29 : : #define _FMTFTNTX_HXX
30 : :
31 : : #include <svl/eitem.hxx>
32 : : #include <hintids.hxx>
33 : : #include <format.hxx>
34 : : #include <numrule.hxx>
35 : : #include "swdllapi.h"
36 : :
37 : : enum SwFtnEndPosEnum
38 : : {
39 : : FTNEND_ATPGORDOCEND, // at page or document end
40 : : FTNEND_ATTXTEND, // at end of the current text end
41 : : FTNEND_ATTXTEND_OWNNUMSEQ, // -""- and with own number sequence
42 : : FTNEND_ATTXTEND_OWNNUMANDFMT, // -""- and with own numberformat
43 : : FTNEND_ATTXTEND_END
44 : : };
45 : :
46 : :
47 [ + - ][ - + ]: 254 : class SW_DLLPUBLIC SwFmtFtnEndAtTxtEnd : public SfxEnumItem
48 : : {
49 : : rtl::OUString sPrefix;
50 : : rtl::OUString sSuffix;
51 : : SvxNumberType aFmt;
52 : : sal_uInt16 nOffset;
53 : :
54 : : protected:
55 : 254 : SwFmtFtnEndAtTxtEnd( sal_uInt16 nWhichL, SwFtnEndPosEnum ePos )
56 [ + - ]: 254 : : SfxEnumItem( nWhichL, sal::static_int_cast< sal_uInt16 >(ePos) ), nOffset( 0 )
57 : 254 : {}
58 : : SwFmtFtnEndAtTxtEnd( const SwFmtFtnEndAtTxtEnd& rAttr )
59 : : : SfxEnumItem( rAttr ), sPrefix( rAttr.sPrefix ),
60 : : sSuffix( rAttr.sSuffix ), aFmt( rAttr.aFmt ),
61 : : nOffset( rAttr.nOffset )
62 : : {}
63 : :
64 : : public:
65 : : virtual sal_uInt16 GetValueCount() const;
66 : :
67 : : virtual int operator==( const SfxPoolItem& ) const;
68 : :
69 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
70 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
71 : :
72 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
73 : : SfxMapUnit eCoreMetric,
74 : : SfxMapUnit ePresMetric,
75 : : String &rText,
76 : : const IntlWrapper* pIntl = 0 ) const;
77 : :
78 : 326 : inline sal_Bool IsAtEnd() const { return FTNEND_ATPGORDOCEND != GetValue(); }
79 : :
80 : : SwFmtFtnEndAtTxtEnd & operator=( const SwFmtFtnEndAtTxtEnd & rAttr );
81 : :
82 : 0 : sal_Int16 GetNumType() const { return aFmt.GetNumberingType(); }
83 : 129 : void SetNumType( sal_Int16 eType ) { aFmt.SetNumberingType(eType); }
84 : :
85 : 0 : const SvxNumberType& GetSwNumType() const { return aFmt; }
86 : :
87 : 0 : sal_uInt16 GetOffset() const { return nOffset; }
88 : 0 : void SetOffset( sal_uInt16 nOff ) { nOffset = nOff; }
89 : :
90 : 0 : const rtl::OUString& GetPrefix() const { return sPrefix; }
91 : 0 : void SetPrefix(const rtl::OUString& rSet) { sPrefix = rSet; }
92 : :
93 : 0 : const rtl::OUString& GetSuffix() const { return sSuffix; }
94 : 0 : void SetSuffix(const rtl::OUString& rSet) { sSuffix = rSet; }
95 : : };
96 : :
97 [ - + ]: 302 : class SW_DLLPUBLIC SwFmtFtnAtTxtEnd : public SwFmtFtnEndAtTxtEnd
98 : : {
99 : : public:
100 : 125 : SwFmtFtnAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
101 : 125 : : SwFmtFtnEndAtTxtEnd( RES_FTN_AT_TXTEND, ePos )
102 : 125 : {}
103 : :
104 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
105 : : };
106 : :
107 [ - + ]: 314 : class SW_DLLPUBLIC SwFmtEndAtTxtEnd : public SwFmtFtnEndAtTxtEnd
108 : : {
109 : : public:
110 : 129 : SwFmtEndAtTxtEnd( SwFtnEndPosEnum ePos = FTNEND_ATPGORDOCEND )
111 : 129 : : SwFmtFtnEndAtTxtEnd( RES_END_AT_TXTEND, ePos )
112 : : {
113 : 129 : SetNumType( SVX_NUM_ROMAN_LOWER );
114 : 129 : }
115 : :
116 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
117 : : };
118 : :
119 : 238 : inline const SwFmtFtnAtTxtEnd &SwAttrSet::GetFtnAtTxtEnd(sal_Bool bInP) const
120 : 238 : { return (const SwFmtFtnAtTxtEnd&)Get( RES_FTN_AT_TXTEND, bInP); }
121 : 326 : inline const SwFmtEndAtTxtEnd &SwAttrSet::GetEndAtTxtEnd(sal_Bool bInP) const
122 : 326 : { return (const SwFmtEndAtTxtEnd&)Get( RES_END_AT_TXTEND, bInP); }
123 : :
124 : :
125 : 238 : inline const SwFmtFtnAtTxtEnd &SwFmt::GetFtnAtTxtEnd(sal_Bool bInP) const
126 : 238 : { return aSet.GetFtnAtTxtEnd(bInP); }
127 : 326 : inline const SwFmtEndAtTxtEnd &SwFmt::GetEndAtTxtEnd(sal_Bool bInP) const
128 : 326 : { return aSet.GetEndAtTxtEnd(bInP); }
129 : :
130 : : #endif
131 : :
132 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|