|
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 CCPIXNPSEARCHEROBSERVER_H_ |
|
18 #define CCPIXNPSEARCHEROBSERVER_H_ |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32base.h> |
|
22 |
|
23 #ifdef __S60_50__ |
|
24 #include <npscript.h> |
|
25 #else |
|
26 #include <stdint.h> |
|
27 #include <JavaScriptCore/npruntime.h> |
|
28 #endif |
|
29 |
|
30 #include "ICPixNPSearcherObserver.h" |
|
31 |
|
32 /** |
|
33 * CCPixNPSearcherObserver |
|
34 * Implements the functionality described in the MCPixNPSearcherObserver. |
|
35 * This class represents and wraps a JavaScript object observing plugin's |
|
36 * searcher object. This class is used to invoke the observer methods of |
|
37 * the associated JavaScript object. |
|
38 */ |
|
39 class CCPixNPSearcherObserver : public CBase, public MCPixNPSearcherObserver |
|
40 { |
|
41 public: |
|
42 CCPixNPSearcherObserver( NPP& aNpp, NPObject* aSelf ); |
|
43 virtual ~CCPixNPSearcherObserver(); |
|
44 |
|
45 public: // From MCPixNPSearcherObserver |
|
46 |
|
47 virtual void HandleSearchResultsL(const TDesC8* aError, TInt aEstimatedResultCount); |
|
48 virtual void HandleDocumentL(const TDesC8* aError, NPSearchDocumentObject* aDocument); |
|
49 |
|
50 private: // Utility |
|
51 |
|
52 /** |
|
53 * FIXME: This method is copied from CObjectInterface and is harmful redundancy |
|
54 */ |
|
55 void DescriptorToVariant(const TDesC8& aString, NPVariant& aVariant); |
|
56 |
|
57 private: |
|
58 |
|
59 NPP &iNpp; |
|
60 NPObject *iSelf; |
|
61 |
|
62 }; |
|
63 |
|
64 |
|
65 #endif // CCPIXNPSEARCHEROBSERVER_H_ |