|
1 /* |
|
2 * Copyright (c) 2005-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: Data supplier API for chunked sending of large messages |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MMMSCODECDATASUPPLIER_H |
|
21 #define MMMSCODECDATASUPPLIER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 /** |
|
26 * Defines the interface for chunked data supply. |
|
27 * |
|
28 * When MMS messages are sent in chunks this provides the interface |
|
29 * that can be called to get next encoded data chunk |
|
30 * |
|
31 * @since v3.1 |
|
32 */ |
|
33 class MMmsCodecDataSupplier |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Give poiner to next encoded data chunk. |
|
40 * |
|
41 * @since v3.1 |
|
42 * @param aDataPart pointer to the next encoded data part |
|
43 * @param aLastDataChunk |
|
44 * ETrue if this is the last data chunk |
|
45 * EFalse if this is not the last data chunk |
|
46 * @return error code, KErrNone if all is well. |
|
47 * If returns some other error, transaction must be cancelled. |
|
48 */ |
|
49 virtual TInt GetNextDataPart( |
|
50 TPtrC8& aDataPart, TBool& aLastDataChunk ) = 0; |
|
51 |
|
52 /** |
|
53 * Empty buffer and prepare next data part (synchronous encoding). |
|
54 * When needed, caller will tell HTTP stack that the next data part is |
|
55 * ready by calling RHTTPTransaction::NotifyNewRequestBodyPartL() |
|
56 * |
|
57 * @since v3.1 |
|
58 * @return error code, KErrNone if all is well. |
|
59 * If returns some other error, transaction must be cancelled. |
|
60 */ |
|
61 virtual TInt ReleaseData() = 0; |
|
62 |
|
63 /** |
|
64 * Return the overall data size. |
|
65 * |
|
66 * @since v3.1 |
|
67 * @return The overall data size if it is known, otherwise KErrNotFound |
|
68 */ |
|
69 virtual TInt OverallDataSize() = 0; |
|
70 |
|
71 /** |
|
72 * Reset the data supplier. |
|
73 * Data supplier must start the data generation from the beginning again. |
|
74 * |
|
75 * @since v3.1 |
|
76 * @return KErrNone if reset is successful, other error code if data |
|
77 * supplier cannot be reset |
|
78 */ |
|
79 virtual TInt ResetSupplier() = 0; |
|
80 |
|
81 }; |
|
82 |
|
83 #endif // MMMSCODECDATASUPPLIER_H |