installationservices/swcomponentregistry/inc_private/scrrequestimpl.h
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2008-2010 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 * Declares the class which implements SCR's session and sub-session service requests.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef SCRREQUESTIMPL_H
       
    27 #define SCRREQUESTIMPL_H
       
    28 
       
    29 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    30 #include "screntries_internal.h"
       
    31 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
    32 #include "screntries.h"
       
    33 #include "appregentries.h"
       
    34 #include "appreginfo.h"
       
    35 #include <usif/scr/screntries_platform.h>
       
    36 
       
    37 namespace Usif
       
    38 	{
       
    39 	// constants
       
    40 	static const TLanguage KLangNone = TLanguage(0);
       
    41 	static const TInt KMaxSwTypeIdDigits = 4; 		///< Maximum number of digits a software type id may have.
       
    42 	static const TInt KMaxSwTypeIdValue = 0xFFFF;   ///< Maximum value of a software type id.	
       
    43 	
       
    44 	// forward declaration
       
    45 	class CDatabase;
       
    46 	class CStatement;
       
    47 	class CScrAsyncRequestImpl;
       
    48 	class CScrSession;
       
    49 	class CScrSubsession;
       
    50 	class CCompViewSubsessionContext;
       
    51 	class CAppInfoViewSubsessionContext;
       
    52 	class CRegInfoForApplicationSubsessionContext;
       
    53 	class CAppRegistrySubsessionContext;
       
    54 	class CApplicationRegInfoSubsessionContext; 
       
    55 
       
    56 	class CScrRequestImpl : public CBase
       
    57 		{
       
    58 	public:
       
    59 		static CScrRequestImpl* NewL(RFs& aFs, RFile& aDatabaseFile, RFile& aJournalFile);
       
    60 		~CScrRequestImpl();
       
    61 		
       
    62 		// Transaction Requests
       
    63 		void CreateTransactionL();
       
    64 		void RollbackTransactionL();
       
    65 		void CommitTransactionL();
       
    66 		
       
    67 		// Component Management Requests
       
    68 		void AddComponentL(const RMessage2& aMessage);
       
    69 		void AddComponentDependencyL(const RMessage2& aMessage);
       
    70 		void SetComponentLocalizablePropertyL(const RMessage2& aMessage);
       
    71 		void SetComponentBinaryPropertyL(const RMessage2& aMessage);		
       
    72 		void SetComponentIntPropertyL(const RMessage2& aMessage);
       
    73 		void RegisterComponentFileL(const RMessage2& aMessage); 
       
    74 		void SetFileStrPropertyL(const RMessage2& aMessage);
       
    75 		void SetFileIntPropertyL(const RMessage2& aMessage);
       
    76 		void SetComponentNameL(const RMessage2& aMessage);
       
    77 		void SetVendorNameL(const RMessage2& aMessage);
       
    78 		void SetIsComponentRemovableL(const RMessage2& aMessage);
       
    79 		void SetIsComponentDrmProtectedL(const RMessage2& aMessage);
       
    80 		void SetIsComponentHiddenL(const RMessage2& aMessage);
       
    81 		void SetIsComponentKnownRevokedL(const RMessage2& aMessage);
       
    82 		void SetIsComponentOriginVerifiedL(const RMessage2& aMessage);
       
    83 		void SetComponentSizeL(const RMessage2& aMessage);
       
    84 		void SetComponentVersionL(const RMessage2& aMessage);
       
    85 		void DeleteComponentPropertyL(const RMessage2& aMessage);
       
    86 		void DeleteFilePropertyL(const RMessage2& aMessage);
       
    87 		void UnregisterComponentFileL(const RMessage2& aMessage);
       
    88 		void DeleteComponentL(const RMessage2& aMessage);
       
    89 		void DeleteComponentDependencyL(const RMessage2& aMessage);
       
    90 		
       
    91 		// Component Query requests
       
    92 		void GetComponentEntrySizeL(const RMessage2& aMessage) const;							
       
    93 		void GetComponentEntryDataL(const RMessage2& aMessage) const;
       
    94 		void GetComponentLocalizedEntrySizeL(const RMessage2& aMessage) const;
       
    95 		void GetComponentLocalizedEntryDataL(const RMessage2& aMessage) const;
       
    96 		void GetFilePropertiesSizeL(const RMessage2& aMessage) const;
       
    97 		void GetFilePropertiesDataL(const RMessage2& aMessage) const;
       
    98 		void GetSingleFilePropertySizeL(const RMessage2& aMessage) const;
       
    99 		void GetSingleFilePropertyDataL(const RMessage2& aMessage) const;
       
   100 		void GetFileComponentsSizeL(const RMessage2& aMessage) const;
       
   101 		void GetFileComponentsDataL(const RMessage2& aMessage) const;
       
   102 		void GetComponentPropertiesSizeL(const RMessage2& aMessage) const;
       
   103 		void GetComponentPropertiesDataL(const RMessage2& aMessage) const;
       
   104 		void GetComponentSinglePropertySizeL(const RMessage2& aMessage) const;
       
   105 		void GetComponentSinglePropertyDataL(const RMessage2& aMessage) const;
       
   106 		void GetComponentIdListSizeL(const RMessage2& aMessage) const;
       
   107 		void GetComponentIdListDataL(const RMessage2& aMessage) const;
       
   108 		void GetComponentFilesCountL(const RMessage2& aMessage) const;
       
   109 		void GetComponentIdL(const RMessage2& aMessage) const;
       
   110 		void GetComponentWithGlobalIdSizeL(const RMessage2& aMessage) const;
       
   111 		void GetComponentWithGlobalIdDataL(const RMessage2& aMessage) const;
       
   112 		void GetSupplierComponentsSizeL(const RMessage2& aMessage) const;
       
   113 		void GetSupplierComponentsDataL(const RMessage2& aMessage) const;
       
   114 		void GetDependantComponentsSizeL(const RMessage2& aMessage) const;
       
   115 		void GetDependantComponentsDataL(const RMessage2& aMessage) const;
       
   116 		void GetComponentSupportedLocalesListSizeL(const RMessage2& aMessage) const;
       
   117 		void GetComponentSupportedLocalesListDataL(const RMessage2& aMessage) const;
       
   118 				
       
   119 		// Application Manager Requests
       
   120 		void GetIsMediaPresentL(const RMessage2& aMessage) const;
       
   121 		void GetIsComponentOrphanedL(const RMessage2& aMessage) const;
       
   122 		void GetLogFileHandleL(const RMessage2& aMessage) const;
       
   123 		void FlushLogEntriesArrayL();
       
   124 		void GetIsComponentOnReadOnlyDriveL(const RMessage2& aMessage) const;
       
   125 		void GetIsComponentPresentL(const RMessage2& aMessage) const;
       
   126 		TBool IsComponentPresentL(TComponentId aComponentId) const;
       
   127 		void SetIsComponentPresentL(const RMessage2& aMessage);
       
   128 		
       
   129 		// SIF Requests
       
   130 		void SetScomoStateL(const RMessage2& aMessage);
       
   131 		void GetPluginUidWithMimeTypeL(const RMessage2& aMessage) const;
       
   132 		void GetPluginUidWithComponentIdL(const RMessage2& aMessage) const;
       
   133 		
       
   134 		// Security Layer Requests
       
   135 		TBool GetInstallerOrExecutionEnvSidsForComponentL(TComponentId aComponentId, RArray<TSecureId>& aSids) const;
       
   136 		TBool GetSidsForSoftwareTypeIdL(TInt aSoftwareTypeId, RArray<TSecureId>& aSids) const;
       
   137 		TBool GetSidsForSoftwareTypeL(const HBufC* aSoftwareTypeName, RArray<TSecureId>& aSids) const;
       
   138 		TBool IsInstallerOrExecutionEnvSidL(TSecureId& aSid) const;
       
   139 		TBool GetIsComponentOrphanedL(TComponentId aComponentId) const;
       
   140 		TInt GetSoftwareTypeForComponentL(TComponentId aComponentId) const;
       
   141 		
       
   142 		// AppArc Requests
       
   143 		void GetApplicationLaunchersSizeL(const RMessage2& aMessage) const;
       
   144 		void GetApplicationLaunchersDataL(const RMessage2& aMessage) const;
       
   145 		
       
   146 		// Component's view operations
       
   147 		CComponentFilter* ReadComponentFilterL(const RMessage2& aMessage) const;
       
   148 		CStatement* OpenComponentViewL(CComponentFilter& aFilter, RArray<TComponentId>& aComponentFilterSuperset, TBool& aFilterSupersetInUse) const;
       
   149 		void NextComponentSizeL(const RMessage2& aMessage, CStatement* aStmt, CComponentFilter* aFilter, CComponentEntry*& aEntry, CCompViewSubsessionContext* aSubsessionContext) const;
       
   150 		void NextComponentDataL(const RMessage2& aMessage, CComponentEntry*& aEntry) const;
       
   151 		void NextComponentSetSizeL(const RMessage2& aMessage, CStatement* aStmt, CComponentFilter* aFilter, RPointerArray<CComponentEntry>& aEntryList, CCompViewSubsessionContext* aSubsessionContext) const;
       
   152 		void NextComponentSetDataL(const RMessage2& aMessage, RPointerArray<CComponentEntry>& aEntryList) const;
       
   153 		
       
   154 		// Files's list operations
       
   155 		CStatement* OpenFileListL(const RMessage2& aMessage) const; 	 
       
   156 		void NextFileSizeL(const RMessage2& aMessage, CStatement* aStmt, HBufC*& aFilePath) const;
       
   157 		void NextFileDataL(const RMessage2& aMessage, HBufC*& aFilePath) const;
       
   158 		void NextFileSetSizeL(const RMessage2& aMessage, CStatement* aStmt, RPointerArray<HBufC>& aFileList) const;
       
   159 		void NextFileSetDataL(const RMessage2& aMessage, RPointerArray<HBufC>& aFileList) const;
       
   160 		
       
   161 		// Static utility functions - code reuse between SCRServer and this class
       
   162 		static TComponentId GetComponentIdFromMsgL(const RMessage2& aMessage);
       
   163 		static HBufC* GetSoftwareTypeNameFromMsgLC(const RMessage2& aMessage);
       
   164 		static HBufC* ReadFileNameFromMsgLC(const RMessage2& aMessage);
       
   165 		
       
   166 		// Sofwtare type management operations
       
   167 		void AddSoftwareTypeL(const RMessage2& aMessage);
       
   168 		void DeleteSoftwareTypeL(const RMessage2& aMessage);
       
   169 		void GetDeletedMimeTypesL(const RMessage2& aMessage) const;
       
   170 		
       
   171 		// AppInfo's view operations
       
   172 		//CAppRegistrySubsession
       
   173         void OpenApplicationRegistrationViewL(const RMessage2& aMessage, CAppRegistrySubsessionContext*  aSubsessionContext);
       
   174         void OpenApplicationRegistrationForAppUidsViewL(const RMessage2& aMessage, CAppRegistrySubsessionContext*  aSubsessionContext);
       
   175         void NextApplicationRegistrationInfoSizeL(const RMessage2& aMessage, CApplicationRegistrationData*& aApplicationRegistration, CAppRegistrySubsessionContext*  aSubsessionContext);
       
   176         void NextApplicationRegistrationInfoDataL(const RMessage2& aMessage, CApplicationRegistrationData*& aApplicationRegistration);
       
   177         
       
   178 		//CAppInfoViewSubsession
       
   179         CAppInfoFilter* ReadAppInfoFilterL(const RMessage2& aMessage) const;
       
   180         void OpenAppInfoViewL(CAppInfoFilter& aFilter, CAppInfoViewSubsessionContext* aSubsessionContext);
       
   181         TBool DoesAppWithScreenModeExistL(TUid aUid, TInt aScreenMode, TLanguage aLocale) const;
       
   182         void GetAppUidsL(CAppInfoViewSubsessionContext* aSubsessionContext, TBool aScreenModePresent = EFalse) const;
       
   183         void GetEmbeddableAppUidsL(CAppInfoViewSubsessionContext* aSubsessionContext, TBool aScreenModePresent = EFalse) const;
       
   184         void GetServerAppUidsL(CAppInfoViewSubsessionContext* aSubsessionContext, TUid aServiceUid, TBool aScreenModePresent = EFalse) const;
       
   185         void GetAppUidsWithEmbeddabilityFilterL(CAppInfoViewSubsessionContext* aSubsessionContext, TEmbeddableFilter& aFilter, TBool aScreenModePresent = EFalse) const;
       
   186         void GetAppUidsWithCapabilityMaskAndValueL(CAppInfoViewSubsessionContext* aSubsessionContext,TUint aCapabilityAttrFilterMask, TUint aCapabilityAttrFilterValue, TBool aScreenModePresent = EFalse) const;
       
   187         void GetAppServicesL(TUid aAppUid, RPointerArray<CServiceInfo>& aServiceInfoArray, TLanguage aLocale) const;
       
   188         void GetServiceImplementationsL(TUid aServiceUid, RPointerArray<CServiceInfo>& aServiceInfoArray, TLanguage aLocale) const;
       
   189         void GetServiceImplementationsL(TUid aServiceUid, TDesC& aDataType, RPointerArray<CServiceInfo>& aServiceInfoArray, TLanguage aLocale) const;
       
   190         void GetAppServiceOpaqueDataL(TUid aAppUid, TUid aServiceUid, RPointerArray<CServiceInfo>& aServiceInfoArray, TLanguage aLocale) const;
       
   191         void GetOpaqueDataArrayL(TUid aAppUid, TUid aServiceUid, RPointerArray<COpaqueData>& aOpaqueDataArray, TLanguage aLanguage) const;
       
   192         void NextAppInfoSizeL(const RMessage2& aMessage, TAppRegInfo*& aAppInfo, CAppInfoViewSubsessionContext* aSubsessionContext);
       
   193         void NextAppInfoDataL(const RMessage2& aMessage, TAppRegInfo*& aAppInfo);
       
   194 
       
   195         //CRegInfoForApplicationSubsession
       
   196         void GetServiceUidSizeL(const RMessage2& aMessage, TUid aAppUid,CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   197         void GetServiceUidDataL(const RMessage2& aMessage, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   198         void SetLocaleForRegInfoForApplicationSubsessionContextL(const RMessage2& aMessage, CRegInfoForApplicationSubsessionContext *aSubsessionContext);
       
   199         void GetApplicationLanguageL(const RMessage2& aMessage, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   200         void GetDefaultScreenNumberL(const RMessage2& aMessage, TUid aAppUid) const;
       
   201         void GetNumberOfOwnDefinedIconsL(const RMessage2& aMessage, TUid aAppUid,CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   202         void GetViewSizeL(const RMessage2& aMessage, TUid aAppUid, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   203         void GetViewDataL(const RMessage2& aMessage, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   204         void GetViewsL(RPointerArray<Usif::CAppViewData>& aViewInfoArray,TUid aAppUid, TLanguage aLanguage)const;
       
   205         void GetAppOwnedFilesSizeL(const RMessage2& aMessage, TUid aAppUid, CRegInfoForApplicationSubsessionContext *aSubsessionContext)const ;
       
   206         void GetAppOwnedFilesDataL(const RMessage2& aMessage, CRegInfoForApplicationSubsessionContext *aSubsessionContext)const ;
       
   207         void GetAppCharacteristicsL(const RMessage2& aMessage, TUid aAppUid) const;
       
   208         void GetAppIconForFileNameL(const RMessage2& aMessage, TUid aAppUid, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   209         void GetAppViewIconFileNameL(const RMessage2& aMessage, TUid aAppUid, CRegInfoForApplicationSubsessionContext *aSubsessionContext) const;
       
   210 		void GetAppPropertiesInfoL(CApplicationRegistrationData& aApplicationRegistrationaApplicationRegistration,TUid aAppUid, TLanguage aLanguage);
       
   211 		//CApplicationRegInfoSubsession
       
   212         void GetAppForDataTypeAndServiceL(const RMessage2& aMessage) const;
       
   213         void GetAppForDataTypeL(const RMessage2& aMessage) const;
       
   214         void GetAppServiceInfoSizeL(const RMessage2& aMessage, CApplicationRegInfoSubsessionContext *aSubsessionContext) const;
       
   215         void GetAppServiceInfoDataL(const RMessage2& aMessage, CApplicationRegInfoSubsessionContext *aSubsessionContext) const;
       
   216         void GetApplicationInfoL(const RMessage2& aMessage);
       
   217         
       
   218         //General functions to retrieve various application information, mostly used by CAppRegistrySubsession
       
   219         TBool GetApplicationRegistrationInfoL(CApplicationRegistrationData& aApplicationRegistrationaApplicationRegistration,TUid aAppUid) const;
       
   220         void GetFileOwnershipInfoL(CApplicationRegistrationData& aApplicationRegistrationaApplicationRegistration,TUid aAppUid) const;
       
   221         void GetDataTypesL(RPointerArray<Usif::CDataType> & aDataTypes,TInt aServiceId)const;
       
   222         void GetServiceInfoL(CApplicationRegistrationData& aApplicationRegistrationaApplicationRegistration,TUid aAppUid,TLanguage aLanguage) const;
       
   223         void GetLocalizableAppInfoL(CApplicationRegistrationData& aApplicationRegistrationaApplicationRegistration,TUid aAppUid, TLanguage aLanguage);
       
   224         CCaptionAndIconInfo* GetCaptionAndIconInfoL(TInt aCaptionAndIconId)const;
       
   225         void GetAppRegOpaqueDataL(CApplicationRegistrationData& aApplicationRegistration,TUid aAppUid,TLanguage aLanguage) const;
       
   226         
       
   227         //General functions
       
   228 		void GetLocalesForAppIdL(RArray<TInt>& aLocales, TUid aAppUid) const;
       
   229 		TBool CheckIfAppUidExistsL(const TUid aAppUid) const;
       
   230         CStatement* CreateStatementForAppInfoL(const TDesC& aStatement, TLanguage aLocale, TInt aValuesNum,...) const;
       
   231         void GetCaptionAndShortCaptionInfoForLocaleL(TUid aAppUid, TLanguage aLocale, TAppCaption& aShortCaption, TAppCaption& aCaption);
       
   232         void GenerateNonNativeAppUidL(const RMessage2& aMessage);
       
   233 
       
   234 		//Application related
       
   235 		void AddApplicationEntryL(const RMessage2& aMessage);		
       
   236 		void DeleteAllAppsWithinPackageL(const RMessage2& aMessage);
       
   237 		void DeleteAllAppsWithinPackageInternalL(const TComponentId aComponentId);
       
   238 		void DeleteApplicationEntryL(const RMessage2& aMessage);
       
   239 		void DeleteApplicationEntryInternalL(const TInt aAppUid);
       
   240 		void GetComponentIdForAppL(const RMessage2& aMessage) const;
       
   241 	    TBool GetComponentIdForAppInternalL(TUid aAppUid, TComponentId& aComponentId) const;
       
   242 		void GetAppUidsForComponentSizeL(const RMessage2& aMessage) const;
       
   243 		void GetAppUidsForComponentDataL(const RMessage2& aMessage)const; 
       
   244 
       
   245 		void AddFileOwnershipInfoL(TUid aAppUid, const TDesC& aFileName);
       
   246 		void AddServiceInfoL(TUid aAppUid, CServiceInfo*  aAppServiceInfoEntry);
       
   247 		void AddServiceDataTypeL(TInt aServiceUid, Usif::CDataType* aDataTypeEntry);
       
   248 		void AddLocalizableAppInfoL(TUid aAppUid, Usif::CLocalizableAppInfo* aLocalizableAppInfoEntry);
       
   249 		void AddViewDataL(TInt aLocalAppInfoId, Usif::CAppViewData* aViewDataEntry);
       
   250 		TInt AddCaptionAndIconInfoL(CCaptionAndIconInfo* aCaptionAndIconEntry);
       
   251 		void AddPropertyL(TUid aAppUid, Usif::CPropertyEntry* aAppPropertiesEntry);
       
   252 		void AddOpaqueDataL(TUid aAppUid, Usif::COpaqueData*  aOpaqueDataEntry, TUid aServiceUid = TUid::Null());
       
   253 		void DeleteFromTableL(const TDesC& aTableName, const TDesC& aAttribute, const TInt aValue);		
       
   254 	private:
       
   255 		CScrRequestImpl(RFs& aFs);
       
   256 		void ConstructL(RFile& aDatabaseFile, RFile& aJournalFile);
       
   257 	
       
   258 	private:
       
   259 		enum TValueType
       
   260 			{
       
   261 			EValueInteger 	 = 0x01,
       
   262 			EValueString 	 = 0x02,
       
   263 			EValueInteger64  = 0x03,
       
   264 			EValueLanguage   = 0x04,
       
   265 			EValueBinary = 0x05,
       
   266 			};
       
   267 		
       
   268 		enum TPropertyType
       
   269 			{
       
   270 			EPropertyUndefined = 0,	  // The property type is not defined yet
       
   271 			EPropertyInteger   = 1,   // The property type is integer
       
   272 			EPropertyLocalizable    = 2,    // The property type is a localizable string
       
   273 			EPropertyBinary    = 3    // The property type is a non-localizable 8-bit descriptor
       
   274 			};
       
   275 		
       
   276 		enum TFileOperationType
       
   277 			{
       
   278 			EFileRegistered,
       
   279 			EFileUnregistered
       
   280 			};
       
   281 		
       
   282 		class TRollbackParams
       
   283 			{
       
   284 		public:
       
   285 			TRollbackParams(TInt aIdColumnVal, CScrRequestImpl& aReqImplHandle)
       
   286 				: iIdColumnVal(aIdColumnVal), iReqImplHandle(aReqImplHandle){}
       
   287 		
       
   288 			TInt iIdColumnVal;
       
   289 			CScrRequestImpl& iReqImplHandle;
       
   290 			};
       
   291 		
       
   292 	    static HBufC* ReadDescLC(const RMessage2& aMessage, TInt aSlot);
       
   293 	    static HBufC8* ReadDesc8LC(const RMessage2& aMessage, TInt aSlot);
       
   294 		static TUint32 HashCaseInsensitiveL(const TDesC& aName);
       
   295 		static TUint32 HashCaseSensitiveL(const TDesC& aName);
       
   296 		static void ComponentRollback(TAny* aParam);
       
   297 		static void ComponentLocalizablesRollback(TAny* aParam);
       
   298 		
       
   299 		HBufC* FormatStatementLC(const TDesC& aStatement, TInt aFormatLength,...) const;
       
   300 		HBufC* GenerateGlobalIdL(const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId) const;
       
   301 		TComponentId CommonAddComponentL(const TDesC& aUniqueSwTypeName, const TDesC& aGlobalId);
       
   302 		void AddComponentLocalizablesL(TComponentId aCompId, TLanguage aLocale, const TDesC& aName, const TDesC& aVendor);
       
   303 		HBufC* ReadAndGetGlobalIdLC(const RMessage2& aMessage, TInt aSlot) const;
       
   304 		TUint32 ReadAndHashGlobalIdL(const RMessage2& aMessage, TInt aGlobalIdNameSlot, TInt aSwTypeNameSlot) const;
       
   305 		TUint32 HashGlobalIdsL(const TDesC& aDependantId, const TDesC& aSupplierId) const;		
       
   306 		CStatement* CreateGeneralPropertyStatementWithLocaleL(const TDesC& aStmtStr, TInt aIdColumnValue, TLanguage aLocale, const TDesC& aPropName, TBool aDoLocaleResolving=ETrue) const;
       
   307 		TInt FindGeneralPropertyNoLocaleDowngradeL(const TDesC& aTableName, const TDesC& aIdColumnName , TInt aIdColumnValue, const TDesC& aPropertyName, TLanguage aLocale, TPropertyType& aPropertyType) const;
       
   308 		void SetGeneralLocalizablePropertyL(CScrRequestImpl::TPropertyType aPropType, TInt aPropertyId, const TDesC& aIdColumnName , TInt aIdColumnValue, const TDesC& aPropName, TLanguage aLocale, const TDesC& aPropValue);
       
   309 		void SetGeneralBinaryPropertyL(CScrRequestImpl::TPropertyType aPropType, TInt aPropertyId, const TDesC& aTableName, const TDesC& aIdColumnName , TInt aIdColumnValue, const TDesC& aPropName, const TDesC8& aPropValue);
       
   310 		void SetGeneralIntPropertyL(TPropertyType aPropType, TInt aPropertyId, const TDesC& aTableName, const TDesC& aIdColumnName , TInt aIdColumnValue, const TDesC& aPropName, TInt64 aPropValue);
       
   311 		void ExecuteStatementL(TRefByValue<const TDesC>, TInt aValuesNum=0,...);
       
   312 		void GetFileComponentsL(const TDesC& aFileName, RArray<TComponentId>& aComponents) const;
       
   313 		TInt GetComponentFileIdL(const TDesC& aFileName, TComponentId aComponentId) const;
       
   314 		TInt FindComponentFileL(const TDesC& aFileName, TComponentId aComponentId) const;
       
   315 		void SetComponentLocalizableL(TComponentId aComponentId, TLanguage aLocale, const TDesC& aColumnName, const TDesC& aName, const TDesC& aVendor);
       
   316 		CPropertyEntry* GetGeneralSinglePropertyL(const TDesC& aTableName, const TDesC& aIdColumnName , TInt aIdColumnValue, const TDesC& aPropName, TLanguage aLocale) const;
       
   317 		CPropertyEntry* GetPropertyEntryL(CStatement& aStmt, const TDesC& aPropName, TInt aStartingIndex) const;
       
   318 		void AddGeneralPropertiesArrayWithLocaleL(const TDesC& aStmtStr, TLanguage aLocale, TComponentId aIdColumnValue, RPointerArray<CPropertyEntry>& aProperties) const;
       
   319 		void GetGeneralPropertiesArrayL(const TDesC& aTableName, const TDesC& aIdColumnName , TComponentId aIdColumnValue, TLanguage aLocale, RPointerArray<CPropertyEntry>& aProperties) const;
       
   320 		TBool BindAndProcessStatementObjectL(CStatement& aStatementObj, TLanguage aLanguage, TInt aValuesNum, VA_LIST aList) const;
       
   321 		CStatement* CreateStatementObjectWithoutLocaleL(const TDesC& aStatement, TInt aValuesNum,...) const;		
       
   322 		CStatement* CreateStatementObjectWithLocaleL(const TDesC& aStatement, TLanguage aLocale, TInt aValuesNum,...) const;
       
   323 		CStatement* CreateStatementObjectWithLocaleNoDowngradeL(const TDesC& aStatement, TLanguage aLocale, TInt aValuesNum,...) const;
       
   324 		void BindStatementValuesL(CStatement& aStatement, TLanguage aLanguage, TInt aValuesNum, VA_LIST aList) const;
       
   325 		void GetComponentIdsHavingThePropertiesL(RArray<TComponentId>& aComponentIds, RPointerArray<CPropertyEntry>& aProperties, RArray<CComponentFilter::TPropertyOperator>& aPropertyOperatorList, 
       
   326                                                      TBool aDoIntersect) const;
       
   327 		CStatement* CreateStatementObjectForComponentLocalizablesLC(const TDesC& aName, const TDesC& aVendor, TUint aSetFlag, TComponentId aComponentId  = 0 ) const;
       
   328 		void GetComponentsHavingNameVendorL(RArray<TComponentId>& aComponentIds, const TDesC& aName, const TDesC& aVendor, TUint16 aSetFlag, TBool aDoIntersect) const;
       
   329 		CComponentEntry* GetNextComponentEntryL(CStatement& aStmt, CComponentFilter& aFilter, TLanguage aLocale, CCompViewSubsessionContext* aSubsessionContext) const;
       
   330 		HBufC* GetNextFilePathL(CStatement& aStmt) const;
       
   331 		CComponentEntry* CreateComponentEntryFromStatementHandleL(CStatement& aStmt) const;
       
   332 		CStatement* ExecuteLocalizableStatementL(const TDesC& aLocalizableStmtStr, const TDesC& aAnyValueStmtStr, TInt aConditionIntValue, TLanguage aConditionLocale) const;
       
   333 		void AddComponentEntryLocalizablesL(TComponentId aComponentId, CComponentEntry& aEntry, TLanguage aLocale) const;
       
   334 		void AddComponentEntryLocalizablesL(TComponentId aComponentId, CComponentEntry& aEntry, TLanguage aLocale, const CComponentFilter& aFilter) const;
       
   335 		void AddSoftwareTypeNameToComponentEntryL(CStatement& aStmt, CComponentEntry& aEntry, TLanguage aLocale) const;
       
   336 		TBool IsSoftwareTypeExistingL(TInt aSoftwareTypeId) const;
       
   337 		void GetGeneralComponentEntrySizeL(const RMessage2& aMessage, const TDesC& aConditionColumn, TUint32 aConditionValue, TInt aReturnSizeSlot, TLanguage aLocale, CComponentEntry*& aComponentEntry) const;
       
   338         TInt GetDriveFromFilePath(const TDesC& aFilePath, TDriveUnit& aDriveUnit) const;
       
   339 		TInt InstalledDrivesToBitmaskL(const TDriveList& aDriveList) const;
       
   340 		void UpdateInstalledDrivesL(TComponentId aComponentId, const TDesC& aFilePath, TFileOperationType aType);
       
   341 		TBool GetSifPluginUidIInternalL(TInt aSoftwareTypeId, TInt& aValue) const;
       
   342 		TInt GetInstalledDrivesBitmaskL(TComponentId aComponentId) const;
       
   343 		CGlobalComponentId* ParseGlobalComponendIdLC(const TDesC& aGlobalId) const;
       
   344 		void GetGeneralDependencyListL(const TDesC& aSelectColumn, const TDesC& aConditionColumn, const TDesC& aConditionValue, RPointerArray<CVersionedComponentId> &aVerCompIdList) const;
       
   345 		void ReadAndSetCommonComponentPropertyL(const RMessage2& aMessage, const TDesC& aPropertyColumn);
       
   346 		TBool HasFilesOnDriveL(TDriveUnit aDrive, TComponentId aComponentId);
       
   347 		CStatement* OpenFileListStatementL(TComponentId aComponentId) const;
       
   348 		TBool IsSoftwareTypeExistingL(TUint32 aSwTypeId, TUint32 aSifPluginUid, RArray<TCustomAccessInfo>& aSidArray, const RPointerArray<HBufC>& aMimeTypesArray, const RPointerArray<CLocalizedSoftwareTypeName>& aLocalizedNamesArray, const TDesC& aLauncherExecutable);
       
   349 		void SubsessionAddLocalizableSoftwareTypeNameL(CStatement& aStmt, CComponentEntry& aEntry, TLanguage aLocale, CCompViewSubsessionContext* aSubsessionContext) const;
       
   350 		TBool IsDriveReadOnlyL(TInt driveIndex) const;
       
   351 		TBool CheckForMediaPresenceL(TComponentId aComponentId) const;
       
   352 		
       
   353 		TBool GetIntforConditionL(const TDesC& aSelectColumn, const TDesC& aTableInfo, const TDesC& aConditionColumn,TInt aConditionValue,TInt& aRetrievedValue) const;
       
   354 		TInt  GetServiceIdForDataTypeL(const TDesC& aType) const;
       
   355 		TBool GetAppUidForServiceIdL(const TInt ServiceId, TUid& aAppUid) const;
       
   356 		TBool GetNearestAppLanguageL(TLanguage aRequiredLocale,TUid aAppUid,TLanguage& aFinalAppLocale) const;
       
   357 		void GetNearestAppLanguageForOpaqueDataL(TLanguage aRequiredLocale,TUid aAppUid,TUid aServiceUid,TLanguage& aFinalAppLocale) const;
       
   358 		void GetOperatorStringL(CComponentFilter::TDbOperator aOperator, HBufC*& aOperatorString) const;
       
   359 
       
   360 		// DB Version management
       
   361 		void InitializeDbVersionL();
       
   362 		void VerifyDbVersionCompatibilityL() const;
       
   363 		
       
   364 	private:
       
   365 		RFs& iFs;	///< Reference to the file handle. It is worth to consume a word of memory instead of passing the file handle to many functions.
       
   366 		CDatabase* iDbHandle; ///< Handle to the SCR database object.
       
   367 		TVersion iDbVersion;
       
   368 		mutable CComponentEntry* iComponentEntry; 			///< The component entry whose size calculated and sent to the client.
       
   369 		mutable CPropertyEntry* iSingleProperty;
       
   370 		mutable RArray<TComponentId> iFileComponents;
       
   371 		mutable RArray<TComponentId> iComponentIdList;
       
   372 		mutable RPointerArray<CPropertyEntry> iProperties;
       
   373 		mutable RPointerArray<CVersionedComponentId> iVerCompIdList; // The list of supplier/dependant versioned component IDs
       
   374 		mutable RPointerArray<HBufC> iDeletedMimeTypes; // The list of MIME types deleted as the result of software type deletion.
       
   375 		mutable RPointerArray<CScrLogEntry> iLogEntries; // The list of log entries recorded in a session
       
   376 		mutable RArray<TLanguage> iMatchingSupportedLanguageList; // The list of matching supported language list recorded in a session
       
   377 		mutable RPointerArray<CLocalizableComponentInfo> iCompLocalizedInfoArray; //Component's localized information (name, vendor, locale)
       
   378 		mutable RArray<TUid> iComponentAppUids;  //List of Application Uids associated with a component
       
   379 		mutable RPointerArray<CLauncherExecutable> iLaunchers;
       
   380 		};
       
   381 	
       
   382 	} // End of namespace Usif
       
   383 
       
   384 #endif /* SCRREQUESTIMPL_H */