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