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