Update ooo320-m1
[ooovba.git] / svx / source / items / postattr.cxx
blobc694ab4863ad83ecd44ef61354917dad569cec8e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: postattr.cxx,v $
10 * $Revision: 1.8 $
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 )
50 SetWhich( _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 *
69 ) const
71 switch ( ePres )
73 case SFX_ITEM_PRESENTATION_NONE:
74 rText.Erase();
75 return SFX_ITEM_PRESENTATION_NONE;
76 case SFX_ITEM_PRESENTATION_NAMELESS:
77 rText = GetValue();
78 return SFX_ITEM_PRESENTATION_NAMELESS;
79 case SFX_ITEM_PRESENTATION_COMPLETE:
80 rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE);
81 rText += GetValue();
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 )
99 SetWhich( _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 *
118 ) const
120 switch ( ePres )
122 case SFX_ITEM_PRESENTATION_NONE:
123 rText.Erase();
124 return SFX_ITEM_PRESENTATION_NONE;
125 case SFX_ITEM_PRESENTATION_NAMELESS:
126 rText = GetValue();
127 return SFX_ITEM_PRESENTATION_NAMELESS;
128 case SFX_ITEM_PRESENTATION_COMPLETE:
129 rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE);
130 rText += GetValue();
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 )
148 SetWhich( _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 *
167 ) const
169 switch ( ePres )
171 case SFX_ITEM_PRESENTATION_NONE:
172 rText.Erase();
173 return SFX_ITEM_PRESENTATION_NONE;
174 case SFX_ITEM_PRESENTATION_NAMELESS:
175 rText = GetValue();
176 return SFX_ITEM_PRESENTATION_NAMELESS;
177 case SFX_ITEM_PRESENTATION_COMPLETE:
178 rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE);
179 rText += GetValue();
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 );