|
1 /* |
|
2 * Copyright (c) 2006-2009 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 transfer object for placeholder data |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PLACEHOLDERDATA_H |
|
20 #define PLACEHOLDERDATA_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32cmn.h> |
|
25 #include <e32def.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 /** |
|
30 * A helper class which encapsulates data needed for |
|
31 * creating placeholder objects. |
|
32 */ |
|
33 NONSHARABLE_CLASS( CPlaceholderData ) : public CBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Second phase construction |
|
39 */ |
|
40 IMPORT_C static CPlaceholderData* NewL(); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 virtual ~CPlaceholderData(); |
|
46 |
|
47 /** |
|
48 * Returns modification time - equals RFs::Modified() |
|
49 * |
|
50 * @param Last modification time |
|
51 */ |
|
52 IMPORT_C TTime Modified(); |
|
53 |
|
54 /** |
|
55 * Sets modification time - should be RFs::Modified() |
|
56 * for binary files |
|
57 * |
|
58 * @return Last modification time |
|
59 */ |
|
60 IMPORT_C void SetModified( TTime aModified ); |
|
61 |
|
62 /** |
|
63 * Returns URI of the file/item. |
|
64 * |
|
65 * @return URI |
|
66 */ |
|
67 IMPORT_C TPtr16 Uri(); |
|
68 |
|
69 /** |
|
70 * Sets URI of the file/item. |
|
71 * |
|
72 * @param aUri URI of the file |
|
73 */ |
|
74 IMPORT_C void SetUri( const TDesC& aUri ); |
|
75 |
|
76 /** |
|
77 * Returns file size bytes. |
|
78 * |
|
79 * @return File size in bytes. |
|
80 */ |
|
81 IMPORT_C TUint32 FileSize(); |
|
82 |
|
83 /** |
|
84 * Sets file size bytes. |
|
85 * |
|
86 * @param aUri File size bytes. |
|
87 */ |
|
88 IMPORT_C void SetFileSize( TUint32 aFileSize ); |
|
89 |
|
90 /** |
|
91 * Returns MediaID which identifies the volume/drive where |
|
92 * the file is located. Equals to TVolumeInfo::iUniqueID. |
|
93 * |
|
94 * @return MediaID |
|
95 */ |
|
96 IMPORT_C TUint MediaId(); |
|
97 |
|
98 /** |
|
99 * Sets MediaID which identifies the volume/drive where |
|
100 * the file is located. Equals to TVolumeInfo::iUniqueID. |
|
101 * |
|
102 * @param aMediaId MediaID of the volume. |
|
103 */ |
|
104 IMPORT_C void SetMediaId( TUint aMediaId ); |
|
105 |
|
106 /** |
|
107 * Returns present state for the file. |
|
108 * |
|
109 * @return Present state. |
|
110 */ |
|
111 IMPORT_C TInt PresentState(); |
|
112 |
|
113 /** |
|
114 * Sets present state for the file |
|
115 * |
|
116 * @param aState Present state. |
|
117 */ |
|
118 IMPORT_C void SetPresentState( TInt aState ); |
|
119 |
|
120 /** |
|
121 * Returns whether file is pre-installed or not. |
|
122 * |
|
123 * @return Whether file is pre-installed or not. |
|
124 */ |
|
125 IMPORT_C TInt Preinstalled(); |
|
126 |
|
127 /** |
|
128 * Sets whether file is pre-installed or not. |
|
129 * |
|
130 * @param aValue Whether file is pre-installed or not. |
|
131 */ |
|
132 IMPORT_C void SetPreinstalled( TInt aValue ); |
|
133 |
|
134 protected: |
|
135 |
|
136 /** |
|
137 * Constructor |
|
138 */ |
|
139 void ConstructL(); |
|
140 |
|
141 private: |
|
142 |
|
143 /* URI of the placeholder */ |
|
144 HBufC* iUri; |
|
145 |
|
146 /* Last modified time - RFs::Modified() */ |
|
147 TTime iModified; |
|
148 |
|
149 /* File size in bytes */ |
|
150 TUint32 iFileSize; |
|
151 |
|
152 /* Volume/Drive ID where file - TVolumeInfo::iUniqueID*/ |
|
153 TUint32 iMediaId; |
|
154 |
|
155 /* Present/not present state */ |
|
156 TInt iPresentState; |
|
157 |
|
158 /* Whether file is pre-installed or not */ |
|
159 TInt iPreinstalled; |
|
160 }; |
|
161 |
|
162 #endif // PLACEHOLDERDATA_H |
|
163 |