1.1 --- a/epoc32/include/versioninfo.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/versioninfo.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,146 @@
1.4 -versioninfo.h
1.5 +/*
1.6 +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Interface for quering system version information.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef VERSION_INFO_H
1.25 +#define VERSION_INFO_H
1.26 +
1.27 +// INCLUDES
1.28 +#include <e32std.h>
1.29 +
1.30 +// FORWARD DECLARATIONS
1.31 +class RFs;
1.32 +
1.33 +// CLASS DECLARATION
1.34 +/**
1.35 +* Class holds system version information. Version Info API provides
1.36 +* an interface for quering system version information.
1.37 +*
1.38 +* Usage:
1.39 +*
1.40 +* Get platform version information:
1.41 +* @code
1.42 +* // iFs contains open file server session
1.43 +*
1.44 +* VersionInfo::TPlatformVersion platformVersion;
1.45 +* // Select the overload of VersionInfo::GetVersion() that suits best for
1.46 +* // the current client.
1.47 +* User::LeaveIfError( VersionInfo::GetVersion( platformVersion, iFs ) );
1.48 +*
1.49 +* // Now platformVersion contains platform version information.
1.50 +*
1.51 +* @endcode
1.52 +*
1.53 +* @lib platformver.lib
1.54 +* @since S60 3.2
1.55 +*/
1.56 +
1.57 +NONSHARABLE_CLASS(VersionInfo)
1.58 + {
1.59 +
1.60 +public:
1.61 + /**
1.62 + * Class TVersionBase is a base class for all version information data.
1.63 + * @since S60 3.2
1.64 + */
1.65 + class TVersionBase
1.66 + {
1.67 + friend class VersionInfo;
1.68 +
1.69 + protected:
1.70 + /**
1.71 + * Constructor for subclasses
1.72 + * @since S60 3.2
1.73 + * @param aType Sets type of version info specified by TVersionType
1.74 + */
1.75 + inline TVersionBase( TInt aType );
1.76 +
1.77 + private:
1.78 + /**
1.79 + * C++ default constructor.
1.80 + */
1.81 + TVersionBase();
1.82 +
1.83 + private:
1.84 + /** Contains type of version info specified by TVersionType */
1.85 + TInt iType;
1.86 + };
1.87 +
1.88 + /**
1.89 + * Class TPlatformVersion stores platform version information.
1.90 + * The class is used as parameter in GetVersionInfo() methods.
1.91 + * @since S60 3.2
1.92 + */
1.93 + class TPlatformVersion : public TVersionBase
1.94 + {
1.95 + public:
1.96 + /**
1.97 + * C++ default constructor.
1.98 + */
1.99 + inline TPlatformVersion();
1.100 +
1.101 + public:
1.102 + /** Contains the major version. For example 3 if S60 3.2 */
1.103 + TUint16 iMajorVersion;
1.104 +
1.105 + /** Contains the minor version. For example 2 if S60 3.2 */
1.106 + TUint16 iMinorVersion;
1.107 + };
1.108 +
1.109 + /**
1.110 + * This method gets the version information.
1.111 + *
1.112 + * @since S60 3.2
1.113 + * @param aVersion Stores the version information
1.114 + * @return System wide error code
1.115 + *
1.116 + * @see TVersionBase
1.117 + */
1.118 + IMPORT_C static TInt GetVersion( TVersionBase& aVersion );
1.119 +
1.120 + /**
1.121 + * This method gets the version information. Given file server
1.122 + * session avoids the overhead of new file server connection.
1.123 + *
1.124 + * @since S60 3.2
1.125 + * @param aVersion Stores the version information
1.126 + * @param aFs An opened file server session
1.127 + * @return System wide error code
1.128 + *
1.129 + * @see TVersionBase
1.130 + */
1.131 + IMPORT_C static TInt GetVersion( TVersionBase& aVersion, RFs& aFs );
1.132 +
1.133 +private:
1.134 + /**
1.135 + * C++ default constructor.
1.136 + */
1.137 + VersionInfo();
1.138 +
1.139 + /** Used internally to detect type of version info */
1.140 + enum TVersionType
1.141 + {
1.142 + EPlatformVersion = 0
1.143 + };
1.144 + };
1.145 +
1.146 +#include "versioninfo.inl"
1.147 +
1.148 +#endif // VERSION_INFO_H
1.149 +
1.150 +// End of File