|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 #ifndef __BLACKLISTITEM_H__ |
|
18 #define __BLACKLISTITEM_H__ |
|
19 |
|
20 // SYSTEM INCLUDE |
|
21 #include <e32base.h> |
|
22 |
|
23 |
|
24 /** |
|
25 * A helper class (DTO) for data stored to the blacklist database and cache. |
|
26 */ |
|
27 NONSHARABLE_CLASS( CBlacklistItem ) : public CBase |
|
28 { |
|
29 public: |
|
30 /** |
|
31 * Standard NewL(). |
|
32 * @param aModified Item's last modification time. |
|
33 * @param aUri Item's URI. |
|
34 * @param aMediaId Item's media id. |
|
35 * @return New item |
|
36 */ |
|
37 static CBlacklistItem* NewL( const TInt64& aModified, |
|
38 const TDesC& aUri, const TUint32 aMediaId ); |
|
39 |
|
40 /** Destructor. */ |
|
41 virtual ~CBlacklistItem(); |
|
42 |
|
43 /** |
|
44 * Check if given item matches given data. |
|
45 * @param aUri Item's URI. |
|
46 * @param aMediaId Item's media id. |
|
47 * @return ETrue, if matches. |
|
48 */ |
|
49 TBool Compare( const TDesC& aUri, const TUint32 aMediaId ); |
|
50 |
|
51 /** |
|
52 * Return item's last modification time. |
|
53 * @return Item's last modification time. |
|
54 */ |
|
55 const TInt64& Modified(); |
|
56 |
|
57 /** |
|
58 * Return item's MediaId. |
|
59 * @return item's MediaId. |
|
60 */ |
|
61 const TUint32& MediaId(); |
|
62 |
|
63 |
|
64 /** |
|
65 * Return item's Uri. |
|
66 * @return item's Uri. |
|
67 */ |
|
68 const HBufC* Uri(); |
|
69 |
|
70 /** |
|
71 * Return item's size for serialization. |
|
72 * @return item's size for serialization. |
|
73 */ |
|
74 TInt RequiredBufferSize(); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * 2nd phase construction. |
|
80 * @param aUri Item's URI. |
|
81 */ |
|
82 void ConstructL( const TDesC& aUri ); |
|
83 |
|
84 /** |
|
85 * Constructor. |
|
86 * @param aModified Item's last modification time. |
|
87 * @param aMediaId Item's media id. |
|
88 */ |
|
89 CBlacklistItem( const TInt64& aModified, |
|
90 const TUint32 aMediaId ); |
|
91 |
|
92 private: // data |
|
93 |
|
94 /** @var Item modification time */ |
|
95 TInt64 iModified; |
|
96 |
|
97 /** @var Item URI */ |
|
98 HBufC* iUri; |
|
99 |
|
100 /** Media Id of the item's location */ |
|
101 TUint32 iMediaId; |
|
102 }; |
|
103 |
|
104 |
|
105 #endif |