internetradio2.0/irsessionlog/inc/irnmslogdb.h
changeset 14 896e9dbc5f19
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
       
     1 /*
       
     2 * Copyright (c) 2009 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 "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:  The implementation for presentation elements.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_IRNMSLOGDB_H
       
    20 #define C_IRNMSLOGDB_H
       
    21 
       
    22 #include <d32dbms.h>
       
    23 
       
    24 class CIRNmsLogger;
       
    25 
       
    26 NONSHARABLE_CLASS( CIRNmsLogDb ) : public CBase
       
    27     {                                                
       
    28     //member functions
       
    29 public:
       
    30 
       
    31     /**
       
    32     * Function : NewL()
       
    33     * Two phased construction
       
    34     * @return instance of CIRNmsLogDb
       
    35     */
       
    36     static CIRNmsLogDb* NewL();
       
    37     
       
    38     /**
       
    39     * Function : NewLC()
       
    40     * Two phased construction
       
    41     * @return instance of CIRNmsLogDb
       
    42     */    
       
    43     static CIRNmsLogDb* NewLC();
       
    44     
       
    45     /**
       
    46     * Function : ~CIRNmsLogDb()
       
    47     * default destructor
       
    48     */    
       
    49     ~CIRNmsLogDb();
       
    50 
       
    51     /**
       
    52     * Function : CreateDbConditional()
       
    53     * Creates both the dbms files conditionally(only if not yet created)
       
    54     * @param session database file
       
    55     * @return errcode
       
    56     */    
       
    57     TInt CreateDbConditional( TFileName &aNmsLog );
       
    58 
       
    59     /**
       
    60     * Function : AddNmsLogStartL()
       
    61     * adds the NmsLog log entry into data base
       
    62     * @param NmsLog data instance
       
    63     */
       
    64     void AddNmsLogStartL( CIRNmsLogger& aNmsLog );
       
    65     
       
    66     /**
       
    67     * CIRNmsLogDb::GetAllNmsLogL()
       
    68     * gets all the preset into an array 
       
    69     */
       
    70     void GetAllNmsLogL( CArrayPtrFlat<CIRNmsLogger>& aNmsLogDataList );
       
    71     
       
    72     /**
       
    73     * Function : DeleteAllNmsLogL
       
    74     * delete all the NmsLog from NmsLog log entry
       
    75     */
       
    76     void DeleteAllNmsLogL();
       
    77 
       
    78 private: 
       
    79 
       
    80     /**
       
    81     * Function : ConstructL()
       
    82     * two phase construction
       
    83     */   
       
    84     void ConstructL();
       
    85     
       
    86     /**
       
    87     * Function : CloseDb()
       
    88     * Closes the database 
       
    89     */
       
    90     void CloseDb();
       
    91     
       
    92     /**
       
    93     * Function : CreateNmsLogTableL
       
    94     * creates NmsLoglogtable with two column one is NmsLogid and rest of NmsLog
       
    95     * log data
       
    96     * ---------------------------------------------------------------------------
       
    97     * NmsLogTable
       
    98     *---------------------------
       
    99     *| KID   |     KNmsLogCol |
       
   100     *---------------------------
       
   101     *|TInt32 | EDbColLongText8 |
       
   102     *---------------------------
       
   103     */    
       
   104     void CreateNmsLogTableL();
       
   105     
       
   106     /**
       
   107     * Function : CreateNmsLogIndexL
       
   108     * sets NmsLogid as the primary key
       
   109     */  
       
   110     void CreateNmsLogIndexL();
       
   111     
       
   112     /**
       
   113     * Function : OpenDbL()
       
   114     * opening the data base 
       
   115     */
       
   116     void OpenDbL();
       
   117     
       
   118     /**
       
   119     * Function : CreateDbL()
       
   120     * creates both the dbms files 
       
   121     * database filename
       
   122     */    
       
   123     void CreateDbL( TFileName& aNmsLog );
       
   124 
       
   125     //data members                                        
       
   126 private:
       
   127 
       
   128     /**
       
   129     * database file
       
   130     */
       
   131     TFileName iDbFile;
       
   132     
       
   133     /**
       
   134     * file session
       
   135     */
       
   136     RFs iFsSession;
       
   137     
       
   138     /**
       
   139     * data base handler
       
   140     */
       
   141     RDbNamedDatabase iNmsLogDb;
       
   142     
       
   143     };
       
   144 
       
   145 #endif  //C_IRNMSLOGDB_H