|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef SGIMAGECOLLECTION_H |
|
23 #define SGIMAGECOLLECTION_H |
|
24 |
|
25 #include <graphics/sgimage.h> |
|
26 #include <graphics/surface.h> |
|
27 |
|
28 |
|
29 class MSgImageCollectionAdapter; |
|
30 |
|
31 /** |
|
32 @publishedPartner |
|
33 @prototype |
|
34 @deprecated |
|
35 |
|
36 A handle to a reference-counted collection of images with the same attributes which |
|
37 is allocated in such a way that it can be used with the Graphics Composition Engine. |
|
38 Users can access each of the images in the collection individually through RSgImage |
|
39 handles. Interoperability with the Graphics Composition Engine is achieved by |
|
40 passing the surface identifier returned by SurfaceId() in calls to the Graphics |
|
41 Composition Engine API or the Surface Update API. |
|
42 |
|
43 Since both images and image collections are reference-counted, and an image collection |
|
44 can only be destroyed as a whole, then an image collection is guaranteed to exist |
|
45 while there is an open RSgImageCollection handle referencing it or there are open |
|
46 RSgImage handles referencing any of the individual images in the collection. |
|
47 |
|
48 A new RSgImageCollection handle does not refer to an image collection until a |
|
49 successful call to Create(). Before that point, the handle is said to be a null |
|
50 handle. Instances of RSgImageCollection can be shared among threads in the same |
|
51 process. |
|
52 |
|
53 An RSgImageCollection handle is said to be invalid if it is not null but it does not |
|
54 reference an existing image collection. Copying an instance of RSgImageCollection |
|
55 must be done with extreme care, since it does not increment the reference count of |
|
56 the referenced image collection and may therefore allow some RSgImageCollection or |
|
57 RSgImage handle to become invalid when the image collection is destroyed. |
|
58 |
|
59 @see RSgImage |
|
60 */ |
|
61 NONSHARABLE_CLASS(RSgImageCollection) |
|
62 { |
|
63 public: |
|
64 IMPORT_C RSgImageCollection(); |
|
65 IMPORT_C TInt Create(const TSgImageInfo& aInfo, TInt aImageCount); |
|
66 IMPORT_C static TInt Create(const TSgImageInfo aInfos[], TInt aImageCount, |
|
67 RSgImageCollection aCollections[], TInt aCollectionCount); |
|
68 IMPORT_C void Close(); |
|
69 IMPORT_C const TSurfaceId& SurfaceId() const; |
|
70 IMPORT_C TBool IsNull() const; |
|
71 IMPORT_C TInt GetInfo(TSgImageInfo& aInfo) const; |
|
72 IMPORT_C TInt Count() const; |
|
73 IMPORT_C TInt OpenImage(TInt aIndex, RSgImage& aResult); |
|
74 private: |
|
75 MSgImageCollectionAdapter* iImpl; |
|
76 }; |
|
77 |
|
78 |
|
79 #endif // SGIMAGECOLLECTION_H |