|
1 /* |
|
2 * Copyright (c) 2010 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 #ifndef ICPIXNPSEARCHER_H |
|
18 #define ICPIXNPSEARCHER_H |
|
19 |
|
20 #include "ICPixNPSearcherObserver.h" |
|
21 |
|
22 /** |
|
23 * An instance of CCPixSearcher is used to commit search operations to CSearchServer |
|
24 * Is bound to a specific database identified by baseAppType |
|
25 */ |
|
26 class MCPixNPSearcher |
|
27 { |
|
28 public: |
|
29 |
|
30 /** |
|
31 * SetObserver |
|
32 * Sets observer for this searcher |
|
33 * @param aObserver A observer of this CCPixSearcher instance. |
|
34 */ |
|
35 virtual void SetObserverL( NPObject* aObserver ) = 0; |
|
36 |
|
37 /** |
|
38 * SetAnalyzer |
|
39 * Sets analyzer for this searcher |
|
40 * @param aAnalyzer Special syntax defining the analyzer |
|
41 */ |
|
42 virtual void SetAnalyzerL( const TDesC& aAnalyzer ) = 0; |
|
43 |
|
44 /** |
|
45 * SearchL |
|
46 * Issues a search request. When request has been completed a callback to |
|
47 * MSearchObserver::HandleSearchResultL is issued. Leaves with KErrInUse, |
|
48 * if asynchronous request is already pending. |
|
49 * @param aSearchTerms Search terms. May include wild card character. |
|
50 * @param aDocumentField to search |
|
51 */ |
|
52 virtual void SearchL( const TDesC& aSearchTerms, const TDesC& aDocumentField = KNullDesC ) = 0; |
|
53 |
|
54 /** |
|
55 * GetDocumentL |
|
56 * Iterates throught the search result's document list (hits), that is stored in the |
|
57 * server side. The accessed list is ranked and the best matching document is heading |
|
58 * the result lest. First call of this method, return best matching, then second best |
|
59 * matching and so forth until all documents have been found. Method returns NULL, |
|
60 * when no more documents can be found. |
|
61 * |
|
62 * Leaves with KErrInUse, if asynchronous request is pending and |
|
63 * KErrNotReady, if no database has been succefullly opened. |
|
64 */ |
|
65 virtual void GetDocumentL(TInt aIndex) = 0; |
|
66 |
|
67 /** |
|
68 * Cancels any outstanding operation. |
|
69 */ |
|
70 virtual void Cancel() = 0; |
|
71 |
|
72 /** |
|
73 * Checks whether an outstanding request is still pending |
|
74 */ |
|
75 virtual TBool IsActive() = 0; |
|
76 |
|
77 }; |
|
78 |
|
79 #endif /*ICPIXNPSEARCHER_*/ |