graphicsresourceservices/graphicsresource/inc/sgresource.inl
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @prototype
       
    20 */
       
    21 
       
    22 #ifndef SGRESOURCE_INL
       
    23 #define SGRESOURCE_INL
       
    24 
       
    25 /**
       
    26 @publishedPartner
       
    27 @prototype
       
    28 @deprecated
       
    29 
       
    30 Compares this identifier with another one to check if they are the same.
       
    31 
       
    32 @param aId The other identifier to compare against.
       
    33 @pre None.
       
    34 @post None.
       
    35 @return ETrue if the two identifiers are the same, EFalse otherwise.
       
    36 */
       
    37 inline TBool TSgDrawableId::operator ==(const TSgDrawableId& aId) const
       
    38 	{
       
    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];
       
    45 	}
       
    46 
       
    47 
       
    48 /**
       
    49 @publishedPartner
       
    50 @prototype
       
    51 @deprecated
       
    52 
       
    53 Compares this identifier with another one to check if they are different.
       
    54 
       
    55 @param aId The other identifier to compare against.
       
    56 @pre None.
       
    57 @post None.
       
    58 @return ETrue if the two identifiers are different, EFalse otherwise.
       
    59 */
       
    60 inline TBool TSgDrawableId::operator !=(const TSgDrawableId& aId) const
       
    61 	{
       
    62 	return !operator ==(aId);
       
    63 	}
       
    64 
       
    65 
       
    66 /**
       
    67 @publishedPartner
       
    68 @prototype
       
    69 @deprecated
       
    70 
       
    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.
       
    74 
       
    75 @pre None.
       
    76 @post None.
       
    77 @return The type of the handle as a globally unique identifier.
       
    78 @see RSgDrawable::DrawableType()
       
    79 */
       
    80 inline TUid RSgDrawable::HandleType() const
       
    81 	{
       
    82 	return iHandleType;
       
    83 	}
       
    84 
       
    85 /**
       
    86 @publishedPartner
       
    87 @prototype
       
    88 @deprecated
       
    89 
       
    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.
       
    93 
       
    94 @code
       
    95 	MExampleExtensionInterface* interface;
       
    96 	if (drawable.GetInterface(interface) == KErrNone)
       
    97 		{
       
    98 @endcode
       
    99 
       
   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
       
   102      calling process.
       
   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
       
   115 
       
   116 WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
       
   117 */
       
   118 template<class M>
       
   119 inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr)
       
   120 	{
       
   121 	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
       
   122 	}
       
   123 
       
   124 /**
       
   125 @publishedPartner
       
   126 @prototype
       
   127 @deprecated
       
   128 
       
   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.
       
   132 
       
   133 @code
       
   134 	const MExampleExtensionInterface* interface;
       
   135 	if (drawable.GetInterface(interface) == KErrNone)
       
   136 		{
       
   137 @endcode
       
   138 
       
   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
       
   141      calling process.
       
   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*&)
       
   154 
       
   155 WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
       
   156 */
       
   157 template<class M>
       
   158 inline TInt RSgDrawable::GetInterface(const M*& aInterfacePtr) const
       
   159 	{
       
   160 	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
       
   161 	}
       
   162 
       
   163 #endif // SGRESOURCE_INL