|
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: MNcdProtocolElementEntity declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NCDPROTOCOLELEMENTQUERYELEMENT_H |
|
20 #define NCDPROTOCOLELEMENTQUERYELEMENT_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "ncdqueryitem.h" |
|
25 //#include "ncdprotocoltypes.h" |
|
26 |
|
27 class MNcdConfigurationProtocolQueryOption; |
|
28 class MNcdConfigurationProtocolDetail; |
|
29 class CNcdString; |
|
30 |
|
31 |
|
32 class MNcdConfigurationProtocolQueryElement |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Type of the query element. |
|
38 */ |
|
39 enum TNcdProtocolQueryElementType |
|
40 { |
|
41 EUnknown, |
|
42 EFreeText, |
|
43 ESingleSelect, |
|
44 EMultiSelect, |
|
45 EGpsLocation, |
|
46 EConfiguration, |
|
47 EFile, |
|
48 ENumeric, |
|
49 ESms, |
|
50 EPurchaseHistory |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~MNcdConfigurationProtocolQueryElement() {} |
|
57 |
|
58 /** |
|
59 * Returns the ID of this query element. |
|
60 * @return Id |
|
61 */ |
|
62 virtual const TDesC& Id() const = 0; |
|
63 |
|
64 /** |
|
65 * Returns the semantics of this query element. |
|
66 * |
|
67 * @return Semantics enumeration value. |
|
68 */ |
|
69 virtual MNcdQueryItem::TSemantics Semantics() const = 0; |
|
70 |
|
71 /** |
|
72 * If true then the client must show this query to the end-user. |
|
73 * |
|
74 * @return True or false. |
|
75 */ |
|
76 virtual TNcdProtocolQueryElementType Type() const = 0; |
|
77 |
|
78 /** |
|
79 * If true, this query element can be ignored. |
|
80 * |
|
81 * @return True or false. |
|
82 */ |
|
83 virtual TBool Optional() const = 0; |
|
84 |
|
85 /** |
|
86 * Labels are used to identify the |
|
87 * what the query item is e.g. "username" or "credit card owner". |
|
88 * Typically displayed next to the actual item. |
|
89 * |
|
90 * @return The label. |
|
91 */ |
|
92 virtual const CNcdString& Label() const = 0; |
|
93 |
|
94 /** |
|
95 * Returns query element message. A message related to the element, |
|
96 * can be e.g. optionally displayed in a question dialog body close to |
|
97 * the query item. |
|
98 * |
|
99 * @return The message. |
|
100 */ |
|
101 virtual const CNcdString& Message() const = 0; |
|
102 |
|
103 /** |
|
104 * Returns query element description. Description is intented for |
|
105 * context-sensitive help. |
|
106 * |
|
107 * @return The description. |
|
108 */ |
|
109 virtual const CNcdString& Description() const = 0; |
|
110 |
|
111 /** |
|
112 * Returns option count for this query element. |
|
113 * |
|
114 * @return Number of options. |
|
115 */ |
|
116 virtual TInt OptionCount() const = 0; |
|
117 |
|
118 /** |
|
119 * Returns option by index. |
|
120 * |
|
121 * @param aIndex Index of the option. Leaves if index is out of bounds. |
|
122 * @return Option. |
|
123 * @see OptionCount() |
|
124 */ |
|
125 virtual const MNcdConfigurationProtocolQueryOption& Option( TInt aIndex ) const = 0; |
|
126 |
|
127 /** |
|
128 * Returns custom details object. |
|
129 * Ownership is NOT transferred. |
|
130 * @return Pointer or NULL if not found. |
|
131 */ |
|
132 virtual const MNcdConfigurationProtocolDetail* Detail() const = 0; |
|
133 |
|
134 }; |
|
135 |
|
136 |
|
137 #endif // NCDPROTOCOLELEMENTQUERYELEMENT_H |