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 :
20 : #include "svx/postattr.hxx"
21 : #include <editeng/itemtype.hxx>
22 : #include <svx/svxitems.hrc>
23 : #include <svx/dialmgr.hxx>
24 :
25 :
26 :
27 0 : TYPEINIT1_FACTORY(SvxPostItAuthorItem, SfxStringItem, new SvxPostItAuthorItem(0));
28 0 : TYPEINIT1_FACTORY(SvxPostItDateItem, SfxStringItem, new SvxPostItDateItem(0));
29 0 : TYPEINIT1_FACTORY(SvxPostItTextItem, SfxStringItem, new SvxPostItTextItem(0));
30 :
31 : // class SvxPostItAuthorItem ---------------------------------------------
32 :
33 0 : SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich )
34 : {
35 0 : SetWhich( _nWhich );
36 0 : }
37 :
38 :
39 :
40 0 : SvxPostItAuthorItem::SvxPostItAuthorItem( const OUString& rAuthor,
41 : sal_uInt16 _nWhich ) :
42 0 : SfxStringItem( _nWhich, rAuthor )
43 : {
44 0 : }
45 :
46 :
47 :
48 0 : SfxItemPresentation SvxPostItAuthorItem::GetPresentation
49 : (
50 : SfxItemPresentation ePres,
51 : SfxMapUnit /*eCoreUnit*/,
52 : SfxMapUnit /*ePresUnit*/,
53 : OUString& rText, const IntlWrapper *
54 : ) const
55 : {
56 0 : switch ( ePres )
57 : {
58 : case SFX_ITEM_PRESENTATION_NONE:
59 0 : rText = OUString();
60 0 : return SFX_ITEM_PRESENTATION_NONE;
61 : case SFX_ITEM_PRESENTATION_NAMELESS:
62 0 : rText = GetValue();
63 0 : return SFX_ITEM_PRESENTATION_NAMELESS;
64 : case SFX_ITEM_PRESENTATION_COMPLETE:
65 0 : rText = SVX_RESSTR(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
66 0 : return SFX_ITEM_PRESENTATION_COMPLETE;
67 : default: ;//prevent warning
68 : }
69 0 : return SFX_ITEM_PRESENTATION_NONE;
70 : }
71 :
72 :
73 :
74 0 : SfxPoolItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const
75 : {
76 0 : return new SvxPostItAuthorItem( *this );
77 : }
78 :
79 : // class SvxPostItDateItem -----------------------------------------------
80 :
81 0 : SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich )
82 : {
83 0 : SetWhich( _nWhich );
84 0 : }
85 :
86 :
87 :
88 0 : SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, sal_uInt16 _nWhich ) :
89 :
90 0 : SfxStringItem( _nWhich, rDate )
91 : {
92 0 : }
93 :
94 :
95 :
96 0 : SfxItemPresentation SvxPostItDateItem::GetPresentation
97 : (
98 : SfxItemPresentation ePres,
99 : SfxMapUnit /*eCoreUnit*/,
100 : SfxMapUnit /*ePresUnit*/,
101 : OUString& rText, const IntlWrapper *
102 : ) const
103 : {
104 0 : switch ( ePres )
105 : {
106 : case SFX_ITEM_PRESENTATION_NONE:
107 0 : rText = OUString();
108 0 : return SFX_ITEM_PRESENTATION_NONE;
109 : case SFX_ITEM_PRESENTATION_NAMELESS:
110 0 : rText = GetValue();
111 0 : return SFX_ITEM_PRESENTATION_NAMELESS;
112 : case SFX_ITEM_PRESENTATION_COMPLETE:
113 0 : rText = SVX_RESSTR(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
114 0 : return SFX_ITEM_PRESENTATION_COMPLETE;
115 : default: ;//prevent warning
116 : }
117 0 : return SFX_ITEM_PRESENTATION_NONE;
118 : }
119 :
120 :
121 :
122 0 : SfxPoolItem* SvxPostItDateItem::Clone( SfxItemPool * ) const
123 : {
124 0 : return new SvxPostItDateItem( *this );
125 : }
126 :
127 : // class SvxPostItTextItem -----------------------------------------------
128 :
129 0 : SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich )
130 : {
131 0 : SetWhich( _nWhich );
132 0 : }
133 :
134 :
135 :
136 0 : SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, sal_uInt16 _nWhich ) :
137 :
138 0 : SfxStringItem( _nWhich, rText )
139 : {
140 0 : }
141 :
142 :
143 :
144 0 : SfxItemPresentation SvxPostItTextItem::GetPresentation
145 : (
146 : SfxItemPresentation ePres,
147 : SfxMapUnit /*eCoreUnit*/,
148 : SfxMapUnit /*ePresUnit*/,
149 : OUString& rText, const IntlWrapper *
150 : ) const
151 : {
152 0 : switch ( ePres )
153 : {
154 : case SFX_ITEM_PRESENTATION_NONE:
155 0 : rText = OUString();
156 0 : return SFX_ITEM_PRESENTATION_NONE;
157 : case SFX_ITEM_PRESENTATION_NAMELESS:
158 0 : rText = GetValue();
159 0 : return SFX_ITEM_PRESENTATION_NAMELESS;
160 : case SFX_ITEM_PRESENTATION_COMPLETE:
161 0 : rText = SVX_RESSTR(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
162 0 : return SFX_ITEM_PRESENTATION_COMPLETE;
163 : default: ;//prevent warning
164 : }
165 0 : return SFX_ITEM_PRESENTATION_NONE;
166 : }
167 :
168 :
169 :
170 0 : SfxPoolItem* SvxPostItTextItem::Clone( SfxItemPool * ) const
171 : {
172 0 : return new SvxPostItTextItem( *this );
173 : }
174 :
175 :
176 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|