phoneuis/TelephonyDeviceMode/inc/CTelDMAudioAccessoryListener.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 18 Jan 2010 20:18:27 +0200
changeset 0 5f000ab63145
child 21 92ab7f8d0eab
child 61 41a7f70b3818
permissions -rw-r--r--
Revision: 201001 Kit: 201003

/*
* 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