radioapp/radiouiengine/inc/radiohistorydatabase.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef RADIOHISTORYDATABASE_H
       
    19 #define RADIOHISTORYDATABASE_H
       
    20 
       
    21 // System includes
       
    22 #include <QScopedPointer>
       
    23 
       
    24 // User includes
       
    25 
       
    26 // Forward declarations
       
    27 class QSqlDatabase;
       
    28 class QSqlQuery;
       
    29 
       
    30 /*!
       
    31  *
       
    32  */
       
    33 class RadioHistoryDatabase
       
    34 {
       
    35 public:
       
    36 
       
    37     RadioHistoryDatabase();
       
    38     ~RadioHistoryDatabase();
       
    39 
       
    40     void addItem( const QString& artist, const QString& title,
       
    41                   const QString& stationName, uint frequency, bool fromRds );
       
    42 
       
    43     void clearRecent();
       
    44     void clearTagged();
       
    45 
       
    46 private:
       
    47 
       
    48     bool connectToDatabase();
       
    49 
       
    50     void commitTransaction( QSqlQuery& query );
       
    51 
       
    52 private: // data
       
    53 
       
    54     QScopedPointer<QSqlDatabase>    mDatabase;
       
    55 
       
    56 };
       
    57 
       
    58 #endif // RADIOHISTORYDATABASE_H