1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/ecom/implementationinformation.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,205 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// This file contains the implementation of
1.18 +// the CImplementationInformation class.
1.19 +// Provide the inline implementation of CImplementationInformation
1.20 +// CImplementationInformation provides access to information on a particular implementation
1.21 +//
1.22 +//
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +/**
1.28 +
1.29 + Intended Usage : Accessor for this implementation's human readable name
1.30 + @since 7.0
1.31 + @return The human readable name for this implementation
1.32 + @pre CImplementationInformation is fully constructed and initialized
1.33 +*/
1.34 +const TDesC& CImplementationInformation::DisplayName() const
1.35 + {
1.36 + if(iDisplayName == NULL)
1.37 + return KNullDesC();
1.38 + else
1.39 + return *iDisplayName;
1.40 + }
1.41 +
1.42 +
1.43 +/**
1.44 +Intended Usage : Accessor for this implementation's default binary data
1.45 +@since 7.0
1.46 +@return The data type which this implementation supports
1.47 +@pre CImplementationInformation is fully constructed and initialized
1.48 +*/
1.49 +const TDesC8& CImplementationInformation::DataType() const
1.50 + {
1.51 + if(iData == NULL)
1.52 + return KNullDesC8();
1.53 + else
1.54 + return *iData;
1.55 + }
1.56 +
1.57 +
1.58 +/**
1.59 +Intended Usage : Accessor for this implementation's opaque binary data
1.60 +@since 7.0
1.61 +@return The opaque data which is available for this implementation
1.62 +@pre CImplementationInformation is fully constructed and initialized
1.63 +*/
1.64 +const TDesC8& CImplementationInformation::OpaqueData() const
1.65 + {
1.66 + if(iOpaqueData == NULL)
1.67 + return KNullDesC8();
1.68 + else
1.69 + return *iOpaqueData;
1.70 + }
1.71 +
1.72 +
1.73 +/**
1.74 +Intended Usage : Accessor for this implementation's Uid
1.75 +@since 7.0
1.76 +@return The Uid of this implementation
1.77 +@pre CImplementationInformation is fully constructed and initialized
1.78 +*/
1.79 +TUid CImplementationInformation::ImplementationUid() const
1.80 + {
1.81 + return iImplementationUid;
1.82 + }
1.83 +
1.84 +
1.85 +/**
1.86 +Intended Usage : Accessor for the version number of this implementation
1.87 +@since 7.0
1.88 +@return The version number of this implementation
1.89 +@pre CImplementationInformation is fully constructed and initialized
1.90 +*/
1.91 +TInt CImplementationInformation::Version() const
1.92 + {
1.93 + return iVersion;
1.94 + }
1.95 +
1.96 +
1.97 +/**
1.98 +Intended Usage : Accessor for whether this implementation is currently
1.99 + disabled
1.100 +@since 7.0
1.101 +@return Flag indicating whether this implementation is disabled
1.102 +@pre CImplementationInformation is fully constructed and initialized
1.103 +*/
1.104 +TBool CImplementationInformation::Disabled() const
1.105 + {
1.106 + return iDisabled;
1.107 + }
1.108 +
1.109 +
1.110 +/**
1.111 +Intended Usage : Marks this implementation as disabled, or enabled.
1.112 +Note that this function should not be used by any ECOM client side as it will have no effect at all
1.113 +on the implementation information stored in the server side.
1.114 +@since 7.0
1.115 +@param aDisabled ETrue to indicate this implementation should be disabled, EFalse for enabled.
1.116 +@pre CImplementationInformation is fully constructed and initialized
1.117 +@post Implementation is marked as.
1.118 +*/
1.119 +void CImplementationInformation::SetDisabled(TBool aDisabled)
1.120 + {
1.121 + iDisabled = aDisabled;
1.122 + }
1.123 +
1.124 +/**
1.125 +Intended Usage : Returns the drive that this implementation is installed on
1.126 +Error Condition : None
1.127 +@since 7.0
1.128 +@return The drive that this implementation is on
1.129 +@pre CImplementationInformation is fully constructed.
1.130 +*/
1.131 +TDriveUnit CImplementationInformation::Drive() const
1.132 + {
1.133 + return iDrive;
1.134 + }
1.135 +
1.136 +
1.137 +/**
1.138 +Intended Usage : Accessor for whether this implementation is to be loaded
1.139 + from ROM only
1.140 +@return Flag indicating whether this implementation is to be loaded from ROM only
1.141 +@pre CImplementationInformation is fully constructed
1.142 +*/
1.143 +TBool CImplementationInformation::RomOnly() const
1.144 + {
1.145 + return iRomOnly;
1.146 + }
1.147 +
1.148 +/**
1.149 +Intended Usage : Accessor for whether this implementation is on ROM or is
1.150 + a later version of one on ROM
1.151 +@return Flag indicating whether this implementation is on ROM or is a later version of one on ROM
1.152 +@pre CImplementationInformation is fully constructed
1.153 +*/
1.154 +TBool CImplementationInformation::RomBased() const
1.155 + {
1.156 + return iRomBased;
1.157 + }
1.158 +/**
1.159 +Intended Usage: Returns the VID of the plug-in that this implementation belongs to.
1.160 + The VID is the VendorId for the plug-in's DLL
1.161 +@pre CImplementationInformation is fully constructed
1.162 +@return VendorId of the plug-in that this implementation belongs to.
1.163 +*/
1.164 +TVendorId CImplementationInformation::VendorId() const
1.165 + {
1.166 + return iVid;
1.167 + }
1.168 +
1.169 +/**
1.170 +Intended Usage: Sets the VID of the plug-in that this implementation belongs to.
1.171 + The VID is the VendorId for the plug-in's DLL.
1.172 +@internalComponent
1.173 +@pre CImplementationInformation is fully constructed
1.174 +@param aVid VendorId of the plug-in that this implementation belongs to.
1.175 +*/
1.176 +void CImplementationInformation::SetVendorId(const TVendorId aVid)
1.177 + {
1.178 + iVid = aVid;
1.179 + }
1.180 +
1.181 +// ____________________________________________________________________________
1.182 +// Provide the inline implementations of useful utilitiy functions related to
1.183 +// CImplementationInformation for use in client and server sides.
1.184 +//
1.185 +
1.186 +/**
1.187 +Comparison function used in ordering functions (e.g. as used with TLinearOrder)
1.188 +where ECOM UID identified structures are held in ordered RArray/RPointerArray
1.189 +objects.
1.190 +
1.191 +@internalComponent
1.192 +@param aUid1 First UID value of comparison
1.193 +@param aUid2 Second UID Value of comparison
1.194 +@return Returns 1 when aUid1 > aUid2; -1 when aUid1 < aUid2; 0 when they equal
1.195 +*/
1.196 +inline TInt CompareTUidValues(TInt aUid1, TInt aUid2)
1.197 + {
1.198 + // This has been implemented as 'return aUid1-aUid2' previously.
1.199 + // This can lead to overflow problems when comparing 2 signed integers
1.200 + // if the operands are large enough: large aUid minus large negative aUid2
1.201 + // returns a negative value due to arithmetic overflow of the result when
1.202 + // you'd want a positive value. Hence the longer hand implementation below.
1.203 + if (aUid1 > aUid2)
1.204 + return 1;
1.205 + if (aUid1 < aUid2)
1.206 + return -1;
1.207 + return 0;
1.208 + }