|
1 /* |
|
2 * Copyright (c) 2007 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: Decleares class which check user input. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IPSSETUIAPPROVER_H |
|
20 #define IPSSETUIAPPROVER_H |
|
21 |
|
22 |
|
23 #include "ipssetuinotes.h" |
|
24 |
|
25 class CIpsSetUi; |
|
26 class CIpsSetUiItem; |
|
27 |
|
28 /** |
|
29 * Class to verify that user input is valid |
|
30 * |
|
31 * @lib IpsSosSettings.lib |
|
32 * @since FS v1.0 |
|
33 */ |
|
34 class CIpsSetUiApprover : public CBase |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Destructor |
|
40 */ |
|
41 ~CIpsSetUiApprover(); |
|
42 |
|
43 /** |
|
44 * 2-phase contructor |
|
45 * |
|
46 * @return Approver object with client ownership. |
|
47 */ |
|
48 static CIpsSetUiApprover* NewL(); |
|
49 |
|
50 /** |
|
51 * 2-phase contructor |
|
52 * |
|
53 * @return Approver object with client ownership. |
|
54 */ |
|
55 static CIpsSetUiApprover* NewLC(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Evaluates new text. |
|
61 * |
|
62 * @param aBaseItem Item which stores the text. |
|
63 * @param aNewText New text. |
|
64 */ |
|
65 TIpsSetUiEventResult EvaluateText( |
|
66 const CIpsSetUiItem& aBaseItem, |
|
67 TDes& aNewText ); |
|
68 |
|
69 /** |
|
70 * Evaluates new value. |
|
71 * |
|
72 * @param aBaseItem Item which stores the value. |
|
73 * @param aNewValue New value. |
|
74 */ |
|
75 TIpsSetUiEventResult EvaluateValue( |
|
76 const CIpsSetUiItem& aBaseItem, |
|
77 TInt& aNewValue ); |
|
78 |
|
79 private: // Constructors |
|
80 |
|
81 /** |
|
82 * Constructor. |
|
83 */ |
|
84 CIpsSetUiApprover(); |
|
85 |
|
86 /** |
|
87 * 2nd phase of construction. |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 private: // New functions |
|
92 |
|
93 // COMMON ITEM VALIDATION |
|
94 |
|
95 /** |
|
96 * Validates the item. |
|
97 * |
|
98 * @param aBaseItem Item which stores the text or value. |
|
99 * @param aNewText New text. |
|
100 * @param aNewValue New value. |
|
101 */ |
|
102 TIpsSetUiNoteErrors ValidateType( |
|
103 const CIpsSetUiItem& aBaseItem, |
|
104 TDes& aNewText, |
|
105 TInt& aNewValue ); |
|
106 |
|
107 /** |
|
108 * Evaluates the item. |
|
109 * |
|
110 * @param aBaseItem Item which stores the text or value. |
|
111 * @param aNewText New text. |
|
112 * @param aNewValue New value. |
|
113 */ |
|
114 TIpsSetUiNoteErrors EvaluateSettingItems( |
|
115 const CIpsSetUiItem& aBaseItem, |
|
116 TDes& aNewText, |
|
117 TInt& aNewValue ); |
|
118 |
|
119 /** |
|
120 * Evaluates the item. |
|
121 * |
|
122 * @param aBaseItem Item which stores the text or value. |
|
123 * @param aNewText New text. |
|
124 * @param aNewValue New value. |
|
125 */ |
|
126 TIpsSetUiEventResult EvaluateItem( |
|
127 const CIpsSetUiItem& aBaseItem, |
|
128 TDes& aNewText, |
|
129 TInt& aNewValue ); |
|
130 |
|
131 /** |
|
132 * Checks if the item is filled. |
|
133 * |
|
134 * @param aBaseItem Item which stores the value or text. |
|
135 * @param aLength Length of the item. |
|
136 */ |
|
137 TBool IsItemFilled( |
|
138 const CIpsSetUiItem& aBaseItem, |
|
139 const TInt aLength ); |
|
140 |
|
141 /** |
|
142 * Validate the text is valid. |
|
143 * |
|
144 * @param aBaseItem Item which stores the value or text. |
|
145 * @param aNewText User input text. |
|
146 */ |
|
147 TIpsSetUiNoteErrors ValidateText( |
|
148 const CIpsSetUiItem& aBaseItem, |
|
149 const TDesC& aNewText ); |
|
150 |
|
151 /** |
|
152 * Validates the value is correct. |
|
153 * |
|
154 * @param aBaseItem Item which stores the value or text. |
|
155 * @param aNewValue User input value. |
|
156 */ |
|
157 TIpsSetUiNoteErrors ValidateValue( |
|
158 const CIpsSetUiItem& aBaseItem, |
|
159 TInt& aNewValue ); |
|
160 |
|
161 /** |
|
162 * Validates new radiobutton value. |
|
163 * |
|
164 * @param aNewValue New checked button. |
|
165 */ |
|
166 TIpsSetUiNoteErrors ValidateRadioButtons( |
|
167 const TInt& aNewValue ); |
|
168 |
|
169 // SPESIFIC ITEM VALIDATION |
|
170 |
|
171 /** |
|
172 * |
|
173 * @param aBaseItem Item which stores the value or text. |
|
174 */ |
|
175 TIpsSetUiNoteErrors EvaluateServerAddress( |
|
176 const CIpsSetUiItem& aBaseItem, |
|
177 const TDesC& aNewText ); |
|
178 |
|
179 /** |
|
180 * |
|
181 * @param aBaseItem Item which stores the value or text. |
|
182 */ |
|
183 TIpsSetUiNoteErrors EvaluateEmailAddress( |
|
184 const CIpsSetUiItem& aBaseItem, |
|
185 const TDesC& aNewText ); |
|
186 |
|
187 private: // Data |
|
188 |
|
189 /** |
|
190 * Class to handle notes in UI |
|
191 * Owned. |
|
192 */ |
|
193 CIpsSetUiNotes* iNoteUi; |
|
194 }; |
|
195 |
|
196 #endif // IPSSETUIAPPROVER_H |
|
197 |
|
198 // End of File |