qtinternetradio/irdb/inc/channelhistorywrapper.h
changeset 16 5723da102db1
child 17 38bbf2dcd608
equal deleted inserted replaced
15:065198191975 16:5723da102db1
       
     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 * Description: 
       
    13 *
       
    14 */
       
    15 
       
    16 #ifndef _CHANNEL_HISTORY_WRAPPER_H_
       
    17 #define _CHANNEL_HISTORY_WRAPPER_H_
       
    18 
       
    19 #include "irdbexport.h"
       
    20 #include "irdbwrapper.h"
       
    21 
       
    22 class IRDB_DLL_EXPORT channelHistoryWrapper: public IRDBWrapper
       
    23 {
       
    24 public:
       
    25     channelHistoryWrapper();
       
    26     ~channelHistoryWrapper();
       
    27 
       
    28 public:
       
    29     /*
       
    30     * RowData:        [direction: in]table row value;
       
    31     * cidUserDefined: [direction: out] return the channelid allocated by IRDB, 
       
    32     *                                  the channelId is a user-defined channelId;
       
    33     * logoMap: [direction: in]the logo rowData will be inserted into irdb via this structure;
       
    34     *                         the logo rowData should be filled into logoMap as below:
       
    35     *                         logoMap* pLogo = new logoMap(); 
       
    36     *                         QByteArray bLog("XXXXXXXXXXXXXXXX");
       
    37     *                         QByteArray sLog("ssssssssssssssss"); 
       
    38     *                         pLogo->insert(bLogoInsert, bLog); 
       
    39     *                         pLogo->insert(sLogoInsert, sLog); 
       
    40     *                         
       
    41     * condAND: [direction: in]condition for search channelHistory, it is AND relationship in every pair;
       
    42     * condOR:  [direction: in]condition for search channelHistory, it is OR  relationship in every pair;
       
    43     */ 
       
    44     bool putChannelHistory(const columnMap* const RowData,
       
    45                            uint* const cidUserDefined = NULL,
       
    46                            const logoMap*   const logoData = NULL,
       
    47                            const columnMap* const condAND = NULL,
       
    48                            const columnMap* const condOR = NULL);  
       
    49     
       
    50     /*
       
    51     * If all parameters are default,all rows in channelHistory will be deleted if not violating constraint;
       
    52     * condAND: [direction: in]condition for search channelHistory, it is AND relationship in every pair;
       
    53     * condOR:  [direction: in]condition for search channelHistory, it is OR  relationship in every pair;
       
    54     */     
       
    55     bool deleteChannelHistory(const columnMap* const condAND = NULL,
       
    56                               const columnMap* const condOR = NULL);
       
    57 
       
    58     /*
       
    59     * If all parameters are default, all rows in channelHistory will return;
       
    60     * condAND: [direction: in]condition for search channelHistory, it is AND relationship in every pair;
       
    61     * condOR:  [direction: in]condition for search channelHistory, it is OR  relationship in every pair;
       
    62     */                       
       
    63     QList<QVariant*>* getChannelHistory(const columnMap* const condAND = NULL,  
       
    64                                         const columnMap* const condOR = NULL);
       
    65 
       
    66 private:
       
    67     /*
       
    68     * It is called by IRDB instance;
       
    69     * IRDB instance delivers rows set to IRDBWrapper via this function;
       
    70     * the rows set is storaged in m_IRDataSet;
       
    71     */
       
    72     bool getIRTableCB(QSqlQuery& aIRDataSet, 
       
    73                       QList<QVariant*>* pDataSet);
       
    74 
       
    75 private:
       
    76     /*
       
    77     * search channelId according to parameter;
       
    78     * condUserCidStr:[direction: in]specific condition(where) string for user-define uid;
       
    79     * condAND:       [direction: in]condition for search channelHistory, it is AND relationship in every pair;
       
    80     * condOR:        [direction: in]condition for search channelHistory, it is OR  relationship in every pair;
       
    81     * uint:          return channelId;
       
    82     */    
       
    83     uint srhChannelId(QString& condUserCidStr,
       
    84                       const columnMap* const condAND,
       
    85                       const columnMap* const condOR = NULL);
       
    86 
       
    87 };
       
    88 
       
    89 #endif
       
    90