diff -r 1a6714c53019 -r cce62ebc198e radiohswidget/tsrc/inc/radiohswidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/radiohswidget/tsrc/inc/radiohswidget.h Tue Aug 31 15:15:02 2010 +0300 @@ -0,0 +1,93 @@ +/* +* 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 +#include +#include + +/*! + \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 mReceivedInformation; + +}; + +#endif // T_RADIOHSWIDGETSTUB_H