tvout/tvoutengine/inc/glxtvconnectionmonitor.h
changeset 26 c499df2dbb33
child 29 2c833fc9e98f
equal deleted inserted replaced
24:99ad1390cd33 26:c499df2dbb33
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Monitoring class of the Tv Out Connection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  * @internal reviewed 24/08/2007 by D Holland
       
    22  */
       
    23 
       
    24 #ifndef __GLX_WNDWCONNECTION_MONITOR_H__
       
    25 #define __GLX_WNDWCONNECTION_MONITOR_H__
       
    26 
       
    27 // External Includes
       
    28 #include <e32base.h>                // for CActive
       
    29 #include <AknWsEventObserver.h>     // for MAknWsEventObserver
       
    30 #include <AccessoryServer.h>        // for RAccessoryServer
       
    31 #include <AccessoryMode.h>          // for RAccessoryMode
       
    32 #include <AccessoryConnection.h>	// for RAccessoryConnection
       
    33 #include <AccPolGenericIDArray.h>
       
    34 
       
    35 
       
    36 // Forward Declarations
       
    37 class MGlxTvConnectionObserver;
       
    38 
       
    39 
       
    40 /**
       
    41  * Class Description
       
    42  * An Active object derived class is used to monitor the TV out connection
       
    43  * @author Loughlin
       
    44  */
       
    45 NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive
       
    46     {
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Static Symbian 2 stage constructor.
       
    51      */
       
    52     static CGlxTvConnectionMonitor* NewL(
       
    53                             MGlxTvConnectionObserver& aConnectionObserver);
       
    54 
       
    55     /**
       
    56      * Destructor.
       
    57      */
       
    58     ~CGlxTvConnectionMonitor();
       
    59 
       
    60 private:
       
    61 
       
    62     /**
       
    63      * Standard C++ constructor
       
    64      */
       
    65     CGlxTvConnectionMonitor(
       
    66                         MGlxTvConnectionObserver& aConnectionObserver);
       
    67 
       
    68     /*
       
    69      * Symbian second stage construction
       
    70      */
       
    71     void ConstructL();
       
    72 
       
    73 public: // class member functions
       
    74 
       
    75     /*
       
    76      * Provides the caller with the current TV connetion state
       
    77      * @return The TV connection state
       
    78      */
       
    79     TBool IsConnected() const;
       
    80 
       
    81     /*
       
    82      * Provides the caller with the current HDMI connetion state
       
    83      * @return The HDMI connection state
       
    84      */
       
    85     TBool IsHDMIConnected() const;
       
    86 
       
    87 
       
    88 private: // From CActive
       
    89     /**
       
    90      * @ref CActive::RunL
       
    91      */	
       
    92 	void RunL();
       
    93 	
       
    94     /**
       
    95      * @ref CActive::DoCancel
       
    96      */	
       
    97 	void DoCancel();
       
    98     
       
    99     /**
       
   100      * @ref CActive::RunError
       
   101      */    
       
   102     TInt RunError( TInt aError );    
       
   103     
       
   104     
       
   105 private:
       
   106 
       
   107     /**
       
   108      * Requests TV on/off events 
       
   109      */        
       
   110     void IssueRequest();
       
   111 
       
   112     /**
       
   113      * Sends notification to observers when TV Out cable is connected
       
   114      */      
       
   115     void IssueNotificationL();
       
   116     
       
   117 
       
   118 private: // class member data
       
   119     
       
   120     // Not owned: TV connection observer
       
   121     MGlxTvConnectionObserver& iConnectionObserver;
       
   122 
       
   123     // TVout The Connection state 
       
   124     TBool iTvOutConnectionState;
       
   125     
       
   126     // TVout The Connection state 
       
   127     TBool iHDMIConnectionState;
       
   128 
       
   129     // The (external device) Accessory Server
       
   130     RAccessoryServer iTvAccServer;
       
   131     
       
   132     // Accessory mode 
       
   133     RAccessoryMode iTvAccMode;
       
   134 
       
   135     // Accessory Connection - details the type of accessory
       
   136     RAccessoryConnection iTvAccCon;
       
   137 
       
   138     //Class gives Generic ID
       
   139     TAccPolGenericIDArray iCurrentAccArray;
       
   140     };
       
   141 
       
   142 
       
   143 #endif // __GLX_WNDWCONNECTION_MONITOR_H__