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 SGRESOURCE_INL
23 #define SGRESOURCE_INL
30 Compares this identifier with another one to check if they are the same.
32 @param aId The other identifier to compare against.
35 @return ETrue if the two identifiers are the same, EFalse otherwise.
37 inline TBool TSgDrawableId::operator ==(const TSgDrawableId& aId) const
39 return iId[0] == aId.iId[0]
40 && iId[1] == aId.iId[1]
41 && iId[2] == aId.iId[2]
42 && iId[3] == aId.iId[3]
43 && iId[4] == aId.iId[4]
44 && iId[5] == aId.iId[5];
53 Compares this identifier with another one to check if they are different.
55 @param aId The other identifier to compare against.
58 @return ETrue if the two identifiers are different, EFalse otherwise.
60 inline TBool TSgDrawableId::operator !=(const TSgDrawableId& aId) const
62 return !operator ==(aId);
71 Retrieves the type of a handle derived from RSgDrawable as a globally unique identifier.
72 The type is set by the constructor of the handle and does not depend on the run-time
73 type of the referenced drawable resource.
77 @return The type of the handle as a globally unique identifier.
78 @see RSgDrawable::DrawableType()
80 inline TUid RSgDrawable::HandleType() const
90 Makes an extension interface available on a drawable resource. The extension interface
91 is specified by type. The following example demonstrates how to use this function
92 to get access to an extension interface.
95 MExampleExtensionInterface* interface;
96 if (drawable.GetInterface(interface) == KErrNone)
100 @param aInterfacePtr On return, a pointer to the specified interface.
101 @pre The Graphics Resource driver is initialised for use in the context of the
103 @pre This RSgDrawable handle is valid and not null.
104 @pre The specified interface is supported on the drawable resource.
105 @post The specified interface is available until this RSgDrawable handle is closed.
106 @return KErrNone if successful.
107 @return KErrBadHandle if this RSgDrawable handle is null.
108 @return KErrExtensionNotSupported if the specified interface is not supported on
109 the drawable resource.
110 @return KErrNoMemory if there is not enough system memory.
111 @panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
112 @panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
113 for use in the context of the calling process.
114 @see RSgDrawable::GetInterface<M>(const M*&) const
116 WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
119 inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr)
121 return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
129 Makes an extension interface available on a drawable resource. The extension interface
130 is specified by type and returned const-qualified. The following example demonstrates
131 how to use this function to get access to an extension interface.
134 const MExampleExtensionInterface* interface;
135 if (drawable.GetInterface(interface) == KErrNone)
139 @param aInterfacePtr On return, a pointer to the specified interface.
140 @pre The Graphics Resource driver is initialised for use in the context of the
142 @pre This RSgDrawable handle is valid and not null.
143 @pre The specified interface is supported on the drawable resource.
144 @post The specified interface is available until this RSgDrawable handle is closed.
145 @return KErrNone if successful.
146 @return KErrBadHandle if this RSgDrawable handle is null.
147 @return KErrExtensionNotSupported if the specified interface is not supported on
148 the drawable resource.
149 @return KErrNoMemory if there is not enough system memory.
150 @panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
151 @panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
152 for use in the context of the calling process.
153 @see RSgDrawable::GetInterface<M>(M*&)
155 WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
158 inline TInt RSgDrawable::GetInterface(const M*& aInterfacePtr) const
160 return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
163 #endif // SGRESOURCE_INL