1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: postattr.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 // include ---------------------------------------------------------------
36 #define _SVX_POSTATTR_CXX
37 #include "postattr.hxx"
38 #include <svx/itemtype.hxx>
40 // -----------------------------------------------------------------------
42 TYPEINIT1_FACTORY(SvxPostItAuthorItem
, SfxStringItem
, new SvxPostItAuthorItem(0));
43 TYPEINIT1_FACTORY(SvxPostItDateItem
, SfxStringItem
, new SvxPostItDateItem(0));
44 TYPEINIT1_FACTORY(SvxPostItTextItem
, SfxStringItem
, new SvxPostItTextItem(0));
46 // class SvxPostItAuthorItem ---------------------------------------------
48 SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich
)
53 // -----------------------------------------------------------------------
55 SvxPostItAuthorItem::SvxPostItAuthorItem( const XubString
& rAuthor
,
56 sal_uInt16 _nWhich
) :
57 SfxStringItem( _nWhich
, rAuthor
)
61 //------------------------------------------------------------------------
63 SfxItemPresentation
SvxPostItAuthorItem::GetPresentation
65 SfxItemPresentation ePres
,
66 SfxMapUnit
/*eCoreUnit*/,
67 SfxMapUnit
/*ePresUnit*/,
68 XubString
& rText
, const IntlWrapper
*
73 case SFX_ITEM_PRESENTATION_NONE
:
75 return SFX_ITEM_PRESENTATION_NONE
;
76 case SFX_ITEM_PRESENTATION_NAMELESS
:
78 return SFX_ITEM_PRESENTATION_NAMELESS
;
79 case SFX_ITEM_PRESENTATION_COMPLETE
:
80 rText
= SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE
);
82 return SFX_ITEM_PRESENTATION_COMPLETE
;
83 default: ;//prevent warning
85 return SFX_ITEM_PRESENTATION_NONE
;
88 // -----------------------------------------------------------------------
90 SfxPoolItem
* __EXPORT
SvxPostItAuthorItem::Clone( SfxItemPool
* ) const
92 return new SvxPostItAuthorItem( *this );
95 // class SvxPostItDateItem -----------------------------------------------
97 SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich
)
102 // -----------------------------------------------------------------------
104 SvxPostItDateItem::SvxPostItDateItem( const XubString
& rDate
, sal_uInt16 _nWhich
) :
106 SfxStringItem( _nWhich
, rDate
)
110 //------------------------------------------------------------------------
112 SfxItemPresentation
SvxPostItDateItem::GetPresentation
114 SfxItemPresentation ePres
,
115 SfxMapUnit
/*eCoreUnit*/,
116 SfxMapUnit
/*ePresUnit*/,
117 XubString
& rText
, const IntlWrapper
*
122 case SFX_ITEM_PRESENTATION_NONE
:
124 return SFX_ITEM_PRESENTATION_NONE
;
125 case SFX_ITEM_PRESENTATION_NAMELESS
:
127 return SFX_ITEM_PRESENTATION_NAMELESS
;
128 case SFX_ITEM_PRESENTATION_COMPLETE
:
129 rText
= SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE
);
131 return SFX_ITEM_PRESENTATION_COMPLETE
;
132 default: ;//prevent warning
134 return SFX_ITEM_PRESENTATION_NONE
;
137 // -----------------------------------------------------------------------
139 SfxPoolItem
* __EXPORT
SvxPostItDateItem::Clone( SfxItemPool
* ) const
141 return new SvxPostItDateItem( *this );
144 // class SvxPostItTextItem -----------------------------------------------
146 SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich
)
151 // -----------------------------------------------------------------------
153 SvxPostItTextItem::SvxPostItTextItem( const XubString
& rText
, sal_uInt16 _nWhich
) :
155 SfxStringItem( _nWhich
, rText
)
159 //------------------------------------------------------------------------
161 SfxItemPresentation
SvxPostItTextItem::GetPresentation
163 SfxItemPresentation ePres
,
164 SfxMapUnit
/*eCoreUnit*/,
165 SfxMapUnit
/*ePresUnit*/,
166 XubString
& rText
, const IntlWrapper
*
171 case SFX_ITEM_PRESENTATION_NONE
:
173 return SFX_ITEM_PRESENTATION_NONE
;
174 case SFX_ITEM_PRESENTATION_NAMELESS
:
176 return SFX_ITEM_PRESENTATION_NAMELESS
;
177 case SFX_ITEM_PRESENTATION_COMPLETE
:
178 rText
= SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE
);
180 return SFX_ITEM_PRESENTATION_COMPLETE
;
181 default: ;//prevent warning
183 return SFX_ITEM_PRESENTATION_NONE
;
186 // -----------------------------------------------------------------------
188 SfxPoolItem
* __EXPORT
SvxPostItTextItem::Clone( SfxItemPool
* ) const
190 return new SvxPostItTextItem( *this );