williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // This file contains the implementation of williamr@2: // the CImplementationInformation class. williamr@2: // Provide the inline implementation of CImplementationInformation williamr@2: // CImplementationInformation provides access to information on a particular implementation williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: williamr@2: Intended Usage : Accessor for this implementation's human readable name williamr@2: @since 7.0 williamr@2: @return The human readable name for this implementation williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: const TDesC& CImplementationInformation::DisplayName() const williamr@2: { williamr@2: if(iDisplayName == NULL) williamr@2: return KNullDesC(); williamr@2: else williamr@2: return *iDisplayName; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for this implementation's default binary data williamr@2: @since 7.0 williamr@2: @return The data type which this implementation supports williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: const TDesC8& CImplementationInformation::DataType() const williamr@2: { williamr@2: if(iData == NULL) williamr@2: return KNullDesC8(); williamr@2: else williamr@2: return *iData; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for this implementation's opaque binary data williamr@2: @since 7.0 williamr@2: @return The opaque data which is available for this implementation williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: const TDesC8& CImplementationInformation::OpaqueData() const williamr@2: { williamr@2: if(iOpaqueData == NULL) williamr@2: return KNullDesC8(); williamr@2: else williamr@2: return *iOpaqueData; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for this implementation's Uid williamr@2: @since 7.0 williamr@2: @return The Uid of this implementation williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: TUid CImplementationInformation::ImplementationUid() const williamr@2: { williamr@2: return iImplementationUid; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for the version number of this implementation williamr@2: @since 7.0 williamr@2: @return The version number of this implementation williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: TInt CImplementationInformation::Version() const williamr@2: { williamr@2: return iVersion; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for whether this implementation is currently williamr@2: disabled williamr@2: @since 7.0 williamr@2: @return Flag indicating whether this implementation is disabled williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: */ williamr@2: TBool CImplementationInformation::Disabled() const williamr@2: { williamr@2: return iDisabled; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Marks this implementation as disabled, or enabled. williamr@2: Note that this function should not be used by any ECOM client side as it will have no effect at all williamr@2: on the implementation information stored in the server side. williamr@2: @since 7.0 williamr@2: @param aDisabled ETrue to indicate this implementation should be disabled, EFalse for enabled. williamr@2: @pre CImplementationInformation is fully constructed and initialized williamr@2: @post Implementation is marked as. williamr@2: */ williamr@2: void CImplementationInformation::SetDisabled(TBool aDisabled) williamr@2: { williamr@2: iDisabled = aDisabled; williamr@2: } williamr@2: williamr@2: /** williamr@2: Intended Usage : Returns the drive that this implementation is installed on williamr@2: Error Condition : None williamr@2: @since 7.0 williamr@2: @return The drive that this implementation is on williamr@2: @pre CImplementationInformation is fully constructed. williamr@2: */ williamr@2: TDriveUnit CImplementationInformation::Drive() const williamr@2: { williamr@2: return iDrive; williamr@2: } williamr@2: williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for whether this implementation is to be loaded williamr@2: from ROM only williamr@2: @return Flag indicating whether this implementation is to be loaded from ROM only williamr@2: @pre CImplementationInformation is fully constructed williamr@2: */ williamr@2: TBool CImplementationInformation::RomOnly() const williamr@2: { williamr@2: return iRomOnly; williamr@2: } williamr@2: williamr@2: /** williamr@2: Intended Usage : Accessor for whether this implementation is on ROM or is williamr@2: a later version of one on ROM williamr@2: @return Flag indicating whether this implementation is on ROM or is a later version of one on ROM williamr@2: @pre CImplementationInformation is fully constructed williamr@2: */ williamr@2: TBool CImplementationInformation::RomBased() const williamr@2: { williamr@2: return iRomBased; williamr@2: } williamr@2: /** williamr@2: Intended Usage: Returns the VID of the plug-in that this implementation belongs to. williamr@2: The VID is the VendorId for the plug-in's DLL williamr@2: @pre CImplementationInformation is fully constructed williamr@2: @return VendorId of the plug-in that this implementation belongs to. williamr@2: */ williamr@2: TVendorId CImplementationInformation::VendorId() const williamr@2: { williamr@2: return iVid; williamr@2: } williamr@2: williamr@2: /** williamr@2: Intended Usage: Sets the VID of the plug-in that this implementation belongs to. williamr@2: The VID is the VendorId for the plug-in's DLL. williamr@2: @internalComponent williamr@2: @pre CImplementationInformation is fully constructed williamr@2: @param aVid VendorId of the plug-in that this implementation belongs to. williamr@2: */ williamr@2: void CImplementationInformation::SetVendorId(const TVendorId aVid) williamr@2: { williamr@2: iVid = aVid; williamr@2: } williamr@2: williamr@2: // ____________________________________________________________________________ williamr@2: // Provide the inline implementations of useful utilitiy functions related to williamr@2: // CImplementationInformation for use in client and server sides. williamr@2: // williamr@2: williamr@2: /** williamr@2: Comparison function used in ordering functions (e.g. as used with TLinearOrder) williamr@2: where ECOM UID identified structures are held in ordered RArray/RPointerArray williamr@2: objects. williamr@2: williamr@2: @internalComponent williamr@2: @param aUid1 First UID value of comparison williamr@2: @param aUid2 Second UID Value of comparison williamr@2: @return Returns 1 when aUid1 > aUid2; -1 when aUid1 < aUid2; 0 when they equal williamr@2: */ williamr@2: inline TInt CompareTUidValues(TInt aUid1, TInt aUid2) williamr@2: { williamr@2: // This has been implemented as 'return aUid1-aUid2' previously. williamr@2: // This can lead to overflow problems when comparing 2 signed integers williamr@2: // if the operands are large enough: large aUid minus large negative aUid2 williamr@2: // returns a negative value due to arithmetic overflow of the result when williamr@2: // you'd want a positive value. Hence the longer hand implementation below. williamr@2: if (aUid1 > aUid2) williamr@2: return 1; williamr@2: if (aUid1 < aUid2) williamr@2: return -1; williamr@2: return 0; williamr@2: }