|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Specialized string value class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPIMSTRINGVALUE_H |
|
20 #define CPIMSTRINGVALUE_H |
|
21 |
|
22 // INTERNAL INCLUDES |
|
23 #include "cpimvaluebase.h" |
|
24 |
|
25 // EXTERNAL INCLUDES |
|
26 #include <e32std.h> |
|
27 |
|
28 /** |
|
29 * Specialized string value class |
|
30 * @since S60 v3.1 |
|
31 */ |
|
32 NONSHARABLE_CLASS(CPIMStringValue) : public CPIMValueBase |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 * |
|
39 * @return New instance of this class. |
|
40 */ |
|
41 static CPIMStringValue* NewL(TPIMAttribute aAttributes, |
|
42 HBufC* aStringValue); |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * |
|
47 * @return New instance of this class. The instance |
|
48 * is pushed to the cleanup stack |
|
49 */ |
|
50 static CPIMStringValue* NewLC(TPIMAttribute aAttributes, |
|
51 HBufC* aStringValue); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~CPIMStringValue(); |
|
57 |
|
58 public: // Functions from CPIMValue |
|
59 |
|
60 /** |
|
61 * SetValue |
|
62 * Sets new integer value for this field value holder |
|
63 * The old value will be overwritten and the ownership |
|
64 * is transferred to this class |
|
65 * |
|
66 * @param aIntegerValue New value |
|
67 */ |
|
68 virtual void SetStringValue(const HBufC* aStringValue); |
|
69 |
|
70 /** |
|
71 * Value. Returns a string value of this value holder |
|
72 * NOTE: The ownership is NOT transferred to the caller |
|
73 * @return String value |
|
74 */ |
|
75 virtual const HBufC* StringValue() const; |
|
76 |
|
77 private: |
|
78 |
|
79 /** |
|
80 * C++ constructor |
|
81 */ |
|
82 inline CPIMStringValue(TPIMAttribute aAttributes, |
|
83 HBufC* aStringValue); |
|
84 |
|
85 private: // Data |
|
86 |
|
87 // String value. Owned |
|
88 const HBufC* iStringValue; |
|
89 }; |
|
90 |
|
91 #endif // CPIMSTRINGVALUE_H |