equal
deleted
inserted
replaced
176 { |
176 { |
177 return (iSearchQuery.Count()); |
177 return (iSearchQuery.Count()); |
178 } |
178 } |
179 |
179 |
180 // ---------------------------------------------------------------------------- |
180 // ---------------------------------------------------------------------------- |
181 // Deprecated: Use CPcsDebug::PrintQuery |
181 // Deprecated: Use CPcsDebug::PrintQuery |
182 // CPsQuery::PrintQuery |
182 // CPsQuery::PrintQuery |
183 // Prints the query as array of query items (query items cannot be spaces) |
183 // Prints the query as array of query items (query items cannot be spaces) |
184 // Used only for debugging |
184 // Used only for debugging |
185 // ---------------------------------------------------------------------------- |
185 // ---------------------------------------------------------------------------- |
186 EXPORT_C void CPsQuery:: PrintQuery() |
186 EXPORT_C void CPsQuery:: PrintQuery() |
191 TUint inputKey = iSearchQuery[i]->Character().GetUpperCase(); |
191 TUint inputKey = iSearchQuery[i]->Character().GetUpperCase(); |
192 TBuf<2> buffer; |
192 TBuf<2> buffer; |
193 buffer.Format(_L("%c"), inputKey); |
193 buffer.Format(_L("%c"), inputKey); |
194 switch(iSearchQuery[i]->Mode()) |
194 switch(iSearchQuery[i]->Mode()) |
195 { |
195 { |
196 case EItut: |
196 case EPredictiveDefaultKeyboard: |
197 PRINT2 ( _L("Character at index %d: '%S' (ITU-T)"), i, &buffer); |
197 PRINT2 ( _L("Character at index %d: '%S' (EPredictiveDefaultKeyboard)"), |
198 break; |
198 i, &buffer); |
199 case EQwerty: |
199 break; |
200 PRINT2 ( _L("Character at index %d: '%S' (QWERTY)"), i, &buffer); |
200 case ENonPredictive: |
201 break; |
201 PRINT2 ( _L("Character at index %d: '%S' (ENonPredictive)"), |
|
202 i, &buffer); |
|
203 break; |
|
204 case EPredictiveItuT: |
|
205 PRINT2 ( _L("Character at index %d: '%S' (EPredictiveItuT)"), |
|
206 i, &buffer); |
|
207 break; |
|
208 case EPredictiveQwerty: |
|
209 PRINT2 ( _L("Character at index %d: '%S' (EPredictiveQwerty)"), |
|
210 i, &buffer); |
|
211 break; |
202 default: |
212 default: |
203 PRINT2 ( _L("Character at index %d: '%S' (mode=?)"), i, &buffer); |
213 PRINT3 ( _L("Character at index %d: '%S' (mode=%d)"), |
|
214 i, &buffer, iSearchQuery[i]->Mode()); |
204 break; |
215 break; |
205 } |
216 } |
206 } |
217 } |
207 } |
218 } |
208 |
219 |
211 // Writes 'this' to aStream |
222 // Writes 'this' to aStream |
212 // ---------------------------------------------------------------------------- |
223 // ---------------------------------------------------------------------------- |
213 EXPORT_C void CPsQuery::ExternalizeL(RWriteStream& aStream) const |
224 EXPORT_C void CPsQuery::ExternalizeL(RWriteStream& aStream) const |
214 { |
225 { |
215 aStream.WriteUint8L(iSearchQuery.Count()); // Number of query items |
226 aStream.WriteUint8L(iSearchQuery.Count()); // Number of query items |
216 for ( int index = 0; index < iSearchQuery.Count(); index++ ) |
227 for ( TInt index = 0; index < iSearchQuery.Count(); index++ ) |
217 { |
228 { |
218 (iSearchQuery[index])->ExternalizeL(aStream); |
229 (iSearchQuery[index])->ExternalizeL(aStream); |
219 } |
230 } |
220 } |
231 } |
221 |
232 |
227 { |
238 { |
228 // Read number of query items |
239 // Read number of query items |
229 TInt numQueryItems = aStream.ReadUint8L(); |
240 TInt numQueryItems = aStream.ReadUint8L(); |
230 |
241 |
231 // Internalize each item |
242 // Internalize each item |
232 for ( int index = 0; index < numQueryItems; index++ ) |
243 for ( TInt index = 0; index < numQueryItems; index++ ) |
233 { |
244 { |
234 CPsQueryItem *item = CPsQueryItem::NewL(); |
245 CPsQueryItem *item = CPsQueryItem::NewL(); |
235 item->InternalizeL(aStream); |
246 item->InternalizeL(aStream); |
236 this->AppendL(*item); |
247 this->AppendL(*item); |
237 } |
248 } |