fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / items / postattr.cxx
blob21fcfeeface5b802d13cb3b54b78799984429240
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "svx/postattr.hxx"
21 #include <editeng/itemtype.hxx>
22 #include <svx/svxitems.hrc>
23 #include <svx/dialmgr.hxx>
25 // -----------------------------------------------------------------------
27 TYPEINIT1_FACTORY(SvxPostItAuthorItem, SfxStringItem, new SvxPostItAuthorItem(0));
28 TYPEINIT1_FACTORY(SvxPostItDateItem, SfxStringItem, new SvxPostItDateItem(0));
29 TYPEINIT1_FACTORY(SvxPostItTextItem, SfxStringItem, new SvxPostItTextItem(0));
31 // class SvxPostItAuthorItem ---------------------------------------------
33 SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich )
35 SetWhich( _nWhich );
38 // -----------------------------------------------------------------------
40 SvxPostItAuthorItem::SvxPostItAuthorItem( const XubString& rAuthor,
41 sal_uInt16 _nWhich ) :
42 SfxStringItem( _nWhich, rAuthor )
46 //------------------------------------------------------------------------
48 SfxItemPresentation SvxPostItAuthorItem::GetPresentation
50 SfxItemPresentation ePres,
51 SfxMapUnit /*eCoreUnit*/,
52 SfxMapUnit /*ePresUnit*/,
53 OUString& rText, const IntlWrapper *
54 ) const
56 switch ( ePres )
58 case SFX_ITEM_PRESENTATION_NONE:
59 rText = OUString();
60 return SFX_ITEM_PRESENTATION_NONE;
61 case SFX_ITEM_PRESENTATION_NAMELESS:
62 rText = GetValue();
63 return SFX_ITEM_PRESENTATION_NAMELESS;
64 case SFX_ITEM_PRESENTATION_COMPLETE:
65 rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
66 return SFX_ITEM_PRESENTATION_COMPLETE;
67 default: ;//prevent warning
69 return SFX_ITEM_PRESENTATION_NONE;
72 // -----------------------------------------------------------------------
74 SfxPoolItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const
76 return new SvxPostItAuthorItem( *this );
79 // class SvxPostItDateItem -----------------------------------------------
81 SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich )
83 SetWhich( _nWhich );
86 // -----------------------------------------------------------------------
88 SvxPostItDateItem::SvxPostItDateItem( const XubString& rDate, sal_uInt16 _nWhich ) :
90 SfxStringItem( _nWhich, rDate )
94 //------------------------------------------------------------------------
96 SfxItemPresentation SvxPostItDateItem::GetPresentation
98 SfxItemPresentation ePres,
99 SfxMapUnit /*eCoreUnit*/,
100 SfxMapUnit /*ePresUnit*/,
101 OUString& rText, const IntlWrapper *
102 ) const
104 switch ( ePres )
106 case SFX_ITEM_PRESENTATION_NONE:
107 rText = OUString();
108 return SFX_ITEM_PRESENTATION_NONE;
109 case SFX_ITEM_PRESENTATION_NAMELESS:
110 rText = GetValue();
111 return SFX_ITEM_PRESENTATION_NAMELESS;
112 case SFX_ITEM_PRESENTATION_COMPLETE:
113 rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
114 return SFX_ITEM_PRESENTATION_COMPLETE;
115 default: ;//prevent warning
117 return SFX_ITEM_PRESENTATION_NONE;
120 // -----------------------------------------------------------------------
122 SfxPoolItem* SvxPostItDateItem::Clone( SfxItemPool * ) const
124 return new SvxPostItDateItem( *this );
127 // class SvxPostItTextItem -----------------------------------------------
129 SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich )
131 SetWhich( _nWhich );
134 // -----------------------------------------------------------------------
136 SvxPostItTextItem::SvxPostItTextItem( const XubString& rText, sal_uInt16 _nWhich ) :
138 SfxStringItem( _nWhich, rText )
142 //------------------------------------------------------------------------
144 SfxItemPresentation SvxPostItTextItem::GetPresentation
146 SfxItemPresentation ePres,
147 SfxMapUnit /*eCoreUnit*/,
148 SfxMapUnit /*ePresUnit*/,
149 OUString& rText, const IntlWrapper *
150 ) const
152 switch ( ePres )
154 case SFX_ITEM_PRESENTATION_NONE:
155 rText = OUString();
156 return SFX_ITEM_PRESENTATION_NONE;
157 case SFX_ITEM_PRESENTATION_NAMELESS:
158 rText = GetValue();
159 return SFX_ITEM_PRESENTATION_NAMELESS;
160 case SFX_ITEM_PRESENTATION_COMPLETE:
161 rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
162 return SFX_ITEM_PRESENTATION_COMPLETE;
163 default: ;//prevent warning
165 return SFX_ITEM_PRESENTATION_NONE;
168 // -----------------------------------------------------------------------
170 SfxPoolItem* SvxPostItTextItem::Clone( SfxItemPool * ) const
172 return new SvxPostItTextItem( *this );
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */