|
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: Definition of the class MESMRFieldEvent |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MESMRFIELDEVENT_H |
|
19 #define MESMRFIELDEVENT_H |
|
20 |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 class MESMRFieldEventNotifier; |
|
25 class CESMRField; |
|
26 |
|
27 /** |
|
28 * Interface for field events |
|
29 * |
|
30 * @lib esmrfieldbuildercommon.lib |
|
31 */ |
|
32 class MESMRFieldEvent |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** Event types */ |
|
38 enum TEventType |
|
39 { |
|
40 /** |
|
41 * Triggers command from field. |
|
42 * @param Command value. TInt. |
|
43 */ |
|
44 EESMRFieldCommandEvent = 0, |
|
45 /** |
|
46 * Notifies that field value has changed |
|
47 * @param Field that has changed. TESMREntryFieldId as TInt. |
|
48 * @param New field value. MESMRFieldEventValue*. |
|
49 */ |
|
50 EESMRFieldChangeEvent |
|
51 }; |
|
52 |
|
53 |
|
54 /** |
|
55 * Gets the event type. |
|
56 * |
|
57 * @return Event type from TEventType enumeration. |
|
58 */ |
|
59 virtual TEventType Type() const = 0; |
|
60 |
|
61 /** |
|
62 * Gets the event source. |
|
63 * |
|
64 * @return pointer to the sender or NULL. |
|
65 */ |
|
66 virtual MESMRFieldEventNotifier* Source() const = 0; |
|
67 |
|
68 /** |
|
69 * Gets the event parameter count. |
|
70 * |
|
71 * @return the parameter count. |
|
72 */ |
|
73 virtual TInt ParamCount() const = 0; |
|
74 |
|
75 /** |
|
76 * Gets the event parameter. |
|
77 * |
|
78 * @param aIndex parameter index. |
|
79 * @return the parameter. |
|
80 */ |
|
81 virtual TAny* Param( TInt aIndex ) const = 0; |
|
82 |
|
83 /** |
|
84 * Destructor. |
|
85 */ |
|
86 virtual ~MESMRFieldEvent() {} |
|
87 }; |
|
88 |
|
89 /** |
|
90 * Generic field event value interface. |
|
91 * |
|
92 * @lib esmrfieldbuildercommon.lib |
|
93 */ |
|
94 class MESMRFieldEventValue |
|
95 { |
|
96 |
|
97 public: |
|
98 |
|
99 /** |
|
100 * Value type definition. |
|
101 */ |
|
102 enum TValueType |
|
103 { |
|
104 /** |
|
105 * TInt |
|
106 */ |
|
107 EESMRInteger = 0, |
|
108 /** |
|
109 * TDesC16*. Not owned. |
|
110 */ |
|
111 EESMRStringRef, |
|
112 /** |
|
113 * TDesC16*. Owned. |
|
114 */ |
|
115 EESMRString, |
|
116 /** |
|
117 * TDesC8*. Not owned. |
|
118 */ |
|
119 EESMRString8Ref, |
|
120 /** |
|
121 * TDesC8*. Owned. |
|
122 */ |
|
123 EESMRString8, |
|
124 /** |
|
125 * CESMRField*. Not owned. |
|
126 */ |
|
127 EESMRFieldRef, |
|
128 /** |
|
129 * MESMRFieldEventValue*. Owned. |
|
130 */ |
|
131 EESMRFieldEventValue, |
|
132 /** |
|
133 * CBase*. Not owned. |
|
134 */ |
|
135 EESMRCBaseRef, |
|
136 /** |
|
137 * CBase*. Owned. |
|
138 */ |
|
139 EESMRCBase, |
|
140 /** |
|
141 * TTime. |
|
142 */ |
|
143 EESMRTTime |
|
144 }; |
|
145 |
|
146 /** |
|
147 * Destructor. |
|
148 */ |
|
149 virtual ~MESMRFieldEventValue() {} |
|
150 |
|
151 /** |
|
152 * Gets the value type |
|
153 */ |
|
154 virtual TValueType Type() const = 0; |
|
155 |
|
156 /** |
|
157 * Gets the value. |
|
158 */ |
|
159 virtual TAny* Value() const = 0; |
|
160 |
|
161 /** |
|
162 * Gets the value as TInt. |
|
163 */ |
|
164 virtual TInt IntValue() const = 0; |
|
165 |
|
166 /** |
|
167 * Gets the value as TDesC16&. |
|
168 */ |
|
169 virtual const TDesC& StringValue() const = 0; |
|
170 |
|
171 /** |
|
172 * Gets the value as TDesC8&. |
|
173 */ |
|
174 virtual const TDesC8& String8Value() const = 0; |
|
175 |
|
176 /** |
|
177 * Gets the value as CESMRField&. |
|
178 */ |
|
179 virtual const CESMRField& FieldValue() const = 0; |
|
180 |
|
181 /** |
|
182 * Gets the value as CBase*. |
|
183 */ |
|
184 virtual const CBase* CBaseValue() const = 0; |
|
185 |
|
186 /** |
|
187 * Gets the value as TTime. |
|
188 */ |
|
189 virtual TTime TimeValue() const = 0; |
|
190 |
|
191 }; |
|
192 |
|
193 |
|
194 |
|
195 #endif // MESMRFIELDEVENT_H |