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