|
1 /* |
|
2 * Copyright (c) 2008-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: Header file of central repository database property class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CENREPDATABASEPROPERTY_H |
|
20 #define C_CENREPDATABASEPROPERTY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * central repository property class |
|
26 * |
|
27 * This class represent one property in central repository |
|
28 * |
|
29 * @lib cenrepdatabase.lib |
|
30 * @since S60 V3.2 |
|
31 */ |
|
32 NONSHARABLE_CLASS( CCenRepDatabaseProperty ): public CBase |
|
33 { |
|
34 public: // Constructor and destructor |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 */ |
|
39 IMPORT_C static CCenRepDatabaseProperty* NewL(); |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 IMPORT_C static CCenRepDatabaseProperty* NewLC(); |
|
45 |
|
46 /** |
|
47 * Destructors. |
|
48 */ |
|
49 IMPORT_C virtual ~CCenRepDatabaseProperty(); |
|
50 |
|
51 public: // member functions |
|
52 /** |
|
53 * Returns the name of this property |
|
54 * |
|
55 * @since S60 V3.2 |
|
56 * @return Name of property |
|
57 */ |
|
58 IMPORT_C TUint32 GetName() const; |
|
59 |
|
60 /** |
|
61 * Sets the name for this property |
|
62 * |
|
63 * @since S60 V3.2 |
|
64 * @param aPropertyname new property name |
|
65 */ |
|
66 IMPORT_C void SetName( TUint32 aPropertyname ); |
|
67 |
|
68 /** |
|
69 * Returns value of property |
|
70 * |
|
71 * @since S60 V3.2 |
|
72 * @param aValue on return, TInt value |
|
73 * @return Error code |
|
74 */ |
|
75 IMPORT_C TInt GetValue( TInt& aValue ) const; |
|
76 |
|
77 /** |
|
78 * Sets value of property. Value must match to datatype. |
|
79 * |
|
80 * @since S60 V3.2 |
|
81 * @param aValue new TInt value to be set |
|
82 * @return Error code |
|
83 */ |
|
84 IMPORT_C TInt SetValue( TInt aValue ); |
|
85 |
|
86 /** |
|
87 * Returns value of property |
|
88 * |
|
89 * @since S60 V3.2 |
|
90 * @param aValue on return, descriptor value |
|
91 * @return Error code |
|
92 */ |
|
93 IMPORT_C const TDesC& GetDesValue() const; |
|
94 |
|
95 /** |
|
96 * Sets the value of property. Value must match to datatype. |
|
97 * |
|
98 * @since S60 V3.2 |
|
99 * @param aValue new descriptor |
|
100 * @return Error code |
|
101 */ |
|
102 IMPORT_C TInt SetValue( const TDesC& aValue ); |
|
103 |
|
104 |
|
105 /** |
|
106 * Compares data of this property to another. |
|
107 * |
|
108 * @since S60 V3.2 |
|
109 * @param aProperty property to be compared |
|
110 * @return ETrue if properties have same data |
|
111 */ |
|
112 IMPORT_C TBool CCenRepDatabaseProperty::operator==( |
|
113 const CCenRepDatabaseProperty& aProperty ) const; |
|
114 |
|
115 private: |
|
116 |
|
117 /** |
|
118 * C++ default constructor. |
|
119 */ |
|
120 CCenRepDatabaseProperty(); |
|
121 |
|
122 /** |
|
123 * By default Symbian 2nd phase constructor is private. |
|
124 */ |
|
125 void ConstructL(); |
|
126 |
|
127 private: // data |
|
128 |
|
129 /** |
|
130 * Descriptor of property value |
|
131 * Own. |
|
132 */ |
|
133 RBuf iPropertyValue; |
|
134 |
|
135 /** |
|
136 * Name of property |
|
137 */ |
|
138 TUint32 iPropertyName; |
|
139 |
|
140 |
|
141 private: // For testing |
|
142 #ifdef TEST_EUNIT |
|
143 friend class UT_CCenRepDatabaseProperty; |
|
144 #endif |
|
145 |
|
146 }; |
|
147 |
|
148 typedef RPointerArray<CCenRepDatabaseProperty> RIpAppPropArray; |
|
149 typedef RArray<TUint32> RKeyArray; |
|
150 |
|
151 const TInt KCenRepMaxDesLength = 512; |
|
152 |
|
153 |
|
154 #endif // C_CENREPDATABASEPROPERTY_H |