phoneuis/TelephonyDeviceMode/inc/CTelDMAudioAccessoryListener.h
author William Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:33:21 +0100
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 22 6bb1b21d2484
parent 37 ba76fc04e6c2
permissions -rw-r--r--
Catchup to latest Symbian^4

/*
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Accessory mode.
*
*/


#ifndef CTELDMAUDIOACCESSORYLISTENER_H
#define CTELDMAUDIOACCESSORYLISTENER_H

//  INCLUDE FILES   
#include <MTelephonyAudioRoutingObserver.h>
#include "mteldmaccessory.h"

// FORWARD DECLARATIONS

//  CLASS DEFINITIONS 
class CTelephonyAudioRouting;

/**
* Class for listening accessory mode and routing changes. 
*
* @lib telephonydevicemode.dll
* @since 3.1
*/
NONSHARABLE_CLASS( CTelDMAudioAccessoryListener ): public CBase,
                          public MTelDMAccessory,
                          public MTelephonyAudioRoutingObserver
    {
    public: // constructor & destructor

        /** 
        * Two phase constructor 
        */
        static CTelDMAudioAccessoryListener* NewL();

        // Destructor
        virtual ~CTelDMAudioAccessoryListener( );


    public: // from MTelDMAccessory

        /**
        * See MTelDMAccessory
        */
        TBool IsAccessoryAttached();
        
        /**
        * See MTelDMAccessory
        */
        TBool IsAnyActiveAccessory();
    
    public: //from  MTelephonyAudioRoutingObserver 
    
        void AvailableOutputsChanged( CTelephonyAudioRouting& 
                                                aTelephonyAudioRouting);
        
        void OutputChanged( CTelephonyAudioRouting& 
                                        aTelephonyAudioRouting);
        
        void SetOutputComplete( CTelephonyAudioRouting& 
                                            aTelephonyAudioRouting, 
                                            TInt aError); 
    private: // Constructor
        
        /** c++ constructor */
        CTelDMAudioAccessoryListener();

        /** 2nd phase constructor */
        void ConstructL();
        
        
    private: 
    
        // Array of available outputs         
        RArray<CTelephonyAudioRouting::TAudioOutput> iOutputArray;
        
        // Current accessory mode.
        TBool iIsActiveAccessory;
        
        // Audio routing API 
        CTelephonyAudioRouting* iAudioRouting;
        
    };
    
#endif // CTELDMAUDIOACCESSORYLISTENER_H

// End of file