qtinternetradio/irdb/inc/irdb.h
changeset 17 38bbf2dcd608
parent 16 5723da102db1
equal deleted inserted replaced
16:5723da102db1 17:38bbf2dcd608
    67     IRDBCHAR chgRowIRDB(const QString& aInsSqlStr, 
    67     IRDBCHAR chgRowIRDB(const QString& aInsSqlStr, 
    68                         const QString& aUpdSqlStr, 
    68                         const QString& aUpdSqlStr, 
    69                         const uint& channelId, 
    69                         const uint& channelId, 
    70                         const QString& aCondSqlStr, 
    70                         const QString& aCondSqlStr, 
    71                         const QList<QByteArray>* apImgList = NULL,
    71                         const QList<QByteArray>* apImgList = NULL,
       
    72                         const int logoType = 0,
    72                         bool bPreHandle = false);
    73                         bool bPreHandle = false);
    73     /*
    74     /*
    74     * action is invoked from view of go to station;     
    75     * action is invoked from view of go to station;     
    75     * INSERT/UPDATE row;
    76     * INSERT/UPDATE row;
    76     * manipulation for multiple tables; 
    77     * manipulation for multiple tables; 
    83     IRDBCHAR chgRowIRDB(QString aInsSqlStr, 
    84     IRDBCHAR chgRowIRDB(QString aInsSqlStr, 
    84                         QString aUpdSqlStr, 
    85                         QString aUpdSqlStr, 
    85                         uint* const cidRet = NULL,
    86                         uint* const cidRet = NULL,
    86                         const QString& condStr = NULL, 
    87                         const QString& condStr = NULL, 
    87                         const QString& condUserCidStr = NULL,
    88                         const QString& condUserCidStr = NULL,
    88                         const QList<QByteArray>* apImgList = NULL);
    89                         const QList<QByteArray>* apImgList = NULL,
       
    90                         const int logoType = 0);
    89    
    91    
    90     /*
    92     /*
    91     * this fuction is used while synchronization data with iSDS side;  
    93     * this fuction is used while synchronization data with iSDS side;  
    92     * INSERT/UPDATE row;
    94     * INSERT/UPDATE row;
    93     * manipulation for multiple tables; 
    95     * manipulation for multiple tables; 
   161     /*
   163     /*
   162     * only update imgUrl, imgLocalFile in img table; 
   164     * only update imgUrl, imgLocalFile in img table; 
   163     */
   165     */
   164     IRDBCHAR updRowImg(const uint& channelId,
   166     IRDBCHAR updRowImg(const uint& channelId,
   165                        const QString& updSqlStr,
   167                        const QString& updSqlStr,
   166                        QList<QByteArray>* apImgList = NULL);    
   168                        QList<QByteArray>* apImgList = NULL,
   167 
   169                        const int logotype = 0);    
   168 public:
   170 
       
   171 public:
       
   172     /*
       
   173     *  handle request from search view;
       
   174     *  aSqlList, sql string list, this list is provided by wrapper level;
       
   175     *  bBegin,   if bBeging is true,it will invoke the operation of open db's connection.
       
   176     */
       
   177     IRDBCHAR handleRstFromSrhView(const uint& channelId, const QStringList& aSqlList, bool bBegin=true);
       
   178    
       
   179     /*
       
   180     * call this function after call handleRstFromSrhView;
       
   181     */
       
   182     void closeIRDBConnection();
   169     /*
   183     /*
   170     * DELETE rows in
   184     * DELETE rows in
   171     * channelHistory, searchRlt, songHistory, favorites, advertisement;
   185     * channelHistory, searchRlt, songHistory, favorites, advertisement;
   172     * rows in img, channelInfo and urlInfo can't be removed directly.
   186     * rows in img, channelInfo and urlInfo can't be removed directly.
   173     */
   187     */
   174     IRDBCHAR deleteRow(const QString& aDltSqlStr);
   188     IRDBCHAR deleteRow(const QString& aDltSqlStr);
   175     
   189     
   176     /*
   190     /*
   177     * DELETE rows in
   191     * select rows from IRDB
   178     * channelHistory, searchRlt, songHistory, favorites, advertisement;
   192     * aBegin, aBegin is 0, will invoke the action of open db connection;
   179     * rows in img, channelInfo and urlInfo can't be removed directly.
   193     * aBegin == aEnd, will invoke the action of close db connection;
   180     */
   194     */
   181     IRDBCHAR selectRow(IRDBWrapper* const apWrapper, 
   195     IRDBCHAR selectRow(IRDBWrapper* const apWrapper, 
   182                        const QString& aSltSqlStr,
   196                        const QString& aSltSqlStr,
   183                        QList<QVariant*>* pDataSet);    
   197                        QList<QVariant*>* pDataSet,
       
   198                        int aBegin = 0,
       
   199                        int aEnd = 0);    
   184  
   200  
   185 public:
   201 public:
   186     /*
   202     /*
   187     * SELECT * from IR_VIEW_ALL; 
   203     * SELECT * from IR_VIEW_ALL; 
   188     * param is used as condition string;
   204     * param is used as condition string;
   227     
   243     
   228     /*
   244     /*
   229     * search channelid from channelInfo table; 
   245     * search channelid from channelInfo table; 
   230     */
   246     */
   231     IRDBCHAR isChannelIdExisted(uint channelId);    
   247     IRDBCHAR isChannelIdExisted(uint channelId);    
   232  
   248     
   233 private:
   249 private:
   234     //IRDB Instance
   250     //IRDB Instance
   235     QSqlDatabase m_sqlDB;
   251     QSqlDatabase m_sqlDB;
   236 	
   252 	
   237     // reference count	
   253     // reference count	
   240     // Mutex locker
   256     // Mutex locker
   241     static QMutex mMutex;
   257     static QMutex mMutex;
   242     
   258     
   243     // The static instance  
   259     // The static instance  
   244     static IRDB* mpIRDBInstance; 
   260     static IRDB* mpIRDBInstance; 
       
   261     
       
   262     //for data batch handle  
       
   263     QSqlQuery* iIRQuery2;
   245    
   264    
   246 };    
   265 };    
   247 
   266 
   248 
   267 
   249 #endif /* IRDB_H_ */
   268 #endif /* IRDB_H_ */