dependencies/swi/sisregistrylog.h
branchv5backport
changeset 31 a3e98f9c292b
equal deleted inserted replaced
30:f9f9f96b1873 31:a3e98f9c292b
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * The access to a specific functionality depends on the client capabilities 
       
    16 * and may be restricted.             
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @publishedPartner
       
    24  @released
       
    25 */
       
    26  
       
    27 #ifndef __SISREGISTRYLOGGING_H__
       
    28 #define __SISREGISTRYLOGGING_H__
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <f32file.h>
       
    32 #include <s32strm.h>
       
    33 
       
    34 class RReadStream;
       
    35 class RWriteStream;
       
    36 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    37 namespace Usif
       
    38 	{
       
    39 	class RSoftwareComponentRegistry;
       
    40 	}
       
    41 #endif
       
    42 
       
    43 
       
    44 namespace Swi
       
    45 {
       
    46 class CSisRegistryObject;
       
    47 
       
    48 enum TSwiLogTypes
       
    49 		 {
       
    50  		 ESwiLogInstall =0,
       
    51  		 ESwiLogUnInstall,
       
    52  		 ESwiLogUpgrade,
       
    53  		 ESwiLogRestore
       
    54 		 };
       
    55 
       
    56 namespace 
       
    57 {
       
    58   	const TInt KLogFileMajorVersion = 4;
       
    59     const TInt KLogFileMinorVersion = 0;
       
    60 } 
       
    61 
       
    62 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    63 namespace ScrHelperUtil
       
    64 	{
       
    65 	HBufC8* GetLogInfoLC(const Usif::RSoftwareComponentRegistry& aScrSession, TInt aMaxLogEntries);
       
    66 	}
       
    67 #endif
       
    68 
       
    69 class CLogEntry : public CBase
       
    70 {
       
    71 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    72 friend HBufC8* ScrHelperUtil::GetLogInfoLC(const Usif::RSoftwareComponentRegistry& aScrSession, TInt aMaxLogEntries);
       
    73 #endif
       
    74 public:
       
    75 	static CLogEntry* NewL(const CSisRegistryObject& aObject,TSwiLogTypes InstallInfo);
       
    76  	static CLogEntry* NewLC(const CSisRegistryObject& aObject,TSwiLogTypes InstallInfo);
       
    77 
       
    78 	/**
       
    79 	 * Constructs a entry from a given existing stream. 
       
    80 	 */
       
    81 	static CLogEntry* NewL(RReadStream& aStream);
       
    82 	static CLogEntry* NewLC(RReadStream& aStream);
       
    83 	
       
    84 	/**
       
    85 	 * Default Constructor 
       
    86 	 */
       
    87  	CLogEntry(){};
       
    88  	
       
    89  	/**
       
    90 	 * Write the object to a stream 
       
    91 	 *
       
    92 	 * @param aStream The stream to write to
       
    93 	 */
       
    94 	void ExternalizeL(RWriteStream& aStream) const;
       
    95 	 
       
    96 	/**
       
    97 	 * Read the object from a stream
       
    98 	 *
       
    99 	 * @param aStream The stream to read from.
       
   100 	 */
       
   101 	void InternalizeL(RReadStream& aStream) ;
       
   102  
       
   103 	/**
       
   104 	 * Destructor 
       
   105 	 */
       
   106 	~CLogEntry();
       
   107 	
       
   108 	void ConstructL(RReadStream& aStream);
       
   109 	void ConstructL(const CSisRegistryObject& aObject,TSwiLogTypes InstallInfo);
       
   110     
       
   111     /**
       
   112 	 * Returns the Time
       
   113 	 *
       
   114 	 * @return HBufC8 descriptor containing text.
       
   115 	 */
       
   116     IMPORT_C const TTime GetTime() const; 
       
   117     
       
   118     /**
       
   119 	 * The package name.
       
   120 	 * @return the name of this package as reference to TDesC.
       
   121 	 */
       
   122 	IMPORT_C const TDesC& GetPkgName() const; 
       
   123 	
       
   124 	/**
       
   125 	 * The Major Version
       
   126 	 * @return he major version number of the package
       
   127 	 */
       
   128 	IMPORT_C TInt32 GetMajorVersion() const; 
       
   129 	
       
   130 	/**
       
   131 	 * The Minor Version.
       
   132 	 * @return the minor version number of the package.
       
   133 	 */
       
   134 	IMPORT_C TInt32 GetMinorVersion() const; 
       
   135 	
       
   136 	/**
       
   137 	 * The Build Version.
       
   138 	 * @return the Build Version of the package.
       
   139 	 */
       
   140 	IMPORT_C TInt32 GetBuildVersion() const; 
       
   141 	
       
   142 	/**
       
   143 	 * The UID.
       
   144 	 * @return the Uid of the package.
       
   145 	 */
       
   146 	IMPORT_C const TUid GetUid() const; 
       
   147     
       
   148     /**
       
   149 	 * Returns the install type for this package
       
   150 	 * @return The install type
       
   151 	 */
       
   152 	IMPORT_C TSwiLogTypes GetInstallType() const;
       
   153    
       
   154 private:
       
   155 
       
   156     HBufC* iPackageName ;
       
   157 	TInt32 iMajorVersion;
       
   158 	TInt32 iMinorVersion;
       
   159 	TInt32 iBuildVersion;
       
   160 	TSwiLogTypes iInstallType ; 
       
   161 	TTime  iEvent ;   
       
   162 	TUid iUid; 
       
   163 };
       
   164 
       
   165 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   166 /**
       
   167  * @internalComponent
       
   168  * @released
       
   169  */
       
   170 class CLogFileVersion : public CBase
       
   171     {
       
   172 public:
       
   173     CLogFileVersion()
       
   174    		{
       
   175    		iLogFileMajorVersion = KLogFileMajorVersion;
       
   176 		iLogFileMinorVersion = KLogFileMinorVersion;
       
   177 	    }
       
   178 	
       
   179     static CLogFileVersion* NewL(RReadStream& aStream);
       
   180 	static CLogFileVersion* NewLC(RReadStream& aStream);
       
   181 	
       
   182 	/**
       
   183 	 * Write the object to a stream 
       
   184 	 *
       
   185 	 * @param aStream The stream to write to
       
   186 	 */
       
   187 	 void ExternalizeL(RWriteStream& aStream) const;
       
   188 	
       
   189 	/**
       
   190 	 * Read the object from a stream
       
   191 	 *
       
   192 	 * @param aStream The stream to read from.
       
   193 	 */
       
   194 	 void InternalizeL(RReadStream& aStream) ;
       
   195 	 
       
   196      void ConstructL();
       
   197 	 void ConstructL(RReadStream& aStream);
       
   198 	 
       
   199 	/**
       
   200 	 * Copy Constructor 
       
   201 	 */
       
   202 	CLogFileVersion(const CLogFileVersion& aObject1);
       
   203 	
       
   204 private:
       
   205 	TUint8 iLogFileMajorVersion;
       
   206 	TUint8 iLogFileMinorVersion;  
       
   207   	 
       
   208     };
       
   209 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
   210 } //namespace
       
   211 
       
   212 #endif
       
   213 
       
   214