radioengine/utils/inc/cradiosystemeventcollectorimp.h
branchRCL_3
changeset 20 93c594350b9a
parent 19 cce62ebc198e
equal deleted inserted replaced
19:cce62ebc198e 20:93c594350b9a
     1 /*
       
     2 * Copyright (c) 2009 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 CRADIOSYSTEMEVENTCOLLECTORIMP_H
       
    19 #define CRADIOSYSTEMEVENTCOLLECTORIMP_H
       
    20 
       
    21 #include "cradiosystemeventcollector.h"
       
    22 #include "mradioaudioroutingobserver.h"
       
    23 #include "mradioheadseteventobserver.h"
       
    24 #include "mradiosystemeventdetectorobserver.h"
       
    25 #include "mradiosystemeventobserver.h"
       
    26 
       
    27 class CRadioAccessoryObserver;
       
    28 class CRadioSystemEventDetector;
       
    29 
       
    30 /**
       
    31  *  Collects system events and forwards them to observers
       
    32  *  Class also wraps up the getters for some system states
       
    33  */
       
    34 NONSHARABLE_CLASS( CRadioSystemEventCollectorImp ) : public CRadioSystemEventCollector
       
    35                                                    , public MRadioAudioRoutingObserver
       
    36                                                    , public MRadioHeadsetEventObserver
       
    37                                                    , public MRadioSystemEventDetectorObserver
       
    38     {
       
    39 public:
       
    40 
       
    41     static CRadioSystemEventCollectorImp* NewL();
       
    42 
       
    43     ~CRadioSystemEventCollectorImp();
       
    44 
       
    45 private:
       
    46 
       
    47     CRadioSystemEventCollectorImp();
       
    48 
       
    49     void ConstructL();
       
    50 
       
    51 // from base class CRadioSystemEventCollector
       
    52 
       
    53     void AddObserverL( MRadioSystemEventObserver* aSystemObserver );
       
    54     void RemoveObserver( MRadioSystemEventObserver* aSystemObserver );
       
    55     TBool IsNetworkCoverage() const;
       
    56     TBool IsMobileNetworkCoverage() const;
       
    57     TBool IsCallActive() const;
       
    58     TBool IsAudioResourcesAvailable() const;
       
    59     TBool IsHeadsetConnectedL() const;
       
    60 
       
    61     void NotifyObserversL( TRadioSystemEventType aEvent );
       
    62 
       
    63 // from base class MRadioSystemEventDetectorObserver
       
    64 
       
    65     void NetworkUpCallbackL();
       
    66     void NetworkDownCallbackL();
       
    67     void CallActivatedCallbackL();
       
    68     void CallDeactivatedCallbackL();
       
    69     void AudioResourcesAvailableL();
       
    70     void AudioAutoResumeForbiddenL();
       
    71     void ErrorCallbackL( TInt aError );
       
    72 
       
    73 // from base class MRadioHeadsetEventObserver
       
    74 
       
    75     void HeadsetConnectedCallbackL();
       
    76     void HeadsetDisconnectedCallbackL();
       
    77 
       
    78 // from base class MRadioAudioRoutingObserver
       
    79 
       
    80     void AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute );
       
    81 
       
    82 private: // data
       
    83 
       
    84     /**
       
    85      * Array of system event observers
       
    86      */
       
    87     RPointerArray<MRadioSystemEventObserver> iSystemEventObservers;
       
    88 
       
    89     /**
       
    90      * Detects system events
       
    91      */
       
    92     CRadioSystemEventDetector* iSystemEventDetector;
       
    93 
       
    94     /**
       
    95      * Observer for accessory events
       
    96      */
       
    97     CRadioAccessoryObserver* iHeadsetObserver;
       
    98 
       
    99     };
       
   100 
       
   101 #endif // CRADIOSYSTEMEVENTCOLLECTORIMP_H