tvout/inc/glxtvconnectionmonitor.h
changeset 26 c499df2dbb33
parent 24 99ad1390cd33
child 27 0d818da5a659
child 29 2c833fc9e98f
child 40 112f0ac2d1f0
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 
       
    33 
       
    34 // Forward Declarations
       
    35 class MGlxTvConnectionObserver;       
       
    36 
       
    37 
       
    38 /**
       
    39  * Class Description
       
    40  * An Active object derived class is used to monitor the TV out connection
       
    41  * @author Loughlin
       
    42  */        
       
    43 NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive 
       
    44     {
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Static Symbian 2 stage constructor.
       
    49      */
       
    50     static CGlxTvConnectionMonitor* NewL(
       
    51                             MGlxTvConnectionObserver& aConnectionObserver);
       
    52     
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     ~CGlxTvConnectionMonitor();
       
    57     
       
    58 private:
       
    59 
       
    60     /**
       
    61      * Standard C++ constructor
       
    62      */
       
    63     CGlxTvConnectionMonitor( 
       
    64                         MGlxTvConnectionObserver& aConnectionObserver);
       
    65     
       
    66     /*
       
    67      * Symbian second stage construction
       
    68      */
       
    69     void ConstructL(); 
       
    70 
       
    71 public: // class member functions
       
    72 
       
    73     /*
       
    74      * Provides the caller with the current TV connetion state
       
    75      * @return The TV connection state
       
    76      */
       
    77     TBool IsConnected() const;
       
    78 
       
    79     /*
       
    80      * Provides the caller with the current HDMI connetion state
       
    81      * @return The HDMI connection state
       
    82      */
       
    83     TBool IsHDMIConnected() const;
       
    84 
       
    85 
       
    86 private: // From CActive
       
    87     /**
       
    88      * @ref CActive::RunL
       
    89      */	
       
    90 	void RunL();
       
    91 	
       
    92     /**
       
    93      * @ref CActive::DoCancel
       
    94      */	
       
    95 	void DoCancel();
       
    96     
       
    97     /**
       
    98      * @ref CActive::RunError
       
    99      */    
       
   100     TInt RunError( TInt aError );    
       
   101     
       
   102     
       
   103 private:
       
   104 
       
   105     /**
       
   106      * Requests TV on/off events 
       
   107      */        
       
   108     void IssueRequest();
       
   109 
       
   110     /**
       
   111      * Sends notification to observers when TV Out cable is connected
       
   112      */      
       
   113     void IssueNotificationL();
       
   114     
       
   115 
       
   116 private: // class member data
       
   117     
       
   118     // Not owned: TV connection observer
       
   119     MGlxTvConnectionObserver& iConnectionObserver;
       
   120 
       
   121     // TVout The Connection state 
       
   122     TBool iTvOutConnectionState;
       
   123     
       
   124     // TVout The Connection state 
       
   125     TBool iHDMIConnectionState;
       
   126 
       
   127     // The (external device) Accessory Server
       
   128     RAccessoryServer iTvAccServer;
       
   129     
       
   130     // Accessory mode 
       
   131     RAccessoryMode iTvAccMode;
       
   132     
       
   133     // Accessory Mode structure - details the type of accessory
       
   134     TAccPolAccessoryMode iCurrentAccMode; 
       
   135 
       
   136     };
       
   137 
       
   138 
       
   139 #endif // __GLX_WNDWCONNECTION_MONITOR_H__