os/graphics/graphicsresourceservices/graphicsresource/inc/sgimagecollectionadapter.h
Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef SGIMAGECOLLECTIONADAPTER_H
23 #define SGIMAGECOLLECTIONADAPTER_H
25 #include <graphics/sgresourceadapter.h>
26 #include <graphics/sgimagecollection.h>
34 This interface must be implemented by all the user-side objects in the adaptation
35 layer of the Graphics subsystem which are referenced by instances of RSgImageCollection.
36 The interface between the user-side and the kernel-side parts of the adaptation
37 layer is outside the scope of the specification of the Graphics Resource API.
39 @see RSgImageCollection
41 class MSgImageCollectionAdapter: public MSgResourceAdapter
48 Retrieves the surface identifier of the image collection represented by this
51 @return The surface identifier of the image collection.
52 @see RSgImageCollection::SurfaceId()
54 virtual const TSurfaceId& SurfaceId() const = 0;
60 Retrieves the values of the attributes of the images in the image collection
61 represented by this adapter object.
63 @param aInfo On input, the globally unique identifiers of the user-defined
64 attributes to be retrieved from the image collection, if any. On return,
65 the values of the attributes of the images in the collection and the
66 values of the selected user-defined attributes.
67 @pre If aInfo.iUserAttributes is not null then it points to an array of
68 aInfo.iUserAttributeCount elements with globally unique identifiers
69 corresponding to user-defined attributes attached to the image collection.
70 @return KErrNone if successful.
71 @return KErrNotFound if any of the user-defined attributes to be retrieved from
72 the image collection cannot be found.
73 @see RSgImageCollection::GetInfo()
75 virtual TInt GetInfo(TSgImageInfo& aInfo) const = 0;
81 Retrieves the number of images in the image collection represented by this
84 @return The number of images in the image collection.
85 @see RSgImageCollection::Count()
87 virtual TInt Count() const = 0;
93 Opens a new handle to one of the images in the image collection represented by
94 this adapter object. If there are no handles to the image open in the calling
95 process then this function creates a new adapter object that represents the image
96 in the context of the calling process. Otherwise this function just increments
97 the reference count of the existing adapter object that represents the image
98 in the context of the calling process.
100 @param aIndex The index of the image within the image collection.
101 @param aResult On return, a pointer to the adapter object that represents the
102 specified image in the collection.
103 @pre aIndex is greater than or equal to zero and less than the number of images
105 @pre aResult is null.
106 @post aResult points to either a newly created or an existing adapter object
107 that represents the specified image in the collection. If a new adapter
108 object is created then its initial reference count is one and the reference
109 count for the image collection is incremented by one. Otherwise only the
110 reference count for the adapter object is incremented by one.
111 @return KErrNone if successful.
112 @return KErrInUse if aResult was not null.
113 @return KErrArgument if aIndex is invalid.
114 @return KErrNoMemory if there is not enough system memory.
115 @see RSgImageCollection::OpenImage()
117 virtual TInt OpenImage(TInt aIndex, MSgDrawableAdapter*& aResult) = 0;
121 #endif // SGIMAGECOLLECTIONADAPTER_H