|
1 /* |
|
2 * Copyright (c) 2004 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: Pure data handler abstract interface |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MPENGPUREDATAHANDLER_H__ |
|
19 #define __MPENGPUREDATAHANDLER_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <E32Std.h> |
|
24 |
|
25 // DATA TYPES |
|
26 |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * Pure data handler for network session |
|
35 * |
|
36 * It is used to send requests to the network |
|
37 * server and to retrieve its responses |
|
38 * |
|
39 * @since 3.0 |
|
40 */ |
|
41 class MPEngPureDataHandler |
|
42 { |
|
43 |
|
44 public: // |
|
45 |
|
46 /** |
|
47 * Close reference to the Pure data handler |
|
48 * Pure data halder is deleted if it is no more needed. |
|
49 * |
|
50 * @since 3.0 |
|
51 */ |
|
52 virtual void Close() = 0; |
|
53 |
|
54 /** |
|
55 * Get Transfer buffer for out going message |
|
56 * |
|
57 * @since 3.0 |
|
58 * @return writable data buffer |
|
59 */ |
|
60 virtual TPtr8 TransferBufferL() = 0; |
|
61 |
|
62 /** |
|
63 * Sends data from the transfer buffer to the network |
|
64 * Completion code is signaled in TRequestStatus complete |
|
65 * |
|
66 * @since 3.0 |
|
67 * @param aStatus TRequestStatus to signal completion |
|
68 * @return unique code of the transaction. Same code is |
|
69 * used, when client wants to get response to this |
|
70 * message |
|
71 */ |
|
72 virtual TInt SendDataL( TRequestStatus& aStatus ) = 0; |
|
73 |
|
74 /** |
|
75 * Gets response for the message of given operation id |
|
76 * |
|
77 * @since 3.0 |
|
78 * @param aTransId transaction Id generated by the send operation |
|
79 * @return buffer with the response to the transaction |
|
80 * ownership of the buffer is passed to the user of function |
|
81 */ |
|
82 virtual HBufC8* ResponseL( TInt aTransId ) = 0; |
|
83 |
|
84 /** |
|
85 * Cancel sendin operation of given transaction id |
|
86 * |
|
87 * @since 3.0 |
|
88 * |
|
89 * @param aTransId transaction id of operation to be canceled |
|
90 */ |
|
91 virtual void CancelSending( TInt aTransId ) = 0; |
|
92 |
|
93 /** |
|
94 * Listen Incoming data |
|
95 * Function returns number of incoming data buffer which |
|
96 * are queued on the client side and can be picked |
|
97 * when incoming data are picked by the listener, transaction |
|
98 * is is 0. Buffer of incoming data is FIFO |
|
99 * |
|
100 * @since 3.0 |
|
101 * @param request status to signal new data |
|
102 * @return number of the incoming data buffers |
|
103 * which are already ready to be picked by the listener |
|
104 */ |
|
105 virtual TInt ListenIncomingData( TRequestStatus& aStatus ) = 0; |
|
106 |
|
107 /** |
|
108 * Cancel incoming data listening |
|
109 * |
|
110 * @since 3.0 |
|
111 * @param |
|
112 * @return |
|
113 */ |
|
114 virtual void CancelListening() = 0; |
|
115 |
|
116 protected: //Destructor |
|
117 |
|
118 /** |
|
119 * Virtual inline destructor. |
|
120 * Protected destructor to prohibits deletion trough interface. |
|
121 */ |
|
122 virtual ~MPEngPureDataHandler() {}; |
|
123 }; |
|
124 |
|
125 |
|
126 #endif // __MPENGPUREDATAHANDLER_H__ |
|
127 |
|
128 // End of File |
|
129 |
|
130 |
|
131 |