installationservices/swi/inc/swiobservedinfo.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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 * Defines common classes which are used to describe observed SWI events.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25   
       
    26  #ifndef SWIOBSERVEDINFO_H
       
    27  #define SWIOBSERVEDINFO_H
       
    28  
       
    29  #include <e32cmn.h>
       
    30  #include <swi/swiobcommon.h>
       
    31  
       
    32  namespace Swi
       
    33  	{
       
    34  	NONSHARABLE_CLASS(CObservationData) : public CBase
       
    35 	/**
       
    36 		Class for a single observation record data. Contains the basic information about
       
    37 		a changed file by the SWI operation. Each observed SWI event in an observation log
       
    38 		corresponds to a single observation data.	
       
    39 	 */
       
    40 		{
       
    41 	public:
       
    42 		IMPORT_C static CObservationData* NewLC();
       
    43 
       
    44 		IMPORT_C static CObservationData* NewL(const TDesC& aFileName, const TSecureId& aSid, const TUint8 aFileFlag);
       
    45 		IMPORT_C static CObservationData* NewLC(const TDesC& aFileName, const TSecureId& aSid, const TUint8 aFileFlag);
       
    46 		
       
    47 		IMPORT_C void InternalizeL(RReadStream& aStream);
       
    48 		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
    49 			
       
    50 		~CObservationData();
       
    51 			
       
    52 	private:
       
    53 		CObservationData();
       
    54 		CObservationData(const TSecureId& aSid, const TUint8 aFileFlag);
       
    55 		void ConstructL(const TDesC& aFileName);
       
    56 			
       
    57 	public:
       
    58 		HBufC* iFileName; 	///< Fully qualified file path.
       
    59 		TSecureId iSid;   	///< Secure Id of the file.
       
    60 		/**
       
    61 			Gives information about the file: whether the file has been removed 
       
    62 			from the system and the type of the file (exe or dll).
       
    63 		 */
       
    64 		TUint8 iFileFlag;
       
    65 		};
       
    66 			
       
    67 		
       
    68 	NONSHARABLE_CLASS(CObservationHeader) : public CBase
       
    69 	/**
       
    70 		Class that contains all observation records related with a specific package. 
       
    71 		In an observation log file, each header info corresponds to a specific package.	
       
    72 	 */
       
    73 		{
       
    74 	public:
       
    75 		IMPORT_C static CObservationHeader* NewLC();
       
    76 
       
    77 		IMPORT_C static CObservationHeader* NewL(const TUid& aPckgUid, const TPackageType aPckgType, const TOperationType aOpType);
       
    78 		IMPORT_C static CObservationHeader* NewLC(const TUid& aPckgUid, const TPackageType aPckgType, const TOperationType aOpType);
       
    79 			
       
    80 		IMPORT_C void InternalizeL(RReadStream& aStream);
       
    81 		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
    82 				
       
    83 		~CObservationHeader();
       
    84 			
       
    85 	private:
       
    86 		CObservationHeader();
       
    87 		CObservationHeader(const TUid& aPckgUid, const TPackageType aPckgType, const TOperationType aOpType);
       
    88 			
       
    89 	public:
       
    90 		TUid iPckgUid;				///< The package Uid of the package which copies/deletes the file.
       
    91 		TPackageType iPckgType;		///< The type of package (SA, SP, PU, etc.)
       
    92 		TOperationType iOpType;     ///< Operation type: Install, Uninstall, Restore etc.
       
    93 		};
       
    94 		
       
    95 		
       
    96 	NONSHARABLE_CLASS(CObservationFilter) : public CBase
       
    97 	/**
       
    98 		Class that represents a filter list which is used to filter SWI observation.
       
    99 		SWI Observer ECOM plug-in implementations declares the folders in which they
       
   100 		are intrested by using this class.
       
   101 	 */
       
   102 		{
       
   103 	public:
       
   104 		IMPORT_C static CObservationFilter* NewL();	
       
   105 		IMPORT_C static CObservationFilter* NewLC();
       
   106 		
       
   107 		IMPORT_C void AddFilterL(const HBufC* aFilter);
       
   108 		IMPORT_C TBool FindF(const HBufC* aFilter) const;
       
   109 		
       
   110 		~CObservationFilter();
       
   111 			
       
   112 	private:
       
   113 		CObservationFilter();
       
   114 			
       
   115 	private:
       
   116 		RPointerArray<HBufC> iFilterList; ///< The list of filters used to filter the observations.
       
   117 		};
       
   118  
       
   119  	} // End of namespace Swi
       
   120  
       
   121  #endif