|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: Base class for client side request handling. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef REQUEST_HANDLER_H |
|
20 #define REQUEST_HANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32std.h> |
|
25 |
|
26 #include <ConnectionObserver.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 |
|
38 // CLASS DECLARATION |
|
39 class RFeedsInterface; |
|
40 class CRequestHandler; |
|
41 |
|
42 /** |
|
43 * The CRequestHandler observer interface. |
|
44 * |
|
45 * \b Library: FeedsEngine.lib |
|
46 * |
|
47 * @since 3.1 |
|
48 */ |
|
49 class MRequestHandlerObserver : public MConnectionObserver |
|
50 { |
|
51 public: // New Methods |
|
52 /** |
|
53 * Requests the observer to send a command to the server. |
|
54 * |
|
55 * @since 3.1 |
|
56 * @param aFunction The function number identifying the request. |
|
57 * @param aArgs A set of up to 4 arguments and their types to be passed to the server. |
|
58 * @param aStatus The request status object used to contain the completion status of the request. |
|
59 * @return void. |
|
60 */ |
|
61 virtual void SendAsyncCommand(TInt aFunction, const TIpcArgs& aArgs, |
|
62 TRequestStatus& aStatus) const = 0; |
|
63 |
|
64 /** |
|
65 * Notifies the observer that the request is completed. |
|
66 * |
|
67 * @since 3.1 |
|
68 * @param aRequestHandler The request handler. |
|
69 * @param aStatus The result code of the request. |
|
70 * @return void. |
|
71 */ |
|
72 virtual void RequestHandlerCompleted(CRequestHandler& aRequestHandler, |
|
73 TInt aStatus) = 0; |
|
74 |
|
75 /** |
|
76 * |
|
77 */ |
|
78 virtual void CancelAllCommandsL() = 0; |
|
79 }; |
|
80 |
|
81 |
|
82 /** |
|
83 * Base class for client side request handling. |
|
84 * |
|
85 * \b Library: FeedsEngine.lib |
|
86 * |
|
87 * @since CCB (7.1) |
|
88 */ |
|
89 class CRequestHandler: public CBase |
|
90 { |
|
91 public: // Data types |
|
92 enum TRequestHandlerType |
|
93 { |
|
94 ENone = 0, |
|
95 // folder related |
|
96 EFetchRootFolderItem, |
|
97 EWatchForChanges, |
|
98 EAddFolderItem, |
|
99 EDeleteFolderItem, |
|
100 EChangeFolderItem, |
|
101 EMoveFolderItem, |
|
102 EMoveFolderItemTo, |
|
103 EUpdateFolderItem, |
|
104 EImportOPML, |
|
105 EExportOPML, |
|
106 // feed related |
|
107 EFetchFeed, |
|
108 EUpdateItemStatus, |
|
109 // general client related |
|
110 EChangeSettings, |
|
111 EFetchSettings, |
|
112 EWatchForSettingChanges, |
|
113 ECancelAll, |
|
114 EDisconnectManualUpdateConnection, |
|
115 EPrintDBTables |
|
116 }; |
|
117 |
|
118 public: |
|
119 |
|
120 /** |
|
121 * C++ default constructor. |
|
122 */ |
|
123 CRequestHandler(); |
|
124 |
|
125 /** |
|
126 * Destructor |
|
127 */ |
|
128 virtual ~CRequestHandler(); |
|
129 |
|
130 }; |
|
131 |
|
132 #endif // REQUEST_HANDLER_H |
|
133 // End of File |