|
1 /* |
|
2 * Copyright (c) 2007 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: Defines RealValue for attributeTypes.. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef ALFREALVALUE_H |
|
20 #define ALFREALVALUE_H |
|
21 |
|
22 //INCLUDES |
|
23 #include <osn/osndefines.h> |
|
24 #include <memory> |
|
25 #include "alf/alfattributevaluetype.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 using std::auto_ptr; |
|
30 |
|
31 namespace Alf |
|
32 { |
|
33 |
|
34 /** |
|
35 * A class for a real value type. |
|
36 * |
|
37 * @lib alfwidgetmodel.lib |
|
38 * @since S60 ?S60_version |
|
39 */ |
|
40 class AlfRealValue : public AlfAttributeValueType |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 * |
|
47 * @since S60 ?S60_version |
|
48 * @param aValue The value of the attribute. Makes a copy of the attribute. |
|
49 * @return New object. |
|
50 */ |
|
51 AlfRealValue( float aValue, TAlfUnit aUnit = EAlfUnitNormalized ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~AlfRealValue(); |
|
57 |
|
58 /** |
|
59 * Gets the real value. |
|
60 * |
|
61 * @since S60 ?S60_version |
|
62 * @return The real value. |
|
63 */ |
|
64 float virtual realValue() const; |
|
65 |
|
66 /** |
|
67 * Gets the type of the attribute value. |
|
68 * |
|
69 * @since S60 ?S60_version |
|
70 * @return The type of the value. |
|
71 */ |
|
72 virtual Type type() const; |
|
73 |
|
74 /** |
|
75 * Gets the unit. |
|
76 * |
|
77 * @since S60 ?S60_version |
|
78 * @return The unit. |
|
79 */ |
|
80 virtual TAlfUnit unit() const; |
|
81 |
|
82 private: // data |
|
83 |
|
84 float mReal; |
|
85 TAlfUnit mUnit; |
|
86 |
|
87 }; |
|
88 |
|
89 } // namespace Alf |
|
90 |
|
91 #endif // ALFREALVALUE_H |