|
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 boolean value class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPIMBOOLEANVALUE_H |
|
20 #define CPIMBOOLEANVALUE_H |
|
21 |
|
22 // INTERNAL INCLUDES |
|
23 #include "cpimvaluebase.h" |
|
24 |
|
25 // EXTERNAL INCLUDES |
|
26 #include <e32std.h> |
|
27 |
|
28 /** |
|
29 * Specialized boolean value class |
|
30 * @since S60 v3.1 |
|
31 */ |
|
32 NONSHARABLE_CLASS(CPIMBooleanValue) : public CPIMValueBase |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 * |
|
39 * @return New instance of this class. |
|
40 */ |
|
41 static CPIMBooleanValue* NewL(TPIMAttribute aAttributes, |
|
42 TBool aBooleanValue); |
|
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 CPIMBooleanValue* NewLC(TPIMAttribute aAttributes, |
|
51 TBool aBooleanValue); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~CPIMBooleanValue(); |
|
57 |
|
58 public: // Functions from CPIMValue |
|
59 |
|
60 /** |
|
61 * SetValue |
|
62 * Sets new boolean value for this field |
|
63 * value holder. The old value will be overwritten |
|
64 * |
|
65 * @param aBooleanValue New value |
|
66 */ |
|
67 virtual void SetBooleanValue(TBool aBooleanValue); |
|
68 |
|
69 /** |
|
70 * Value |
|
71 * Returns the value in this boolean value holder |
|
72 * The value cannot be modified |
|
73 * |
|
74 * @return Boolean value |
|
75 */ |
|
76 virtual TBool BooleanValue() const; |
|
77 |
|
78 private: |
|
79 |
|
80 /** |
|
81 * C++ constructor |
|
82 */ |
|
83 inline CPIMBooleanValue(TPIMAttribute aAttributes, |
|
84 TBool aBooleanValue); |
|
85 |
|
86 private: // Data |
|
87 |
|
88 // Boolean value |
|
89 TBool iBooleanValue; |
|
90 }; |
|
91 |
|
92 #endif // CPIMBOOLEANVALUE_H |
|
93 // End of file |