1 /* |
|
2 * Copyright (c) 2008 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: Search implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CSEARCHREQUEST_H__ |
|
20 #define __CSEARCHREQUEST_H__ |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <ximpbase.h> |
|
26 |
|
27 #include <searchinfo.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MOSSProtocolConnectionManager; |
|
31 class MSearchElement; |
|
32 class MXIMPIdentity; |
|
33 |
|
34 /** |
|
35 * CSearchrequest |
|
36 * |
|
37 * Issue Search Request to Network Server |
|
38 * |
|
39 */ |
|
40 |
|
41 class CSearchrequest: public CActive |
|
42 |
|
43 |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 static CSearchrequest* NewLC( MOSSProtocolConnectionManager& aConnMan, |
|
49 TXIMPRequestId aRequestId ); |
|
50 |
|
51 virtual ~CSearchrequest(); |
|
52 |
|
53 private: |
|
54 |
|
55 CSearchrequest( MOSSProtocolConnectionManager& aConnMan, |
|
56 TXIMPRequestId aRequestId ); |
|
57 void ConstructL(); |
|
58 |
|
59 private: // from CActive |
|
60 |
|
61 void DoCancel(); |
|
62 void RunL(); |
|
63 TInt RunError( TInt aError ); |
|
64 |
|
65 private : |
|
66 /** |
|
67 * parse the data |
|
68 * @param aResponse: response contains searched data |
|
69 * @param alen: length |
|
70 * @param aSearchInfo: search info |
|
71 * @param aKeytype: search key type |
|
72 */ |
|
73 void ParseAndSetL(char* aResponse, TInt alen, MSearchInfo& aSearchInfo, TInfoType aKeytype); |
|
74 |
|
75 public: |
|
76 /** |
|
77 * Issue search request to network server |
|
78 * @param aSearchId: search id |
|
79 * @param aObjs: array of search elements |
|
80 * @param aSearchLimit: search limit |
|
81 */ |
|
82 void SearchL(const MXIMPIdentity& aSearchId,const RPointerArray< MSearchElement >& aObjs,TInt aSearchLimit); |
|
83 |
|
84 private: // data |
|
85 |
|
86 /** |
|
87 * Request Id |
|
88 */ |
|
89 TXIMPRequestId iRequestId; |
|
90 |
|
91 /** |
|
92 * Send data request to pure data handler generates the id |
|
93 */ |
|
94 TInt iSendId; |
|
95 /** |
|
96 * Search Id |
|
97 */ |
|
98 HBufC16* iSearchId; |
|
99 /** |
|
100 * Oss Protocol Plugin Connection Manager |
|
101 * Not own. *** Write "Not own" if some other class owns this object. |
|
102 */ |
|
103 MOSSProtocolConnectionManager& iConnMan; |
|
104 |
|
105 }; |
|
106 |
|
107 |
|
108 #endif // __CSEARCHREQUEST_H__ |
|
109 |
|