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