1.1 --- a/epoc32/include/datastor.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,126 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#if !defined(__DATASTOR_H__)
1.20 -#define __DATASTOR_H__
1.21 -
1.22 -#if !defined(__E32BASE_H__)
1.23 -#include <e32base.h>
1.24 -#endif
1.25 -
1.26 -#if !defined(__S32FILE_H__)
1.27 -#include <s32file.h>
1.28 -#endif
1.29 -#if !defined(__APMSTD_H__)
1.30 -#include <apmstd.h>
1.31 -#endif
1.32 -
1.33 -class RReadStream;
1.34 -class RWriteStream;
1.35 -
1.36 -/**
1.37 -@internalComponent
1.38 -*/
1.39 -const TUid KUidDatastor = {0x1000071E};
1.40 -
1.41 -/**
1.42 -@internalComponent
1.43 -*/
1.44 -const TUid KUidDatastorSettings = {0x10000790};
1.45 -
1.46 -/**
1.47 -@internalComponent
1.48 -*/
1.49 -_LIT(KIniFileName,":\\private\\10003a3f\\Dtstor.ini");
1.50 -
1.51 -/**
1.52 -@internalTechnology
1.53 -@released
1.54 -*/
1.55 -class TMappingDataTypeToApp
1.56 - {
1.57 -public:
1.58 - IMPORT_C TMappingDataTypeToApp();
1.59 - IMPORT_C TMappingDataTypeToApp(const TDataType& aDataType,
1.60 - TDataTypePriority aPriority, TUid aAppUid);
1.61 - IMPORT_C TMappingDataTypeToApp(const TDataType& aDataType,
1.62 - TDataTypePriority aPriority, TUid aAppUid, TUid aServiceUid);
1.63 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.64 - IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
1.65 -public:
1.66 - TDataType iDataType;
1.67 - TDataTypePriority iPriority;
1.68 - TUid iAppUid; // Uid [2] of the target application
1.69 - TUid iServiceUid;
1.70 - };
1.71 -
1.72 -/** A store of mappings between data types, the UIDs of applications that
1.73 -can handle them and the priority at which the application handles them.
1.74 -
1.75 -@internalTechnology
1.76 -@released
1.77 -*/
1.78 -class CTypeStoreManager : public CBase
1.79 - {
1.80 -public:
1.81 - IMPORT_C static CTypeStoreManager* NewL(RFs& aFs);
1.82 - IMPORT_C ~CTypeStoreManager();
1.83 - // Persistence
1.84 - IMPORT_C void StoreL();
1.85 - IMPORT_C void RestoreL();
1.86 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.87 - IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
1.88 - // Enquiry
1.89 - IMPORT_C void GetAppByDataType(const TDataType& aDataType, TUid& aUid) const;
1.90 - IMPORT_C void GetAppByDataType(const TDataType& aDataType,
1.91 - TUid aServiceUid, TUid& aUid) const;
1.92 - IMPORT_C void GetDataTypesByAppL(TUid aUid, CArrayFix<TDataType>* aTypeArray) const;
1.93 - IMPORT_C const CArrayFixFlat<TMappingDataTypeToApp>& MappingArray() const;
1.94 - // Management
1.95 - IMPORT_C void InsertDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
1.96 - IMPORT_C void InsertDataMappingL(const TDataType& aDataType,
1.97 - TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
1.98 - IMPORT_C TBool InsertIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
1.99 - IMPORT_C TBool InsertIfHigherL(const TDataType& aDataType,
1.100 - TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
1.101 - IMPORT_C void DeleteDataMapping(const TDataType& aDataType);
1.102 - IMPORT_C void DeleteDataMapping(const TDataType& aDataType,
1.103 - TUid aServiceUid);
1.104 - inline TPtrC IniFileName() const;
1.105 - IMPORT_C void InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
1.106 - IMPORT_C void InsertAndStoreDataMappingL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
1.107 - IMPORT_C TBool InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid);
1.108 - IMPORT_C TBool InsertAndStoreIfHigherL(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TUid aServiceUid);
1.109 - IMPORT_C void DeleteAndStoreDataMappingL(const TDataType& aDataType);
1.110 - IMPORT_C void DeleteAndStoreDataMappingL(const TDataType& aDataType, TUid aServiceUid);
1.111 - IMPORT_C TBool DeleteApplicationDataMappings(const TUid aAppUid);
1.112 -
1.113 -private:
1.114 - CDictionaryStore* OpenIniFileLC() const;
1.115 - CTypeStoreManager(RFs& aFs);
1.116 - TInt FindDataMapping(const TDataType& aDataType, const TUid& aServiceUid) const;
1.117 - void ConstructL();
1.118 -private:
1.119 - CArrayFixFlat<TMappingDataTypeToApp> iAppMappings;
1.120 - RFs& iFs;
1.121 - RBuf iIniFileName;
1.122 - };
1.123 -
1.124 -inline TPtrC CTypeStoreManager::IniFileName() const
1.125 - {
1.126 - return iIniFileName;
1.127 - }
1.128 -
1.129 -#endif