photosgallery/viewframework/tvout/inc/glxtvconnectionmonitor.h
changeset 0 4e91876724a2
child 4 57d388cc48c1
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     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 private: // From CActive
       
    81     /**
       
    82      * @ref CActive::RunL
       
    83      */	
       
    84 	void RunL();
       
    85 	
       
    86     /**
       
    87      * @ref CActive::DoCancel
       
    88      */	
       
    89 	void DoCancel();
       
    90     
       
    91     /**
       
    92      * @ref CActive::RunError
       
    93      */    
       
    94     TInt RunError( TInt aError );    
       
    95     
       
    96     
       
    97 private:
       
    98 
       
    99     /**
       
   100      * Requests TV on/off events 
       
   101      */        
       
   102     void IssueRequest();
       
   103 
       
   104     /**
       
   105      * Sends notification to observers when TV Out cable is connected
       
   106      */      
       
   107     void IssueNotificationL();
       
   108     
       
   109 
       
   110 private: // class member data
       
   111     
       
   112     // Not owned: TV connection observer
       
   113     MGlxTvConnectionObserver& iConnectionObserver;
       
   114 
       
   115     // The Connection state 
       
   116     TBool iConnectionState;
       
   117     
       
   118     // The (external device) Accessory Server
       
   119     RAccessoryServer iTvAccServer;
       
   120     
       
   121     // Accessory mode 
       
   122     RAccessoryMode iTvAccMode;
       
   123     
       
   124     // Accessory Mode structure - details the type of accessory
       
   125     TAccPolAccessoryMode iCurrentAccMode; 
       
   126 
       
   127     };
       
   128 
       
   129 
       
   130 #endif // __GLX_WNDWCONNECTION_MONITOR_H__