diff -r 5723da102db1 -r 38bbf2dcd608 qtinternetradio/irqfavoritesdb/inc/irqfavoritesdb.h --- a/qtinternetradio/irqfavoritesdb/inc/irqfavoritesdb.h Fri Sep 17 08:27:59 2010 +0300 +++ b/qtinternetradio/irqfavoritesdb/inc/irqfavoritesdb.h Mon Oct 04 00:07:46 2010 +0300 @@ -17,126 +17,54 @@ #ifndef IRQFAVORITESDB_H #define IRQFAVORITESDB_H -#include - #include "irqfavoritesdbexporter.h" class IRQPreset; -class IRQFavoritesDBPrivate; +class favoritesWrapper; +class channelHistoryWrapper; +class urlInfoWrapper; -class IRQFAVORITES_DLL_EXPORT IRQFavoritesDB : public QObject +class IRQFAVORITES_DLL_EXPORT IRQFavoritesDB { -Q_OBJECT -public: - enum PSReason - { - PSCreated, - PSDeleted, - PSModified - }; - public: IRQFavoritesDB(); ~IRQFavoritesDB(); - /* add a preset + /* add a preset to favorites * @param IRQPreset& the isds preset, * @return errcode */ int addPreset(const IRQPreset& aPreset); - /* add a preset manually - * @return errcode - * @param - */ - int addPreset(const QString& aName, const QString& aURL); - - /* get a preset uniq id - * @return - * @param - */ - int getUniqId(int aNum) const; - - /* delete a preset by uniq id + /* delete a preset * @return errcode * @param */ - int deletePreset(int aUniqId); - - /* search a preset by uniqpresetId / isdspresetid - * warning: the function needs further checking - * @return errcode - */ - int searchPreset(int aUniqPresetId, int aIsdsPresetId); - - /* get the previouse preset index in the internal list - * @return the index - */ - int getPreviousPreset(int aIndex); - - /* get the next preset index - * @return the index - */ - int getNextPreset(int aIndex); + int deletePreset(const IRQPreset& aPreset); /* replace with new preset * @return errcode */ - int replacePreset(const IRQPreset& aNewPreset); - - /* @return errcode - */ - int replaceUserDefinedPreset(const IRQPreset& aNewPreset); + void replacePreset(const IRQPreset& aNewPreset); /* change the preset type to user defined * @return errcode */ int makePresetUserDefined(int aChannelId, int aUserDefinedChannelId); - /* get the empty preset left count - * @return the count of empty presets left - */ - int emptyPresetCount() const; - - /* get the max preset count supported now - * @return errcode - */ - int maxPresetCount(); - - /* the interface is not used currently. - **/ - void setMoveStatus(bool aStatus); - - /* the interface is not used currently - */ - bool getMoveStatus(); - /* for CIRPreset is just an interface so we can wrapper it into the IRQPreset. * the interface get the IRQPreset list. The upper layer will free all the items * in the list and the list self*/ QList* getPresets() const; - - /* - * Increase the played times of the preset if it's in the favorites - */ - void increasePlayedTimes(const IRQPreset &aPreset); int renamePreset(const IRQPreset &aPreset, const QString &aNewName); - -signals: - /* - * the signal will triggered when we receive the message that preset is changed - */ - void presetChanged(int aId, int aDataHandler, PSReason aReason); private: - IRQFavoritesDBPrivate * const d_ptr; - - Q_DISABLE_COPY(IRQFavoritesDB) - - friend class IRQFavoritesDBPrivate; + favoritesWrapper *iFavoritesWrapper; + channelHistoryWrapper *iHistoryWrapper; + urlInfoWrapper *iUrlWrapper; }; #endif