mmserv/radioutility/radioserver/Session/stub/src/RadioStubManager.h
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
child 21 999b2818a0eb
equal deleted inserted replaced
19:095bea5f582e 20:0ac9a5310753
     1 /*
       
     2 * Copyright (c) 2002-2004 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 
       
    18 #ifndef RADIOSTUBMANAGER_H_
       
    19 #define RADIOSTUBMANAGER_H_
       
    20 #include <e32std.h>
       
    21 #include <e32base.h>
       
    22 
       
    23 #include <RadioFmTunerUtility.h>
       
    24 #include <RadioPlayerUtility.h>
       
    25 #include <RadioRdsUtility.h>
       
    26 #include <remconcallhandlingtargetobserver.h>
       
    27 #include <remconcoreapitargetobserver.h>
       
    28 
       
    29 #include "RadioServerData.h"
       
    30 #include "mradioheadseteventobserver.h"
       
    31 
       
    32 _LIT(KRadioStubManagerLocalChunkName, "RadioStubManagerLocalChunkName");
       
    33 
       
    34 struct TStubError
       
    35     {
       
    36 
       
    37     void SetStubError( TFmRadioTunerError aError, TUint aFailCounter = 1, TBool aFailForEver = EFalse ) 
       
    38         {
       
    39         iError = aError;
       
    40         iFailCounter = aFailCounter;
       
    41         iFailForEver = aFailForEver; };
       
    42     TInt Error() 
       
    43         {
       
    44         TInt aError (iError);
       
    45         if (iFailCounter)
       
    46             {
       
    47             --iFailCounter;
       
    48             }
       
    49         else if (iFailForEver)
       
    50             {
       
    51             }
       
    52         else
       
    53             {
       
    54             aError = KErrNone;
       
    55             }            
       
    56         return aError;
       
    57         }
       
    58     TFmRadioTunerError iError;
       
    59     TUint iFailCounter;
       
    60     TBool iFailForEver;
       
    61     };
       
    62 
       
    63 struct TLeaveError
       
    64     {
       
    65     void Set( TInt aError = KErrGeneral );
       
    66     TInt iError;
       
    67     };
       
    68 
       
    69 struct SRadioStubManager
       
    70     {
       
    71 public:
       
    72     void  FillZ() 
       
    73         { 
       
    74         Mem::FillZ( this, sizeof( SRadioStubManager ) ); 
       
    75         }
       
    76 public:
       
    77     enum TCenRepDbs
       
    78         {
       
    79         // Redefine CenRep databases for test purposes.
       
    80         // Original constant names are got by eliminating leading "ESub_"-prefix.
       
    81         EStub_KPSUidCtsyCallInformation = 0x01001001,
       
    82         EStub_KUidSystemCategory = 0x01001002,
       
    83         EStub_KPSUidVoiceUiAccMonitor = 0x01001003,
       
    84         EStub_KPSUidMMFAudioServer = 0x01001004,    
       
    85         EStub_KRadioPSUid = 0x01001005,
       
    86         EStub_KRadioServerPropertyCategory = 0x01001006
       
    87         };
       
    88     
       
    89     struct TRemConTargetData
       
    90     {
       
    91     TLeaveError iLeaveNewL;
       
    92     TLeaveError iLeaveConstructL;
       
    93     
       
    94     
       
    95     MRemConCoreApiTargetObserver*   iRemConCoreApiTargetObserver;
       
    96     MRemConCallHandlingTargetObserver*  iRemConCallHandlingTargetObserver;
       
    97     } mutable iRemConTarget;
       
    98     
       
    99     struct TAccessoryObserverData
       
   100     {
       
   101     TLeaveError iLeaveNewL;
       
   102     TLeaveError iLeaveIsHeadsetConnectedL;
       
   103     TLeaveError iLeaveConstructL;
       
   104     
       
   105     TBool iHeadsetConnected;
       
   106     MRadioHeadsetEventObserver* iObserver;
       
   107     
       
   108     
       
   109     } mutable iAccessoryObserver;
       
   110     
       
   111     struct TFmTunerStubData
       
   112         {
       
   113         TRsTunerCapabilities iCaps;
       
   114         TStubError iGetCapabilitiesError;
       
   115         
       
   116         
       
   117         TBool iTunerInOfflineMode;
       
   118         TStubError iEnableTunerInOfflineModeError;
       
   119         
       
   120         
       
   121         TRsFrequencyRange iRange;
       
   122         TRsFrequencyRange iPreviousRange;
       
   123         TInt iMinFreq;
       
   124         TInt iMaxFreq;
       
   125         TStubError iGetFrequencyRangeError;
       
   126         TStubError iSetFrequencyRangeError;
       
   127         
       
   128         TInt iFrequency;
       
   129         TInt iPreviousFrequency;
       
   130         TStubError iGetFrequencyError;
       
   131         TStubError iSetFrequencyError;
       
   132 
       
   133         struct TScanStations
       
   134         {
       
   135         TInt iCount;
       
   136         TInt iMinFreq;
       
   137         TInt iFrequencyStepSize;        
       
   138         } mutable iScanStations;
       
   139         
       
   140         TBool iStationSeekUpwards;
       
   141 
       
   142         TInt iSignalStrength;
       
   143         TStubError iGetSignalStrengthError;
       
   144         
       
   145         TInt iMaxSignalStrength;
       
   146         TStubError iGetMaxSignalStrengthError;
       
   147         
       
   148         TBool iStereoMode;
       
   149         TStubError iGetStereoModeError;
       
   150         
       
   151         TBool iForcedMono;
       
   152         TStubError iGetForcedMonoReceptionError;
       
   153         TStubError iForcedMonoReceptionError;
       
   154         
       
   155         TBool iSquelch;
       
   156         TStubError iSetSquelchError;
       
   157         TStubError iGetSquelchError;
       
   158         } mutable iTuner;
       
   159 
       
   160     struct TPlayerStubData
       
   161         {
       
   162         TLeaveError iLeaveNewL;
       
   163         TLeaveError iLeaveErrorForConstructL;
       
   164         MRadioPlayerObserver* iRadioPlayerUtilityClient;
       
   165 
       
   166         TRsPlayerState iPlayerState;
       
   167         
       
   168         TBool iMuteStatus;
       
   169         TStubError iMuteError;
       
   170         
       
   171         TInt iVolume;
       
   172         TStubError iSetVolumeError;
       
   173         TStubError iGetVolumeError;
       
   174         
       
   175         TTimeIntervalMicroSeconds iRampInterval;
       
   176         TStubError iSetVolumeRampError;
       
   177         
       
   178         TInt iMaxVolume;
       
   179         TStubError iGetMaxVolumeError;
       
   180         
       
   181         TInt iLeftPercentage;
       
   182         TInt iRightPercentage;
       
   183         TStubError iSetBalanceError;
       
   184         TStubError iGetBalanceError;
       
   185         } mutable iPlayer;
       
   186         
       
   187     struct TRdsStubData
       
   188         {
       
   189         TLeaveError iLeaveNewL;
       
   190         TLeaveError iLeaveErrorForConstructL;
       
   191         MRadioRdsObserver* iRadioRdsUtilityClient;
       
   192         TRsRdsCapabilities iCaps;
       
   193         TStubError iGetCapabilitiesError;
       
   194         
       
   195         TBool iRdsSignal;
       
   196         TStubError iGetRdsSignalStatusError;
       
   197         
       
   198         TStubError iNotifyRdsDataChangeError;    
       
   199         
       
   200         TBool iAutomaticSwitching;
       
   201         TStubError iSetAutomaticSwitchingError;
       
   202         TStubError iGetAutomaticSwitchingError;
       
   203         
       
   204         TStubError iStationSeekByPTYError;
       
   205         TStubError iStationSeekByTAError;
       
   206         TStubError iStationSeekByTPError;
       
   207         TInt iFrequency;
       
   208         TStubError iGetFreqByPTYError;
       
   209         TStubError iGetFreqByTAError;
       
   210         TStubError iGetPSByPTYError;
       
   211         TStubError iGetPSByTAError;
       
   212             
       
   213         RArray<TRdsPSName> iPsList;
       
   214         RArray<TInt> iFreqList;
       
   215         
       
   216         TInt iPi;
       
   217         TStubError iGetProgrammeIdentificationError;
       
   218         
       
   219         TRdsProgrammeType iPty;
       
   220         TStubError iGetProgrammeTypeError;
       
   221         
       
   222         TRdsPSName iPs;
       
   223         TStubError iGetProgrammeServiceError;
       
   224         
       
   225         // Radio Text
       
   226         TRdsRTplusClass iRtPlusClass;
       
   227         TRdsRadioText iRtPlusData;
       
   228         TStubError iGetRadioTextPlusError;
       
   229         TRsRdsRadioText iRt;
       
   230         TStubError iGetRadioTextError;
       
   231         
       
   232         // Automatic traffic announcement
       
   233         TBool iAuto;
       
   234         TStubError iGetTrafficAnnouncementStatusError;
       
   235         TStubError iSetTrafficAnnouncementStatusError;
       
   236     
       
   237         TBool iTaStatus;
       
   238         TStubError iGetAutomaticTrafficAnnouncementError;
       
   239         TStubError iSetAutomaticTrafficAnnouncementError;
       
   240         
       
   241         TDateTime iCt;
       
   242         TStubError iGetClockTimeError;
       
   243         
       
   244         TBool iTpStatus;
       
   245         TStubError iGetTrafficProgrammeStatusError;
       
   246         } mutable iRds;
       
   247         
       
   248     struct TMonitorStubData
       
   249         {
       
   250         TInt    iNone;
       
   251         } mutable iMonitor;
       
   252     };
       
   253 
       
   254 const TUid KStub_KRadioServerPropertyCategory = {SRadioStubManager::EStub_KRadioServerPropertyCategory};
       
   255 const TUid KStub_KUidSystemCategory = {SRadioStubManager::EStub_KUidSystemCategory};
       
   256 const TUid KStub_KPSUidCtsyCallInformation = {SRadioStubManager::EStub_KPSUidCtsyCallInformation};
       
   257 const TUid KStub_KPSUidVoiceUiAccMonitor = {SRadioStubManager::EStub_KPSUidVoiceUiAccMonitor};
       
   258 const TUid KStub_KPSUidMMFAudioServer = {SRadioStubManager::EStub_KPSUidMMFAudioServer};
       
   259 const TUid KStub_KRadioPSUid = {SRadioStubManager::EStub_KRadioPSUid};
       
   260 const TUid KStub_KRadioCRUid = {0x2002FF52};
       
   261 
       
   262 #endif /* RADIOSTUBMANAGER_H_ */