sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef SGIMAGECOLLECTION_H sl@0: #define SGIMAGECOLLECTION_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: class MSgImageCollectionAdapter; sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @prototype sl@0: @deprecated sl@0: sl@0: A handle to a reference-counted collection of images with the same attributes which sl@0: is allocated in such a way that it can be used with the Graphics Composition Engine. sl@0: Users can access each of the images in the collection individually through RSgImage sl@0: handles. Interoperability with the Graphics Composition Engine is achieved by sl@0: passing the surface identifier returned by SurfaceId() in calls to the Graphics sl@0: Composition Engine API or the Surface Update API. sl@0: sl@0: Since both images and image collections are reference-counted, and an image collection sl@0: can only be destroyed as a whole, then an image collection is guaranteed to exist sl@0: while there is an open RSgImageCollection handle referencing it or there are open sl@0: RSgImage handles referencing any of the individual images in the collection. sl@0: sl@0: A new RSgImageCollection handle does not refer to an image collection until a sl@0: successful call to Create(). Before that point, the handle is said to be a null sl@0: handle. Instances of RSgImageCollection can be shared among threads in the same sl@0: process. sl@0: sl@0: An RSgImageCollection handle is said to be invalid if it is not null but it does not sl@0: reference an existing image collection. Copying an instance of RSgImageCollection sl@0: must be done with extreme care, since it does not increment the reference count of sl@0: the referenced image collection and may therefore allow some RSgImageCollection or sl@0: RSgImage handle to become invalid when the image collection is destroyed. sl@0: sl@0: @see RSgImage sl@0: */ sl@0: NONSHARABLE_CLASS(RSgImageCollection) sl@0: { sl@0: public: sl@0: IMPORT_C RSgImageCollection(); sl@0: IMPORT_C TInt Create(const TSgImageInfo& aInfo, TInt aImageCount); sl@0: IMPORT_C static TInt Create(const TSgImageInfo aInfos[], TInt aImageCount, sl@0: RSgImageCollection aCollections[], TInt aCollectionCount); sl@0: IMPORT_C void Close(); sl@0: IMPORT_C const TSurfaceId& SurfaceId() const; sl@0: IMPORT_C TBool IsNull() const; sl@0: IMPORT_C TInt GetInfo(TSgImageInfo& aInfo) const; sl@0: IMPORT_C TInt Count() const; sl@0: IMPORT_C TInt OpenImage(TInt aIndex, RSgImage& aResult); sl@0: private: sl@0: MSgImageCollectionAdapter* iImpl; sl@0: }; sl@0: sl@0: sl@0: #endif // SGIMAGECOLLECTION_H