|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef __OBEXASYNCFILEWRITER_H__ |
|
22 #define __OBEXASYNCFILEWRITER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "obexfilewriter.h" |
|
26 |
|
27 class RFile; |
|
28 |
|
29 /** |
|
30 Obex Asynchronous File Writer. |
|
31 |
|
32 This active object writes data from Obex objects to disk asynchronously. |
|
33 |
|
34 Not intended for derivation. |
|
35 |
|
36 @internalComponent |
|
37 @released |
|
38 */ |
|
39 NONSHARABLE_CLASS(CObexAsyncFileWriter) : public CActive, public MObexFileWriter |
|
40 { |
|
41 public: |
|
42 // Construction / destruction |
|
43 static MObexFileWriter* NewL(RFile& aFile); |
|
44 ~CObexAsyncFileWriter(); |
|
45 |
|
46 private: |
|
47 // From MObexFileWriter |
|
48 TInt Write(TInt aPos, CBufBase*& aBuf); |
|
49 TInt FinalWrite(TInt aPos, CBufBase*& aBuf, TInt aLength); |
|
50 |
|
51 private: |
|
52 // From CActive |
|
53 void DoCancel(); |
|
54 void RunL(); |
|
55 |
|
56 private: |
|
57 // Construction |
|
58 void ConstructL(); |
|
59 CObexAsyncFileWriter(RFile& aFile); |
|
60 |
|
61 // Unowned |
|
62 private: |
|
63 /** Reference to the file which this object is used to write to */ |
|
64 RFile& iFile; |
|
65 /** Pointer to the buffer this object is currently writing to file */ |
|
66 CBufBase* iBuffer; |
|
67 /** Descriptor for the buffer this object is currently writing to file */ |
|
68 TPtr8 iBufPtr; |
|
69 }; |
|
70 |
|
71 #endif // __OBEXASYNCFILEWRITER_H__ |