1 /* |
|
2 * Copyright (c) 2009 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MDEPROPERTYDEF_H__ |
|
20 #define __MDEPROPERTYDEF_H__ |
|
21 |
|
22 #include <mdccommon.h> |
|
23 |
|
24 // Forward declaration |
|
25 class CMdCSerializationBuffer; |
|
26 class CMdEObjectDef; |
|
27 class CMdENamespaceDef; |
|
28 class TMdCPropertyDef; |
|
29 |
|
30 /** |
|
31 * Class for property definitions. |
|
32 */ |
|
33 NONSHARABLE_CLASS(CMdEPropertyDef) : public CBase |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Returns the name of the item. |
|
38 * |
|
39 * @return name |
|
40 */ |
|
41 IMPORT_C const TDesC& Name() const; |
|
42 |
|
43 /** |
|
44 * Returns the type of the property. |
|
45 * |
|
46 * @return property type |
|
47 */ |
|
48 IMPORT_C TPropertyType PropertyType() const; |
|
49 |
|
50 /** |
|
51 * Returns whether the property is read only. |
|
52 * |
|
53 * @return <code>ETrue</code>, if the property is read only; |
|
54 * <code>EFalse</code>, otherwise |
|
55 */ |
|
56 IMPORT_C TBool ReadOnly() const; |
|
57 |
|
58 /** |
|
59 * Returns whether the property is mandatory. |
|
60 * |
|
61 * @return <code>ETrue</code>, if the property is mandatory; |
|
62 * <code>EFalse</code>, otherwise |
|
63 */ |
|
64 IMPORT_C TBool Mandatory() const; |
|
65 |
|
66 /** |
|
67 * Compare this property definition with other property definition. |
|
68 * |
|
69 * @param aPropertyDef other property definition |
|
70 * |
|
71 * @return 0 if properties are same, 1 or more if this is greater than other |
|
72 * and -1 or less if this is less than other. |
|
73 */ |
|
74 IMPORT_C TInt Compare(const CMdEPropertyDef& aPropertyDef) const; |
|
75 |
|
76 |
|
77 IMPORT_C CMdEObjectDef& ObjectDef() const; |
|
78 |
|
79 IMPORT_C TInt32 MinInt32ValueL() const; |
|
80 |
|
81 IMPORT_C TInt32 MaxInt32ValueL() const; |
|
82 |
|
83 IMPORT_C TUint32 MinUint32ValueL() const; |
|
84 |
|
85 IMPORT_C TUint32 MaxUint32ValueL() const; |
|
86 |
|
87 IMPORT_C TInt64 MinInt64ValueL() const; |
|
88 |
|
89 IMPORT_C TInt64 MaxInt64ValueL() const; |
|
90 |
|
91 IMPORT_C TReal MinRealValueL() const; |
|
92 |
|
93 IMPORT_C TReal MaxRealValueL() const; |
|
94 |
|
95 IMPORT_C TTime MinTimeValueL() const; |
|
96 |
|
97 IMPORT_C TTime MaxTimeValueL() const; |
|
98 |
|
99 IMPORT_C TInt MinTextLengthL() const; |
|
100 |
|
101 IMPORT_C TInt MaxTextLengthL() const; |
|
102 |
|
103 IMPORT_C CMdENamespaceDef& NamespaceDef() const; |
|
104 |
|
105 public: |
|
106 static CMdEPropertyDef* NewL(const TMdCPropertyDef& aPropertyDef, CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef); |
|
107 |
|
108 static CMdEPropertyDef* NewLC(const TMdCPropertyDef& aPropertyDef, CMdCSerializationBuffer& aSchemaBuffer, CMdEObjectDef& aObjectDef); |
|
109 |
|
110 void SerializeL(CMdCSerializationBuffer& aBuffer) const; |
|
111 |
|
112 /** |
|
113 * Destructor. |
|
114 */ |
|
115 virtual ~CMdEPropertyDef(); |
|
116 |
|
117 TDefId Id() const; |
|
118 void SetId(TDefId aId); |
|
119 |
|
120 TDefId ObjectDefId() const; |
|
121 |
|
122 private: |
|
123 CMdEPropertyDef(const TMdCPropertyDef& aPropertyDef, CMdEObjectDef& aObjectDef); |
|
124 |
|
125 void ConstructL(CMdCSerializationBuffer& aSchemaBuffer ); |
|
126 |
|
127 private: |
|
128 |
|
129 const TMdCPropertyDef& iPropertyDef; |
|
130 CMdEObjectDef& iObjectDef; |
|
131 |
|
132 TPtrC16 iName; |
|
133 }; |
|
134 |
|
135 #endif // __MDEPROPERTYDEF_H__ |
|