diff -r 53c8aa5d97a3 -r 8f559c47d7fd camerauis/cameraapp/generic/inc/camtvaccessorymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camtvaccessorymonitor.h Wed Jun 09 09:21:41 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2007-2010 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: Utility class to handle TV accessory events +*/ + +#ifndef CAMTVACCESSORYMONITOR_H +#define CAMTVACCESSORYMONITOR_H + + +#include // for MAknWsEventObserver +#include // for RAccessoryServer +#include // for RAccessoryMode +#include // for RAccessoryConnection +#include + + +class MCamTvAccessoryObserver + { +public: + virtual void HandleTvAccessoryConnectedL() = 0; + virtual void HandleTvAccessoryDisconnectedL() = 0; + }; + +class CCamTvAccessoryMonitor : public CActive + { +public: + // Cancel and destroy + ~CCamTvAccessoryMonitor(); + + // Two-phased constructor. + static CCamTvAccessoryMonitor* NewL( MCamTvAccessoryObserver* aObserver ); + +public: + + // Starts to listen to tv accessory events + void StartListeningL(); + + // Returns ETrue if TVOut cable is connected + TBool IsTvOutCableConnected(); + + // Returns ETrue if HDMI cable is connected + TBool IsHdmiCableConnected(); + +private: + // C++ constructor + CCamTvAccessoryMonitor( MCamTvAccessoryObserver* aObserver ); + + // Second-phase constructor + void ConstructL(); + +private: + // From CActive + // Handle completion + void RunL(); + + // How to cancel me + void DoCancel(); + + // Override to handle leaves from RunL(). Default implementation causes + // the active scheduler to panic. + TInt RunError(TInt aError); + + +private: + + MCamTvAccessoryObserver* iObserver; + + TBool iTvOutConnectionState; + TBool iHDMIConnectionState; + + + RAccessoryServer iTvAccServer; + RAccessoryMode iTvAccMode; + RAccessoryConnection iTvAccCon; + TAccPolGenericIDArray iCurrentAccArray; + TAccPolAccessoryMode iPolAccMode; + TAccMode iPreviousMode; + }; + +#endif // CAMTVACCESSORYMONITOR_H