phonebookengines/cntmaptileservice/inc/cntmaptiledblookuptable.h
changeset 46 efe85016a067
parent 25 76a2435edfd4
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
    21 
    21 
    22 //Headers needed
    22 //Headers needed
    23 #include <f32file.h> //RFs
    23 #include <f32file.h> //RFs
    24 #include <d32dbms.h>  //RDbNamedDatabase,RDbView 
    24 #include <d32dbms.h>  //RDbNamedDatabase,RDbView 
    25 
    25 
       
    26 #include "cntmaptileservice.h"
       
    27 
    26 // maptile database column names
    28 // maptile database column names
    27 _LIT( NCntColUid, "cntuid" );
    29 _LIT( NCntColUid, "cntuid" );
    28 _LIT( NCntColFilePath, "filepath" );
    30 _LIT( NCntColFilePath, "filepath" );
    29 _LIT( NColSource, "source" );
    31 _LIT( NColSource, "source" );
       
    32 _LIT( NColMaptileStatus, "fetchingstatus" );
    30 
    33 
    31 // maptile lookup database name
    34 // maptile lookup database name
    32 _LIT( KMapTileLookupDatabaseName, "mylocationsmaptilelookup.db" );
    35 _LIT( KMapTileLookupDatabaseName, "mylocationsmaptilelookup.db" );
    33 
    36 
    34 // maptile database table name
    37 // maptile database table name
    38 
    41 
    39 // uid column number
    42 // uid column number
    40 const TInt KColumncntUid = 1;
    43 const TInt KColumncntUid = 1;
    41 // source type column number
    44 // source type column number
    42 const TInt KColumnSource = 2;
    45 const TInt KColumnSource = 2;
    43 // source type column number
    46 // maptile image path column number
    44 const TInt KColumnFilePath = 3;
    47 const TInt KColumnFilePath = 3;
       
    48 // maptile status column number
       
    49 const TInt KColumnMapTileFetchingStatus = 4;
    45 
    50 
    46 
    51 
    47 /**
    52 /**
    48  *  Maptile database lookup entry
    53  *  Maptile database lookup entry
    49  */
    54  */
    54     TUint32 iUid; 
    59     TUint32 iUid; 
    55     
    60     
    56     // Source type
    61     // Source type
    57     TUint32 iSource;
    62     TUint32 iSource;
    58     
    63     
    59     // Landmark uid in the landmarks database
       
    60     TUint32 iLmId;
       
    61     
       
    62     // Uid of the Contact
       
    63     TUint32 icntUid; 
       
    64     
       
    65     // File Path
    64     // File Path
    66     TFileName iFilePath;
    65     TFileName iFilePath;
    67 };
    66     
    68 
    67     //Map tile fetching status
    69 /**
    68     TUint32 iFetchingStatus;    
    70  *  Defines uid source type
       
    71  */
       
    72 enum TUidSourceType
       
    73 {
       
    74     /** Uid Source type contacts default/prefered address */
       
    75     ESourceContactsPref  = 3,
       
    76     /** Uid Source type contacts work address */
       
    77     ESourceContactsWork,
       
    78     /** Uid Source type contacts home address */
       
    79     ESourceContactsHome,
       
    80 };
    69 };
    81 
    70 
    82 /**
    71 /**
    83  * CLookupMapTileDatabase class.
    72  * CLookupMapTileDatabase class.
    84  * This class handles all the operations related to maptile lookup database.
    73  * This class handles all the operations related to maptile lookup database.
   110     * Finds an entry in the lookup table.
    99     * Finds an entry in the lookup table.
   111     * @param[in/out] aLookupItem The lookup item to be found in the database.
   100     * @param[in/out] aLookupItem The lookup item to be found in the database.
   112     * The source iUid is passed in the lookup item
   101     * The source iUid is passed in the lookup item
   113     */
   102     */
   114     void FindEntryL( TLookupItem& aLookupItem );
   103     void FindEntryL( TLookupItem& aLookupItem );
       
   104     
       
   105    /**
       
   106     * Finds number of address associated with an contact id.
       
   107     * @param[in] aId The contact id .
       
   108     * @return Number of address a contact has.
       
   109     */
       
   110     int FindNumberOfAddressL( int& aId );
   115 
   111 
       
   112 #ifdef CNTMAPTILESERVICE_UNIT_TEST
       
   113 public:
       
   114 #else     
   116 private:
   115 private:
   117     
   116 #endif  
   118     // default constructor
   117     // default constructor
   119     CLookupMapTileDatabase();
   118     CLookupMapTileDatabase();
   120     
   119     
   121     // Second phase constructor
   120     // Second phase constructor
   122     void ConstructL( const TDesC& aLookupTableName );
   121     void ConstructL( const TDesC& aLookupTableName );
       
   122 
   123     
   123     
       
   124 #ifdef CNTMAPTILESERVICE_UNIT_TEST
       
   125 public:
       
   126 #else     
   124 private:
   127 private:
       
   128 #endif  
   125     
   129     
   126     // Handle to the items database
   130     // Handle to the items database
   127     RDbNamedDatabase iItemsDatabase;
   131     RDbNamedDatabase iItemsDatabase;
   128     
   132     
   129     // handle to the file session
   133     // handle to the file session
   135     // holds the info about database existence.
   139     // holds the info about database existence.
   136     TBool iDatabaseExists;
   140     TBool iDatabaseExists;
   137 
   141 
   138 };
   142 };
   139 
   143 
   140 
       
   141 #endif  // __MAPTILEDBLOOKUPTABLE_H__`
   144 #endif  // __MAPTILEDBLOOKUPTABLE_H__`
   142 
   145 
   143 // End of file
   146 // End of file
   144 
   147