qtinternetradio/irqfavoritesdb/inc/irqfavoritesdb_p.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 17 Sep 2010 08:27:59 +0300
changeset 16 5723da102db1
parent 12 608f67c22514
permissions -rw-r--r--
Revision: 201035 Kit: 201037

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#ifndef IRQFAVORITESDB_P_H
#define IRQFAVORITESDB_P_H

#include <QObject>

#include "pspresetobserver.h"

class CIRFavoritesDb;
class IRQPreset;
class IRQFavoritesDB;

class IRQFavoritesDBPrivate : public MPSPresetObserver
{
public:
    IRQFavoritesDBPrivate(IRQFavoritesDB *aIRQFavorites);
    
    ~IRQFavoritesDBPrivate();
    
    void init();
    
    int addPreset(const IRQPreset& aPreset);
    
    int addPreset(const QString& aName, const QString& aURL);
    
    int getUniqId(int aNum) const;
            
    int deletePreset(int aUniqId);
    
    int searchPreset(int aUniqPresetId, int aIsdsPresetId);
    
    int getPreviousPreset(int aIndex);
    
    int getNextPreset(int aIndex); 
    
    int replacePreset(const IRQPreset& aNewPreset);
    
    int replaceUserDefinedPreset(const IRQPreset& aNewPreset);
    
    int makePresetUserDefined(int aChannelId, int aUserDefinedChannelId);
    
    int emptyPresetCount() const;
    
    int maxPresetCount();
    
    void setMoveStatus(bool aStatus);
    
    bool getMoveStatus();
    
    QList<IRQPreset*>* getPresets() const;
    
    void increasePlayedTimes(const IRQPreset &aPreset);
    
    int renamePreset(const IRQPreset &aPreset, const QString &aNewName);
    
private:
    /* from MPSPresetObserver */
    void HandlePresetChangedL(TInt aId, TUid aDataHandler, MPSPresetObserver::TPSReason aType);
    
    void addPresetL(const IRQPreset& aPreset, int& aRetValue);
    
    void replacePresetL(const IRQPreset& aNewPreset);
        
    void replaceUserDefinedPresetL(const IRQPreset& aNewPreset);
        
    void increasePlayedTimesL(const IRQPreset &aPreset);
    
    int renamePresetL(const IRQPreset &aPreset, const QString &aNewName);
    
private:
    IRQFavoritesDB * const q_ptr;
    CIRFavoritesDb *mIRFavoritesDb;
};

#endif  //IRQFAVORITESDB_P_H