satui/satapp/inc/satappplaytoneprovider.h
changeset 15 d7fc66ccd6fb
child 27 7eb70891911c
equal deleted inserted replaced
13:e32024264ebb 15:d7fc66ccd6fb
       
     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:
       
    15 *
       
    16 */
       
    17 #ifndef SATAPPPLAYTONEPROVIDER_H
       
    18 #define SATAPPPLAYTONEPROVIDER_H
       
    19  
       
    20 #include <QObject>
       
    21 #include <MdaAudioTonePlayer.h>//PlayStandardTone
       
    22 #include <MdaAudioSamplePlayer.h>//PlayUserSelectedTone
       
    23 #include <QEventLoop>
       
    24 #include <msatuiobserver.h>
       
    25 
       
    26 
       
    27 class CMdaAudioToneUtility;
       
    28 class CMdaAudioPlayerUtility;
       
    29 class QTimer;
       
    30 class HbMessageBox;
       
    31 
       
    32 class SatAppPlayToneProvider: public QObject,
       
    33                            public MMdaAudioToneObserver,//PlayStandardTone
       
    34                            public MMdaAudioPlayerCallback//PlayUserSelectedTone
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39 
       
    40     /**
       
    41     * Constructor
       
    42     */
       
    43     SatAppPlayToneProvider(QObject *parent = 0);
       
    44 
       
    45     /**
       
    46     * Distructor
       
    47     */
       
    48     virtual ~SatAppPlayToneProvider();
       
    49 
       
    50 public: // from MSatUiActionImplementer and impletment by Symbian
       
    51 
       
    52     /**
       
    53     * Handles Standard Tone playing.
       
    54     * @param aText The text to be displayed.
       
    55     * @param aFileName The name of the file corresponding to the tone.
       
    56     * @param aDuration The duration of the tone to be played.
       
    57     * @param aIconBitmap The tone playing note icon
       
    58     * @param aSelfExplanatory Flag indicating if icon is self-explanatory.
       
    59     * @return Information of the operation result.
       
    60     */
       
    61     virtual TSatUiResponse PlayStandardToneL(
       
    62         const TDesC &aText,
       
    63         const TDesC8 &aSequence,
       
    64         TTimeIntervalMicroSeconds aDuration,
       
    65         const CFbsBitmap *aIconBitmap,
       
    66         const TBool aSelfExplanatory );
       
    67 
       
    68     /**
       
    69     * Plays user selected tone.
       
    70     * @param aText The text to be displayed.
       
    71     * @param aDuration Play duration.
       
    72     * @param aTone Tone to be played.
       
    73     * @param aIconBitmap The tone playing note icon
       
    74     * @param aSelfExplanatory Flag indicating if icon is self-explanatory.
       
    75     * @return Information on the operation result.
       
    76     */
       
    77     virtual TSatUiResponse PlayUserSelectedToneL(
       
    78         const TDesC &aText,
       
    79         TTimeIntervalMicroSeconds aDuration,
       
    80         TSatTone aTone,
       
    81         const CFbsBitmap *aIconBitmap,
       
    82         const TBool aSelfExplanatory );
       
    83 
       
    84     /**
       
    85     * ClearScreen
       
    86     */
       
    87     void clearScreen();
       
    88 
       
    89     /**
       
    90     * CloseSatUI
       
    91     */
       
    92     void closeSatUI();
       
    93 
       
    94 public:// from MMdaAudioToneObserver
       
    95 
       
    96     /**
       
    97     * From MMdaAudioToneObserver Called by the player object when
       
    98     * it has been initialised.
       
    99     * @param aError Error type.
       
   100     */
       
   101     void MatoPrepareComplete( TInt aError );
       
   102 
       
   103     /**
       
   104     * From MMdaAudioToneObserver Called by the player object when
       
   105     * the playback has been terminated.
       
   106     * @param aError Error type.
       
   107     */
       
   108     void MatoPlayComplete( TInt aError );
       
   109 
       
   110 public://from MMdaAudioPlayerCallback
       
   111     /**
       
   112     * Initialisation of an audio sample has completed.
       
   113     * @param aError The status of the audio sample after initialisation.
       
   114     * @param aDuration The duration of the audio sample.
       
   115     */
       
   116     void MapcInitComplete( 
       
   117         TInt aError, 
       
   118         const TTimeIntervalMicroSeconds& /*aDuration*/ );
       
   119 
       
   120     /**
       
   121     * Play of an audio sample has completed.
       
   122     * @param aError The status of playback.
       
   123     */
       
   124     void MapcPlayComplete( TInt aError );
       
   125 
       
   126 private:// for playTone
       
   127 
       
   128     /**
       
   129     * Get settings from current profile like volume, warning tones on/off etc.
       
   130     * @param aTone, optional specifies the type of needed tone if necessary
       
   131     * @param aToneName, optional buffer to get a soundfile name from 
       
   132     * the active profile if necessary
       
   133     */
       
   134     void GetProfileParamsL( TSatTone aTone = ESatToneNotSet,
       
   135                                              TDes *aToneName = NULL );
       
   136 
       
   137     /**
       
   138     * showWaitNote
       
   139     */
       
   140     void showWaitNote();
       
   141 
       
   142 private slots:
       
   143 
       
   144     void stopPlayTone();
       
   145 
       
   146 private: // Data
       
   147 
       
   148     /**
       
   149     * Warning And Play Tones
       
   150     */
       
   151     bool mWarningAndPlayTones;
       
   152 
       
   153     /**
       
   154     * Play tone volume
       
   155     */
       
   156     int mVolume;
       
   157 
       
   158     /**
       
   159     * Own, Media server interface to play rtf file
       
   160     */
       
   161     CMdaAudioToneUtility *mPlayer;
       
   162 
       
   163     /**
       
   164     * Response of Play tone
       
   165     */
       
   166     TSatUiResponse mPlayToneError;
       
   167 
       
   168     /*
       
   169      *  Own. PlayTone
       
   170      */
       
   171     QTimer *mTimer;
       
   172 
       
   173     /*
       
   174      *  Own. PlayTone 
       
   175      */
       
   176     QEventLoop *mLoop;
       
   177 
       
   178     /*
       
   179      *  Own. PlayTone note
       
   180      */
       
   181     HbMessageBox *mPermanentNote; 
       
   182 
       
   183     /*
       
   184      *  Own. Player for user selected tones.
       
   185      */ 
       
   186     CMdaAudioPlayerUtility *mAudioPlayer;
       
   187 
       
   188 };
       
   189 
       
   190 #endif    //SATAPPPLAYTONEPROVIDER_H