persistentstorage/centralrepository/cenrepsrv/install.h
changeset 0 08ec8eefde2f
child 23 26645d81f48d
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @internalTechnology
       
    18 */
       
    19 
       
    20 #ifndef __INSTALL_H__
       
    21 #define __INSTALL_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 #include <e32property.h>
       
    26 #include "srvrepos_noc.h"
       
    27 #include <sacls.h>
       
    28 #include <saclscommon.h>
       
    29 
       
    30 class CInstallEntry : public CBase
       
    31 	{
       
    32 public:
       
    33 	static CInstallEntry* NewL();
       
    34 	CInstallEntry();
       
    35 	~CInstallEntry();
       
    36 	void ConstructL();
       
    37 	void SetL(TEntry& aEntry);
       
    38 	void HandleFileDeleteL(TInt aOperation);
       
    39 	void HandleFileCreateL(TInt aOperation);
       
    40 	void HandleFileUpdateL(TInt aOperation);
       
    41 
       
    42 	void InternalizeL(RReadStream& aStream);
       
    43 	void ExternalizeL(RWriteStream& aStream) const;
       
    44 
       
    45 	TUid Uid() const;
       
    46 	TTime Modified() const;
       
    47 	TCentRepFileType FileExt() const;
       
    48 private:
       
    49 	TUid   iUid;
       
    50 	TTime  iModified;
       
    51 	TCentRepFileType iFileExt;
       
    52 	CServerRepository* iRepository;
       
    53 	CSessionNotifier* iNotifier;
       
    54 	};
       
    55 	
       
    56 class CCentRepSWIWatcher: public CActive
       
    57 	{
       
    58 public:
       
    59 	static CCentRepSWIWatcher* NewL(RFs& aFs);
       
    60 	void Start();
       
    61 	~CCentRepSWIWatcher();
       
    62 	void HandleSWIEventL(TInt swiProperty);
       
    63     void FindChangedEntriesL(TBool aStartup=EFalse);		
       
    64 	//From CActive
       
    65 protected:	
       
    66 	void RunL();
       
    67 	TInt RunError(TInt aError);
       
    68 	void DoCancel();
       
    69 private:
       
    70 	CCentRepSWIWatcher(RFs& aFs);
       
    71 	void NotifyChange();
       
    72 	void ConstructL();
       
    73 	
       
    74 	void ReadInstallDirL(RPointerArray<CInstallEntry>& aEntryArray);
       
    75 
       
    76 	
       
    77 	void SaveInstallDirL();
       
    78 	void GetInstallDirL();
       
    79 	void ReadAndInternalizeInstallDirL(const TDesC& aInstallDirFilePath);
       
    80 	
       
    81 	static TBool MatchEntries(const CInstallEntry &aSource, const CInstallEntry &aTarget);
       
    82 
       
    83 	TDesC& iInstallDir;
       
    84 	RFs& iFs;
       
    85 	RPointerArray<CInstallEntry> iInstallEntryArray;
       
    86 	RPointerArray<CInstallEntry> iCurrentInstallDirEntries;
       
    87 	RProperty iSWIKey;
       
    88 	TInt iSWIOperation;
       
    89 	TInt iSWIStatus;
       
    90 	};
       
    91 #endif