Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__DATASTOR_H__)
17 #define __DATASTOR_H__
19 #if !defined(__E32BASE_H__)
23 #if !defined(__S32FILE_H__)
26 #if !defined(__APMSTD_H__)
36 const TUid KUidDatastor = {0x1000071E};
41 const TUid KUidDatastorSettings = {0x10000790};
46 _LIT(KIniFileName,":\\private\\10003a3f\\Dtstor.ini");
52 class TMappingDataTypeToApp
55 IMPORT_C TMappingDataTypeToApp();
56 IMPORT_C TMappingDataTypeToApp(const TDataType& aDataType,
57 TDataTypePriority aPriority, TUid aAppUid);
58 IMPORT_C TMappingDataTypeToApp(const TDataType& aDataType,
59 TDataTypePriority aPriority, TUid aAppUid, TUid aServiceUid);
60 IMPORT_C void InternalizeL(RReadStream& aStream);
61 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
64 TDataTypePriority iPriority;
65 TUid iAppUid; // Uid [2] of the target application
69 /** A store of mappings between data types, the UIDs of applications that
70 can handle them and the priority at which the application handles them.
75 class CTypeStoreManager : public CBase
78 IMPORT_C static CTypeStoreManager* NewL(RFs& aFs);
79 IMPORT_C ~CTypeStoreManager();
81 IMPORT_C void StoreL();
82 IMPORT_C void RestoreL();
83 IMPORT_C void InternalizeL(RReadStream& aStream);
84 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
86 IMPORT_C void GetAppByDataType(const TDataType& aDataType, TUid& aUid) const;
87 IMPORT_C void GetAppByDataType(const TDataType& aDataType,
88 TUid aServiceUid, TUid& aUid) const;
89 IMPORT_C void GetDataTypesByAppL(TUid aUid, CArrayFix<TDataType>* aTypeArray) const;
90 IMPORT_C const CArrayFixFlat<TMappingDataTypeToApp>& MappingArray() const;
92 IMPORT_C void InsertDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
93 IMPORT_C void InsertDataMappingL(const TDataType& aDataType,
94 TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
95 IMPORT_C TBool InsertIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
96 IMPORT_C TBool InsertIfHigherL(const TDataType& aDataType,
97 TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
98 IMPORT_C void DeleteDataMapping(const TDataType& aDataType);
99 IMPORT_C void DeleteDataMapping(const TDataType& aDataType,
101 inline TPtrC IniFileName() const;
102 IMPORT_C void InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
103 IMPORT_C void InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
104 IMPORT_C TBool InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
105 IMPORT_C TBool InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
106 IMPORT_C void DeleteAndStoreDataMappingL(const TDataType& aDataType);
107 IMPORT_C void DeleteAndStoreDataMappingL(const TDataType& aDataType, TUid aServiceUid);
108 IMPORT_C TBool DeleteApplicationDataMappings(const TUid aAppUid);
111 CDictionaryStore* OpenIniFileLC() const;
112 CTypeStoreManager(RFs& aFs);
113 TInt FindDataMapping(const TDataType& aDataType, const TUid& aServiceUid) const;
116 CArrayFixFlat<TMappingDataTypeToApp> iAppMappings;
121 inline TPtrC CTypeStoreManager::IniFileName() const