radiohswidget/tsrc/inc/radiohswidget.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  FM Radio home screen widget unit tests.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_RADIOHSWIDGETSTUB_H
       
    19 #define T_RADIOHSWIDGETSTUB_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <QObject>
       
    23 #include <QVariant>
       
    24 #include <QList>
       
    25 
       
    26 /*!
       
    27     \struct ReceivedInfo
       
    28     \brief Helper to store received information on unit tests.
       
    29 */
       
    30 struct ReceivedInfo {
       
    31     /*! Stores the type of received information. */
       
    32     int informationType;
       
    33     /*! Stores the actual data of received information. */
       
    34     QVariant information;
       
    35 };
       
    36 
       
    37 /*!
       
    38     \namespace FmRadio
       
    39     \brief Wraps enumerators for radio state and service request visibility. 
       
    40  */
       
    41 namespace FmRadio
       
    42 {
       
    43     /*! Enum for radio application states. */
       
    44     enum State
       
    45     {
       
    46         StateUndefined,
       
    47         StateNotRunning,
       
    48         StateStarting,
       
    49         StateRunning,
       
    50         StateSeeking,
       
    51         StateAntennaNotConnected,
       
    52         StateClosing
       
    53     };
       
    54     
       
    55     /*! Enum for controlling the visibility of the radio application. */
       
    56     enum VisibiltyAfterRequest
       
    57     {
       
    58         VisibiltyDoNotChange,
       
    59         VisibiltyToForeground,
       
    60         VisibiltyToBackground
       
    61     };
       
    62 
       
    63 }
       
    64 
       
    65 class RadioHsWidget : public QObject
       
    66 {
       
    67     Q_OBJECT
       
    68 
       
    69 public:
       
    70 
       
    71     RadioHsWidget();
       
    72     ~RadioHsWidget();
       
    73 
       
    74     void handleRadioInformationChange(const int informationType,
       
    75         const QVariant &information);
       
    76 
       
    77     void handleRadioStateChange(const QVariant &value);
       
    78     
       
    79     ReceivedInfo receivedInformation();
       
    80     int receivedInformationCount();
       
    81 
       
    82     void reset();
       
    83 
       
    84 private: // data
       
    85     
       
    86     /*! Stores received information. Correctness of
       
    87         RadioHsWidgetRadioServiceClient mediated information is checked from here.
       
    88     */
       
    89     QList<ReceivedInfo> mReceivedInformation;
       
    90     
       
    91 };
       
    92 
       
    93 #endif // T_RADIOHSWIDGETSTUB_H