|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCD_QUERY_ITEM_H |
|
20 #define M_NCD_QUERY_ITEM_H |
|
21 |
|
22 #include <e32cmn.h> |
|
23 |
|
24 #include "catalogsbase.h" |
|
25 #include "ncdinterfaceids.h" |
|
26 |
|
27 /** |
|
28 * Describes a query item. |
|
29 * |
|
30 * A common interface for all query items. A query item defines |
|
31 * one element of a whole query e.g. credit card number in a purchase |
|
32 * information query. |
|
33 * |
|
34 * All query items that are not optional must be answered/filled before |
|
35 * completing a query. |
|
36 * |
|
37 * @see MNcdQuery |
|
38 */ |
|
39 class MNcdQueryItem : public virtual MCatalogsBase |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Unique identifier for the interface, required for all MCatalogsBase interfaces. |
|
45 * |
|
46 * |
|
47 */ |
|
48 enum { KInterfaceUid = ENcdQueryItemUid }; |
|
49 |
|
50 /** |
|
51 * Query item semantics |
|
52 */ |
|
53 enum TSemantics |
|
54 { |
|
55 /** No specific semantics specified */ |
|
56 ESemanticsNone, |
|
57 |
|
58 /** Unknown/unsupported semantics specified */ |
|
59 ESemanticsUnknown, |
|
60 |
|
61 /** MSISDN (phone number) */ |
|
62 ESemanticsMsisdn, |
|
63 |
|
64 /** Email address */ |
|
65 ESemanticsEmailAddress, |
|
66 |
|
67 /** Credit card number */ |
|
68 ESemanticsCreditCardNumber, |
|
69 |
|
70 /** Credit card expiration year */ |
|
71 ESemanticsCreditCardExpirationYear, |
|
72 |
|
73 /** Credit card expiration month */ |
|
74 ESemanticsCreditCardExpirationMonth, |
|
75 |
|
76 /** Credit card owner */ |
|
77 ESemanticsCreditCardOwner, |
|
78 |
|
79 /** Credit card verification code */ |
|
80 ESemanticsCreditCardVerificationCode, |
|
81 |
|
82 /** Credit card type */ |
|
83 ESemanticsCreditCardType, |
|
84 |
|
85 /** Street address */ |
|
86 ESemanticsAddressStreet, |
|
87 |
|
88 /** ZIP code */ |
|
89 ESemanticsAddressZipCode, |
|
90 |
|
91 /** City */ |
|
92 ESemanticsAddressCity, |
|
93 |
|
94 /** Country */ |
|
95 ESemanticsAddressCountry, |
|
96 |
|
97 /** User name */ |
|
98 ESemanticsUserName, |
|
99 |
|
100 /** Password */ |
|
101 ESemanticsPassword, |
|
102 |
|
103 /** PIN code */ |
|
104 ESemanticsPinCode, |
|
105 |
|
106 /** IMEI */ |
|
107 ESemanticsImei |
|
108 }; |
|
109 |
|
110 /** |
|
111 * Type of the query. |
|
112 * |
|
113 * |
|
114 * @return Interface id of the operation. |
|
115 */ |
|
116 virtual TNcdInterfaceId Type() const = 0; |
|
117 |
|
118 /** |
|
119 * Semantics of the query item. |
|
120 * |
|
121 * This can be used to act differently for semantically |
|
122 * different query items that have the same basic type |
|
123 * (as indicated by Type()). |
|
124 * |
|
125 * |
|
126 * @return Semantics for the item. |
|
127 */ |
|
128 virtual TSemantics Semantics() const = 0; |
|
129 |
|
130 /** |
|
131 * Getter for query item label. Labels are used to identify the |
|
132 * what the query item is e.g. "username" or "credit card owner". |
|
133 * Typically displayed next to the actual item. |
|
134 * |
|
135 * |
|
136 * @return Label text. KNullDesC() if no label available. |
|
137 */ |
|
138 virtual const TDesC& Label() const = 0; |
|
139 |
|
140 /** |
|
141 * Getter for query item message. Optionally displayed in a question |
|
142 * dialog body close to the query item. Can offer information/advice on what |
|
143 * the user should input e.g. "Please enter the cardholder's name". |
|
144 * |
|
145 * |
|
146 * @return Message text. KNullDesC() if no message available. |
|
147 */ |
|
148 virtual const TDesC& Message() const = 0; |
|
149 |
|
150 /** |
|
151 * Getter for query item description. Additional longer description text |
|
152 * about the query element, intended for context help |
|
153 * |
|
154 * |
|
155 * @return Message text. KNullDesC() if no description available. |
|
156 */ |
|
157 virtual const TDesC& Description() const = 0; |
|
158 |
|
159 /** |
|
160 * Checks whether this query item is optional i.e. does not need |
|
161 * to be answered/filled before the query is accepted. |
|
162 * |
|
163 * @return ETrue if the item is optional, EFalse if it is mandatory. |
|
164 */ |
|
165 virtual TBool IsOptional() const = 0; |
|
166 |
|
167 protected: |
|
168 |
|
169 /** |
|
170 * Destructor. |
|
171 * |
|
172 * @see MCatalogsBase::~MCatalogsBase |
|
173 */ |
|
174 virtual ~MNcdQueryItem() {} |
|
175 |
|
176 }; |
|
177 |
|
178 #endif // M_NCD_QUERY_ITEM_H |