|
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: CNcdFileInfo declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCDFILEINFO_H |
|
20 #define C_NCDFILEINFO_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <s32strm.h> |
|
24 |
|
25 #include "ncdsendable.h" |
|
26 #include "ncditempurpose.h" |
|
27 |
|
28 /** |
|
29 * Utility class used for containing content file specific info |
|
30 */ |
|
31 class CNcdFileInfo : public CBase, public MNcdSendable |
|
32 { |
|
33 public: |
|
34 |
|
35 static CNcdFileInfo* NewLC( |
|
36 const TDesC& aFilePath, |
|
37 const TDesC& aMimeType, |
|
38 TNcdItemPurpose aPurpose = ENcdItemPurposeUnknown ); |
|
39 |
|
40 static CNcdFileInfo* NewLC( RReadStream& aStream ); |
|
41 |
|
42 virtual ~CNcdFileInfo(); |
|
43 |
|
44 const TDesC& FilePath() const; |
|
45 const TDesC& MimeType() const; |
|
46 |
|
47 void SetMimeTypeL( const TDesC& aMime ); |
|
48 |
|
49 TNcdItemPurpose Purpose() const; |
|
50 |
|
51 void ExternalizeL( RWriteStream& aStream ) const; |
|
52 |
|
53 void ExternalizeWithoutFilenamesL( |
|
54 RWriteStream& aStream ) const; |
|
55 |
|
56 void InternalizeL( RReadStream& aStream ); |
|
57 |
|
58 /** |
|
59 * Set general data |
|
60 * Ownership is transferred |
|
61 */ |
|
62 void SetDataL( HBufC8* aData ); |
|
63 |
|
64 const TDesC8& Data() const; |
|
65 |
|
66 protected: |
|
67 |
|
68 CNcdFileInfo( TNcdItemPurpose aPurpose ); |
|
69 void ConstructL( const TDesC& aFilePath, |
|
70 const TDesC& aMimeType ); |
|
71 |
|
72 private: |
|
73 |
|
74 TNcdItemPurpose iPurpose; |
|
75 HBufC* iFilePath; |
|
76 HBufC* iMimeType; |
|
77 HBufC8* iData; |
|
78 }; |
|
79 |
|
80 #endif // C_NCDFILEINFO_H |