|
1 /* |
|
2 * Copyright (c) 2007 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: Metadata Harvester server's client header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CMMDHCLIENT_H |
|
25 #define CMMDHCLIENT_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <e32base.h> |
|
29 #include "mdhclientsession.h" |
|
30 #include "mmdhclient.h" |
|
31 |
|
32 // FORWARD DECLARATION |
|
33 class RCmMdhSession; |
|
34 class MCmServiceObserver; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * Metadata Harvester client |
|
39 * |
|
40 * @lib cmmdhclient.lib |
|
41 * @since S60 3.1 |
|
42 */ |
|
43 class CCmMdhClient : public CActive, |
|
44 public MCmMdhClient |
|
45 { |
|
46 public: |
|
47 |
|
48 enum TCmMdhClientState |
|
49 { |
|
50 ECmMdhClientIdle = 0, |
|
51 ECmMdhClientSearching, |
|
52 ECmMdhClientHarvesting |
|
53 }; |
|
54 |
|
55 public: |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CCmMdhClient* NewL( MCmServiceObserver& aServer ); |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 */ |
|
65 static CCmMdhClient* NewLC( MCmServiceObserver& aServer ); |
|
66 |
|
67 /** |
|
68 * Destructor |
|
69 */ |
|
70 virtual ~CCmMdhClient(); |
|
71 |
|
72 public: |
|
73 |
|
74 /** |
|
75 * Starts harvesting |
|
76 * @since S60 3.1 |
|
77 * @return Error code |
|
78 */ |
|
79 TInt Harvest(); |
|
80 |
|
81 /** |
|
82 * Cancels request |
|
83 * @since S60 3.1 |
|
84 * @return Error code |
|
85 */ |
|
86 void Stop(); |
|
87 |
|
88 /** |
|
89 * Deletes the object |
|
90 * @since S60 3.1 |
|
91 */ |
|
92 void Close(); |
|
93 |
|
94 private: |
|
95 |
|
96 /** |
|
97 * From CActive |
|
98 * Callback function. |
|
99 * Invoked to handle responses from the server. |
|
100 */ |
|
101 void RunL(); |
|
102 |
|
103 /** |
|
104 * From CActive |
|
105 * Cancels any outstanding operation. |
|
106 */ |
|
107 void DoCancel(); |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 * Default constructor |
|
113 */ |
|
114 CCmMdhClient( MCmServiceObserver& aServer ); |
|
115 |
|
116 /** |
|
117 * ConstructL |
|
118 */ |
|
119 void ConstructL( ); |
|
120 |
|
121 private: |
|
122 |
|
123 /** Instance of mdh session */ |
|
124 RCmMdhSession iMdhSession; |
|
125 |
|
126 /** Observer */ |
|
127 MCmServiceObserver& iServer; |
|
128 |
|
129 /** State of the client */ |
|
130 TCmMdhClientState iState; |
|
131 }; |
|
132 |
|
133 #endif // CMMDHCLIENT_H |
|
134 |
|
135 // End of File |