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
37 SfxStringItem( _nWhich, rAuthor )
38{
39}
40
41
43(
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 : SfxStringItem(_nWhich)
70{
71}
72
73
75 SfxStringItem( _nWhich, rDate )
76{
77}
78
79
81(
83 MapUnit /*eCoreUnit*/,
84 MapUnit /*ePresUnit*/,
85 OUString& rText, const IntlWrapper&
86) const
87{
88 switch ( ePres )
89 {
90 case SfxItemPresentation::Nameless:
91 rText = GetValue();
92 return true;
93 case SfxItemPresentation::Complete:
94 rText = SvxResId(RID_SVXITEMS_DATE_COMPLETE) + GetValue();
95 return true;
96 default: ;//prevent warning
97 }
98 return false;
99}
100
101
103{
104 return new SvxPostItDateItem( *this );
105}
106
108{
109 SetWhich( _nWhich );
110}
111
113
114 SfxStringItem( _nWhich, rText )
115{
116}
117
119(
121 MapUnit /*eCoreUnit*/,
122 MapUnit /*ePresUnit*/,
123 OUString& rText, const IntlWrapper&
124) const
125{
126 switch ( ePres )
127 {
128 case SfxItemPresentation::Nameless:
129 rText = GetValue();
130 return true;
131 case SfxItemPresentation::Complete:
132 rText = SvxResId(RID_SVXITEMS_TEXT_COMPLETE) + GetValue();
133 return true;
134 default: ;//prevent warning
135 }
136 return false;
137}
138
140{
141 return new SvxPostItTextItem( *this );
142}
143
145{
146 SetWhich( _nWhich );
147}
148
150{
151 return new SvxPostItIdItem( *this );
152}
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & GetValue() const
void SetWhich(sal_uInt16 nId)
The author shorthand symbol of a note.
Definition: postattr.hxx:29
virtual SvxPostItAuthorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:63
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:43
SvxPostItAuthorItem(TypedWhichId< SvxPostItAuthorItem > nWhich)
Definition: postattr.cxx:29
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:24
The date of a note.
Definition: postattr.hxx:49
SvxPostItDateItem(TypedWhichId< SvxPostItDateItem > nWhich)
Definition: postattr.cxx:68
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:81
virtual SvxPostItDateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:102
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:25
The internal id of a note.
Definition: postattr.hxx:89
virtual SvxPostItIdItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:149
SvxPostItIdItem(TypedWhichId< SvxPostItIdItem > nWhich)
Definition: postattr.cxx:144
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:27
The text of a note.
Definition: postattr.hxx:68
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: postattr.cxx:119
virtual SvxPostItTextItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: postattr.cxx:139
SvxPostItTextItem(TypedWhichId< SvxPostItTextItem > nWhich)
Definition: postattr.cxx:107
static SfxPoolItem * CreateDefault()
Definition: postattr.cxx:26
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
MapUnit
SfxItemPresentation