radiohswidget/tsrc/inc/radiohswidget.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 17 Sep 2010 08:29:29 +0300
changeset 50 c44f9bb56771
parent 33 11b6825f0862
permissions -rw-r--r--
Revision: 201035 Kit: 201037

/*
* Copyright (c) 2010 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:  FM Radio home screen widget unit tests.
*
*/

#ifndef T_RADIOHSWIDGETSTUB_H
#define T_RADIOHSWIDGETSTUB_H

// INCLUDES
#include <QObject>
#include <QVariant>
#include <QList>

/*!
    \struct ReceivedInfo
    \brief Helper to store received information on unit tests.
*/
struct ReceivedInfo {
    /*! Stores the type of received information. */
    int informationType;
    /*! Stores the actual data of received information. */
    QVariant information;
};

/*!
    \namespace FmRadio
    \brief Wraps enumerators for radio state and service request visibility. 
 */
namespace FmRadio
{
    /*! Enum for radio application states. */
    enum State
    {
        StateUndefined,
        StateNotRunning,
        StateStarting,
        StateRunning,
        StateSeeking,
        StateAntennaNotConnected,
        StateClosing
    };
    
    /*! Enum for controlling the visibility of the radio application. */
    enum VisibiltyAfterRequest
    {
        VisibiltyDoNotChange,
        VisibiltyToForeground,
        VisibiltyToBackground
    };

}

class RadioHsWidget : public QObject
{
    Q_OBJECT

public:

    RadioHsWidget();
    ~RadioHsWidget();

    void handleRadioInformationChange(const int informationType,
        const QVariant &information);

    void handleRadioStateChange(const QVariant &value);
    
    ReceivedInfo receivedInformation();
    int receivedInformationCount();

    void reset();

private: // data
    
    /*! Stores received information. Correctness of
        RadioHsWidgetRadioServiceClient mediated information is checked from here.
    */
    QList<ReceivedInfo> mReceivedInformation;
    
};

#endif // T_RADIOHSWIDGETSTUB_H