|
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 CPIXNPSEARCHER_H_ |
|
18 #define CPIXNPSEARCHER_H_ |
|
19 |
|
20 // INCLUDES |
|
21 #include "CCPixNPSearcherInterface.h" |
|
22 #include "CCPixNPSearcherObserver.h" |
|
23 #include "MCPixSearcherObserver.h" |
|
24 #include <RSearchServerSession.h> |
|
25 |
|
26 |
|
27 // Forward declarations |
|
28 |
|
29 // CLASS DECLARATION |
|
30 class CCPixSearcher; |
|
31 |
|
32 /** |
|
33 * CCPixNPSearcher |
|
34 * Implements services described in MCPixNPSearcher. Provides |
|
35 * the functionality for committing searches into database associated |
|
36 * with its base application class. |
|
37 */ |
|
38 class CCPixNPSearcher : public CCPixNPSearcherInterface, MCPixSearchRequestObserver, MCPixNextDocumentRequestObserver |
|
39 { |
|
40 public: |
|
41 static CCPixNPSearcher* NewL( const TDesC& aBaseAppClass, const TDesC& aDefaultSearchField ); |
|
42 static CCPixNPSearcher* NewL( const TDesC& aBaseAppClass ); |
|
43 virtual ~CCPixNPSearcher(); |
|
44 |
|
45 private: |
|
46 CCPixNPSearcher(); |
|
47 |
|
48 void ConstructL( const TDesC& aBaseAppClass, const TDesC& aDefaultSearchField ); |
|
49 |
|
50 void ConstructL( const TDesC& aBaseAppClass ); |
|
51 |
|
52 virtual void Invalidate(); |
|
53 |
|
54 public: // From MCPixNPSearcher |
|
55 |
|
56 virtual void SetObserverL( NPObject* aObserver ); |
|
57 |
|
58 virtual void SetAnalyzerL( const TDesC& aAnalyzer ); |
|
59 |
|
60 virtual void SearchL( const TDesC& aSearchTerms, const TDesC& aDocumentField = KNullDesC); |
|
61 |
|
62 virtual void GetDocumentL(TInt aIndex); |
|
63 |
|
64 virtual void Cancel(); |
|
65 |
|
66 virtual TBool IsActive(); |
|
67 |
|
68 public: // From MCPixSearcherObserver |
|
69 |
|
70 virtual void HandleSearchResultsL(TInt aError, TInt aEstimatedResultCount); |
|
71 |
|
72 virtual void HandleDocumentL(TInt aError, CSearchDocument* aDocument); |
|
73 |
|
74 private: |
|
75 RSearchServerSession iSearchSession; |
|
76 CCPixSearcher* iSearcher; |
|
77 |
|
78 CCPixNPSearcherObserver* iObserver; |
|
79 |
|
80 }; |
|
81 |
|
82 #endif /*CPIXNPSEARCHER_H_*/ |