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 SGRESOURCE_INL
sl@0: #define SGRESOURCE_INL
sl@0: 
sl@0: /**
sl@0: @publishedPartner
sl@0: @prototype
sl@0: @deprecated
sl@0: 
sl@0: Compares this identifier with another one to check if they are the same.
sl@0: 
sl@0: @param aId The other identifier to compare against.
sl@0: @pre None.
sl@0: @post None.
sl@0: @return ETrue if the two identifiers are the same, EFalse otherwise.
sl@0: */
sl@0: inline TBool TSgDrawableId::operator ==(const TSgDrawableId& aId) const
sl@0: 	{
sl@0: 	return iId[0] == aId.iId[0]
sl@0: 		&& iId[1] == aId.iId[1]
sl@0: 		&& iId[2] == aId.iId[2]
sl@0: 		&& iId[3] == aId.iId[3]
sl@0: 		&& iId[4] == aId.iId[4]
sl@0: 		&& iId[5] == aId.iId[5];
sl@0: 	}
sl@0: 
sl@0: 
sl@0: /**
sl@0: @publishedPartner
sl@0: @prototype
sl@0: @deprecated
sl@0: 
sl@0: Compares this identifier with another one to check if they are different.
sl@0: 
sl@0: @param aId The other identifier to compare against.
sl@0: @pre None.
sl@0: @post None.
sl@0: @return ETrue if the two identifiers are different, EFalse otherwise.
sl@0: */
sl@0: inline TBool TSgDrawableId::operator !=(const TSgDrawableId& aId) const
sl@0: 	{
sl@0: 	return !operator ==(aId);
sl@0: 	}
sl@0: 
sl@0: 
sl@0: /**
sl@0: @publishedPartner
sl@0: @prototype
sl@0: @deprecated
sl@0: 
sl@0: Retrieves the type of a handle derived from RSgDrawable as a globally unique identifier.
sl@0: The type is set by the constructor of the handle and does not depend on the run-time
sl@0: type of the referenced drawable resource.
sl@0: 
sl@0: @pre None.
sl@0: @post None.
sl@0: @return The type of the handle as a globally unique identifier.
sl@0: @see RSgDrawable::DrawableType()
sl@0: */
sl@0: inline TUid RSgDrawable::HandleType() const
sl@0: 	{
sl@0: 	return iHandleType;
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: @publishedPartner
sl@0: @prototype
sl@0: @deprecated
sl@0: 
sl@0: Makes an extension interface available on a drawable resource. The extension interface
sl@0: is specified by type. The following example demonstrates how to use this function
sl@0: to get access to an extension interface.
sl@0: 
sl@0: @code
sl@0: 	MExampleExtensionInterface* interface;
sl@0: 	if (drawable.GetInterface(interface) == KErrNone)
sl@0: 		{
sl@0: @endcode
sl@0: 
sl@0: @param aInterfacePtr On return, a pointer to the specified interface.
sl@0: @pre The Graphics Resource driver is initialised for use in the context of the
sl@0:      calling process.
sl@0: @pre This RSgDrawable handle is valid and not null.
sl@0: @pre The specified interface is supported on the drawable resource.
sl@0: @post The specified interface is available until this RSgDrawable handle is closed.
sl@0: @return KErrNone if successful.
sl@0: @return KErrBadHandle if this RSgDrawable handle is null.
sl@0: @return KErrExtensionNotSupported if the specified interface is not supported on
sl@0:         the drawable resource.
sl@0: @return KErrNoMemory if there is not enough system memory.
sl@0: @panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
sl@0: @panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
sl@0:        for use in the context of the calling process.
sl@0: @see RSgDrawable::GetInterface<M>(const M*&) const
sl@0: 
sl@0: WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
sl@0: */
sl@0: template<class M>
sl@0: inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr)
sl@0: 	{
sl@0: 	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: @publishedPartner
sl@0: @prototype
sl@0: @deprecated
sl@0: 
sl@0: Makes an extension interface available on a drawable resource. The extension interface
sl@0: is specified by type and returned const-qualified. The following example demonstrates
sl@0: how to use this function to get access to an extension interface.
sl@0: 
sl@0: @code
sl@0: 	const MExampleExtensionInterface* interface;
sl@0: 	if (drawable.GetInterface(interface) == KErrNone)
sl@0: 		{
sl@0: @endcode
sl@0: 
sl@0: @param aInterfacePtr On return, a pointer to the specified interface.
sl@0: @pre The Graphics Resource driver is initialised for use in the context of the
sl@0:      calling process.
sl@0: @pre This RSgDrawable handle is valid and not null.
sl@0: @pre The specified interface is supported on the drawable resource.
sl@0: @post The specified interface is available until this RSgDrawable handle is closed.
sl@0: @return KErrNone if successful.
sl@0: @return KErrBadHandle if this RSgDrawable handle is null.
sl@0: @return KErrExtensionNotSupported if the specified interface is not supported on
sl@0:         the drawable resource.
sl@0: @return KErrNoMemory if there is not enough system memory.
sl@0: @panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
sl@0: @panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
sl@0:        for use in the context of the calling process.
sl@0: @see RSgDrawable::GetInterface<M>(M*&)
sl@0: 
sl@0: WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
sl@0: */
sl@0: template<class M>
sl@0: inline TInt RSgDrawable::GetInterface(const M*& aInterfacePtr) const
sl@0: 	{
sl@0: 	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
sl@0: 	}
sl@0: 
sl@0: #endif // SGRESOURCE_INL