mtpfws/mtpfw/inc/cmtppkgidstore.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2007-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 #ifndef CMTPPKGIDSTORE_H
       
    17 #define CMTPPKGIDSTORE_H  
       
    18 /** 
       
    19 Implements the MTP package ID store interface.
       
    20 @internalComponent
       
    21  
       
    22 */
       
    23 //#include <e32base.h>
       
    24 #include <d32dbms.h>
       
    25 #include "mtpframeworkconst.h"
       
    26 
       
    27 class RDbDatabase;
       
    28 
       
    29 /**
       
    30  * Mapping of Installed data provider <sis package id, dp id>
       
    31  */
       
    32 class CMTPPkgIDStore :  public CBase        
       
    33     {
       
    34 public:   
       
    35     static CMTPPkgIDStore* NewL(RDbDatabase& aDatabase);    
       
    36     ~CMTPPkgIDStore();
       
    37 
       
    38 public:     
       
    39     void InsertPkgIdL(TUint aDpId, TUint aPkgId);
       
    40     const RArray<TUint>& DPIDL() const;
       
    41     TUint PKGIDL (TUint aIndex) const;
       
    42     TInt  RemoveL(TUint aDpId);
       
    43 
       
    44 private: 
       
    45     enum TPkgIDStore
       
    46         {
       
    47         EPkgIDStoreDataProviderId   = 1,
       
    48         EPkgIDStorePKGID            = 2
       
    49         };   
       
    50     CMTPPkgIDStore(RDbDatabase& aDatabase);
       
    51     void CreatePkgIDStoreTableL();
       
    52     void ConstructL();   
       
    53 private:
       
    54     RDbDatabase&  iDatabase;   
       
    55     mutable TBuf<KMTPMaxSqlStatementLen> iSqlStatement;   
       
    56     RArray<TUint> iDPIDs;
       
    57     RArray<TUint> iPkgIDs;
       
    58     };
       
    59     
       
    60 #endif // CMTPPKGIDSTORE_H