LibreOffice Module svx (master)  1
postattr.cxx
Go to the documentation of this file.
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 <svx/strings.hrc>
22 #include <svx/dialmgr.hxx>
23 
28 
30 {
31  SetWhich( _nWhich );
32 }
33 
34 
36  sal_uInt16 _nWhich ) :
37  SfxStringItem( _nWhich, rAuthor )
38 {
39 }
40 
41 
43 (
44  SfxItemPresentation ePres,
45  MapUnit /*eCoreUnit*/,
46  MapUnit /*ePresUnit*/,
47  OUString& rText, const IntlWrapper&
48 ) const
49 {
50  switch ( ePres )
51  {
52  case SfxItemPresentation::Nameless:
53  rText = GetValue();
54  return true;
55  case SfxItemPresentation::Complete:
56  rText = SvxResId(RID_SVXITEMS_AUTHOR_COMPLETE) + GetValue();
57  return true;
58  default: ;//prevent warning
59  }
60  return false;
61 }
62 
64 {
65  return new SvxPostItAuthorItem( *this );
66 }
67 
69 {
70  SetWhich( _nWhich );
71 }
72 
73 
74 SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, sal_uInt16 _nWhich ) :
75 
76  SfxStringItem( _nWhich, rDate )
77 {
78 }
79 
80 
82 (
83  SfxItemPresentation ePres,
84  MapUnit /*eCoreUnit*/,
85  MapUnit /*ePresUnit*/,
86  OUString& rText, const IntlWrapper&
87 ) const
88 {
89  switch ( ePres )
90  {
91  case SfxItemPresentation::Nameless:
92  rText = GetValue();
93  return true;
94  case SfxItemPresentation::Complete:
95  rText = SvxResId(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
96  return true;
97  default: ;//prevent warning
98  }
99  return false;
100 }
101 
102 
104 {
105  return new SvxPostItDateItem( *this );
106 }
107 
109 {
110  SetWhich( _nWhich );
111 }
112 
113 SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, sal_uInt16 _nWhich ) :
114 
115  SfxStringItem( _nWhich, rText )
116 {
117 }
118 
120 (
121  SfxItemPresentation ePres,
122  MapUnit /*eCoreUnit*/,
123  MapUnit /*ePresUnit*/,
124  OUString& rText, const IntlWrapper&
125 ) const
126 {
127  switch ( ePres )
128  {
129  case SfxItemPresentation::Nameless:
130  rText = GetValue();
131  return true;
132  case SfxItemPresentation::Complete:
133  rText = SvxResId(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
134  return true;
135  default: ;//prevent warning
136  }
137  return false;
138 }
139 
141 {
142  return new SvxPostItTextItem( *this );
143 }
144 
145 SvxPostItIdItem::SvxPostItIdItem( sal_uInt16 _nWhich )
146 {
147  SetWhich( _nWhich );
148 }
149 
151 {
152  return new SvxPostItIdItem( *this );
153 }
154 
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:25
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:26
The date of a note.
Definition: postattr.hxx:48
std::string GetValue
SvxPostItDateItem(sal_uInt16 nWhich)
Definition: postattr.cxx:68
virtual SvxPostItAuthorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:63
SvxPostItAuthorItem(sal_uInt16 nWhich)
Definition: postattr.cxx:29
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:25
virtual SvxPostItIdItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:150
virtual SvxPostItDateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:103
SfxItemPresentation
virtual SvxPostItTextItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:140
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:120
SvxPostItTextItem(sal_uInt16 nWhich)
Definition: postattr.cxx:108
SvxPostItIdItem(sal_uInt16 nWhich)
Definition: postattr.cxx:145
The text of a note.
Definition: postattr.hxx:67
void SetWhich(sal_uInt16 nId)
The author shorthand symbol of a note.
Definition: postattr.hxx:28
MapUnit
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:27
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:43
The internal id of a note.
Definition: postattr.hxx:88
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:82
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:24