|
1 /* |
|
2 * Copyright (c) 2008-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: Thumbnail storage interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 * @internal reviewed 30/07/2007 by Simon Brooks |
|
23 */ |
|
24 |
|
25 #ifndef M_GLXTNSTORAGE_H |
|
26 #define M_GLXTNSTORAGE_H |
|
27 |
|
28 // INCLUDES |
|
29 |
|
30 #include <e32std.h> |
|
31 #include <glxmediaid.h> |
|
32 #include "glxtnstd.h" |
|
33 |
|
34 class CGlxtnFileInfo; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Interface for thumbnail persistent storage. |
|
40 * |
|
41 * @ingroup glx_thumbnail_creator |
|
42 */ |
|
43 class MGlxtnThumbnailStorage |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Start asynchronous loading of thumbnail data. |
|
48 * @param aData Buffer pointer for the loaded data. Memory is allocated |
|
49 internally and ownership passed to the caller. |
|
50 * @param aFormat Format of the thumbnail in aData. |
|
51 * @param aId Media item ID. |
|
52 * @param aFileInfo File info for media item. |
|
53 * @param aSize Requested thumbnail size. |
|
54 * @param aStatus Request status for the asynchronous operation. |
|
55 */ |
|
56 virtual void LoadThumbnailDataL(HBufC8*& aData, |
|
57 TGlxImageDataFormat& aFormat, const TGlxMediaId& aId, |
|
58 const CGlxtnFileInfo& aFileInfo, const TSize& aSize, |
|
59 TRequestStatus* aStatus) = 0; |
|
60 /** |
|
61 * Start asynchronous saving of thumbnail data. |
|
62 * @param aData Buffer containing the data to be saved. |
|
63 * @param aFormat Format of the thumbnail in aData. |
|
64 * @param aId Media item ID. |
|
65 * @param aFileInfo File info for media item. |
|
66 * @param aSize Requested thumbnail size. |
|
67 * @param aStatus Request status for the asynchronous operation. |
|
68 */ |
|
69 virtual void SaveThumbnailDataL(const TDesC8& aData, |
|
70 TGlxImageDataFormat aFormat, const TGlxMediaId& aId, |
|
71 const CGlxtnFileInfo& aFileInfo, const TSize& aSize, |
|
72 TRequestStatus* aStatus) = 0; |
|
73 /** |
|
74 * Start asynchronous deletion of all saved thumbnails for an item. |
|
75 * @param aId Media item ID. |
|
76 * @param aFileInfo File info for media item. |
|
77 * @param aStatus Request status for the asynchronous operation. |
|
78 */ |
|
79 virtual void DeleteThumbnailsL(const TGlxMediaId& aId, |
|
80 const CGlxtnFileInfo& aFileInfo, TRequestStatus* aStatus) = 0; |
|
81 /** |
|
82 * Start asynchronous deletion of all saved thumbnails for items which no |
|
83 * longer exist. |
|
84 * @param aStatus Request status for the asynchronous operation. |
|
85 */ |
|
86 virtual void CleanupThumbnailsL(TRequestStatus* aStatus) = 0; |
|
87 /** |
|
88 * Test whether a given thumbnail is available in storage. |
|
89 * @param aId Media item ID. |
|
90 * @param aFileInfo File info for media item. |
|
91 * @param aSize Requested thumbnail size. |
|
92 * @param aStatus Request status for the asynchronous operation. |
|
93 */ |
|
94 virtual void IsThumbnailAvailableL(const TGlxMediaId& aId, |
|
95 const CGlxtnFileInfo& aFileInfo, |
|
96 const TSize& aSize, TRequestStatus* aStatus) = 0; |
|
97 /** |
|
98 * Cancel an ongoing asynchronous operation. |
|
99 */ |
|
100 virtual void StorageCancel() = 0; |
|
101 /** |
|
102 * Notify that an error occurred in background generation. |
|
103 * @param aId Media item ID. |
|
104 * @param aError Error code. |
|
105 */ |
|
106 virtual void NotifyBackgroundError(const TGlxMediaId& aId, TInt aError) = 0; |
|
107 }; |
|
108 |
|
109 /** |
|
110 * Interface for notification of thumbnails becoming available in storage. |
|
111 * |
|
112 * @ingroup glx_thumbnail_creator |
|
113 */ |
|
114 class MGlxtnThumbnailStorageObserver |
|
115 { |
|
116 public: |
|
117 /** |
|
118 * Notify that a given thumbnail is available in storage. |
|
119 * @param aId Media item ID. |
|
120 * @param aSize Requested thumbnail size. |
|
121 */ |
|
122 virtual void ThumbnailAvailable(const TGlxMediaId& aId, const TSize& aSize) = 0; |
|
123 /** |
|
124 * Notify that an error occurred in background generation. |
|
125 * @param aId Media item ID. |
|
126 * @param aError Error code. |
|
127 */ |
|
128 virtual void BackgroundThumbnailError(const TGlxMediaId& aId, TInt aError) = 0; |
|
129 }; |
|
130 |
|
131 #endif // M_GLXTNSTORAGE_H |
|
132 |
|
133 // End of File |