|
1 /* |
|
2 * Copyright (c) 2006 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: Contains MNcdNode interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCD_SERVER_REPORT_MANAGER_H |
|
20 #define M_NCD_SERVER_REPORT_MANAGER_H |
|
21 |
|
22 |
|
23 #include "catalogsbase.h" |
|
24 #include "ncdinterfaceids.h" |
|
25 |
|
26 class MNcdServerReportOperation; |
|
27 class MNcdServerReportOperationObserver; |
|
28 |
|
29 |
|
30 /** |
|
31 * MNcdServerReportManager interface provides functions |
|
32 * that can be used to manage server report sending to the server. |
|
33 * As a default, report sending is handled automatically in the background. |
|
34 * But, manager can be used if reports should be collected and sent in certain |
|
35 * moments. This interface can be gotten from the MNcdProvider by using the |
|
36 * QueryInterfaceL function. |
|
37 * |
|
38 * @note Capabilities define what kind of reports are supported by the |
|
39 * application. So, if reports should or should not be sent, then define |
|
40 * this by setting correct capabilities. |
|
41 * |
|
42 * @see MNcdServerReportOperation |
|
43 * @see MNcdServerReportOperationObserver |
|
44 * @see MNcdProvider |
|
45 * @see NcdCapabilities |
|
46 * |
|
47 * |
|
48 */ |
|
49 class MNcdServerReportManager : public virtual MCatalogsBase |
|
50 { |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Unique identifier for the interface, required for all MCatalogsBase interfaces. |
|
56 * |
|
57 * |
|
58 */ |
|
59 enum { KInterfaceUid = ENcdServerReportManagerUid }; |
|
60 |
|
61 |
|
62 /** |
|
63 * Reporting method describes how the reporting is done. |
|
64 */ |
|
65 enum TReportingMethod |
|
66 { |
|
67 |
|
68 /** |
|
69 * Reporting is done in the background |
|
70 * This is a default method. |
|
71 */ |
|
72 EReportingBackground, |
|
73 |
|
74 /** |
|
75 * Reporting is managed through this API Interface. |
|
76 * The API user decides when to send reports instead of allowing |
|
77 * reports to be sent in the background when process time allows. |
|
78 */ |
|
79 EReportingManaged |
|
80 |
|
81 }; |
|
82 |
|
83 |
|
84 enum TReportingStyle |
|
85 { |
|
86 |
|
87 /** |
|
88 * Reporting information is sent in the general format not in some platform |
|
89 * specific format. This is a default value. |
|
90 */ |
|
91 EReportingStyleGeneral, |
|
92 |
|
93 /** |
|
94 * Reports will contain S60 specific information. |
|
95 */ |
|
96 EReportingStyleS60 |
|
97 |
|
98 }; |
|
99 |
|
100 |
|
101 /** |
|
102 * Setter for the reporting method. |
|
103 * |
|
104 * @param aMethod The reporting method that is used when reports are |
|
105 * managed. |
|
106 * |
|
107 * @exception Leave System wide error code |
|
108 * |
|
109 * |
|
110 */ |
|
111 virtual void SetReportingMethodL( const TReportingMethod& aMethod ) = 0; |
|
112 |
|
113 |
|
114 /** |
|
115 * Getter for the reporting method. |
|
116 * |
|
117 * @param TReportingMethod The reporting method that is used |
|
118 * when reports are managed. |
|
119 * |
|
120 * |
|
121 */ |
|
122 virtual TReportingMethod ReportingMethodL() const = 0; |
|
123 |
|
124 |
|
125 /** |
|
126 * Setter for the reporting style. |
|
127 * |
|
128 * @param aStyle The style that is used for reports. |
|
129 * |
|
130 * @exception Leave System wide error code |
|
131 * |
|
132 * |
|
133 */ |
|
134 virtual void SetReportingStyleL( const TReportingStyle& aStyle ) = 0; |
|
135 |
|
136 |
|
137 /** |
|
138 * Getter for the reporting style. |
|
139 * |
|
140 * @param TReportingMethod The style that is used for reports. |
|
141 * |
|
142 * |
|
143 */ |
|
144 virtual TReportingStyle ReportingStyleL() const = 0; |
|
145 |
|
146 |
|
147 /** |
|
148 * Starts the server report sending operation. |
|
149 * |
|
150 * @note The reference count of the operation object is increased by one. So, Release() |
|
151 * function of the operation should be called when operation is not needed anymore. |
|
152 * |
|
153 * @note The sending process is asynchronous. When sending has completed, |
|
154 * the observer callback functions are called. |
|
155 * |
|
156 * @note After sending is finished the collected reports will be automatically |
|
157 * removed. |
|
158 * |
|
159 * @note This function has an effect only if the reporting method is set to |
|
160 * EReportingManaged. If reporting is done in the background, then reports |
|
161 * are sent automatically, and NULL is returned for the operation. |
|
162 * |
|
163 * @param aObserver Operation observer. |
|
164 * @return MNcdServerReportOperation* Operation if one was created. If reporting is done |
|
165 * in the background, then NULL is returned. |
|
166 * @exception Leave System wide error code |
|
167 * |
|
168 * |
|
169 */ |
|
170 virtual MNcdServerReportOperation* SendL( MNcdServerReportOperationObserver& aObserver ) = 0; |
|
171 |
|
172 |
|
173 protected: |
|
174 |
|
175 /** |
|
176 * The destructor of an interface is set virtual to make sure that |
|
177 * the destructors of derived classes are called appropriately when the |
|
178 * object is destroyed. |
|
179 * |
|
180 * Destructor is defined as protected to prevent direct use of delete |
|
181 * on observer interface pointers. |
|
182 * |
|
183 * |
|
184 */ |
|
185 virtual ~MNcdServerReportManager() {} |
|
186 |
|
187 }; |
|
188 |
|
189 #endif // M_NCD_SERVER_REPORT_MANAGER_H |
|
190 |