commsconfig/cscengine/inc/cscengconnectionhandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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:  For handling interactions betweed UI and RConnection.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CSCENGCONNECTIONHANDLER_H
       
    21 #define C_CSCENGCONNECTIONHANDLER_H
       
    22 
       
    23 #include <in_sock.h>
       
    24 #include <es_sock.h>
       
    25 #include <es_enum.h>
       
    26 
       
    27 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    28 #include <es_enum_internal.h>
       
    29 #endif
       
    30 
       
    31 #include "mcscengtimerobserver.h"
       
    32 
       
    33 class CCSCEngTimer;
       
    34 class MCSCEngConnectionObserver;
       
    35 
       
    36 /**
       
    37  * An instance of CCSCEngConnectionHandler
       
    38  * For handling interactions betweed UI and RConnection.
       
    39  *
       
    40  * @lib cscengine.lib
       
    41  * @since Series 60 3.2
       
    42  */
       
    43 NONSHARABLE_CLASS( CCSCEngConnectionHandler ) : public CActive,
       
    44                                                 public MCSCEngTimerObserver
       
    45     {    
       
    46     public:
       
    47         
       
    48         /**
       
    49          * Enumeration for connection events
       
    50          */
       
    51         enum TConnectionEvent
       
    52             {
       
    53             EEventConnectionDown = 0,
       
    54             EEventTimedOut
       
    55             };
       
    56                 
       
    57         /**
       
    58          * Two-phased constructor.
       
    59          */ 
       
    60         IMPORT_C static CCSCEngConnectionHandler* NewL( 
       
    61             MCSCEngConnectionObserver& aObserver );
       
    62 
       
    63 
       
    64         /**
       
    65          * Destructor.
       
    66          */
       
    67         IMPORT_C virtual ~CCSCEngConnectionHandler();
       
    68         
       
    69         
       
    70         /**
       
    71          * Start listening connection events
       
    72          * 
       
    73          * @since S60 v3.2
       
    74          */
       
    75         IMPORT_C void StartListeningConnectionEvents();
       
    76         
       
    77         
       
    78         /**
       
    79          * Stop listening connection events
       
    80          * 
       
    81          * @since S60 v3.2
       
    82          */
       
    83         IMPORT_C void StopListeningConnectionEvents();
       
    84         
       
    85         
       
    86         // from base class MCSCEngTimerObserver
       
    87         
       
    88         /**
       
    89         * Called on timer expiration.
       
    90         *
       
    91         * @since S60 v3.2
       
    92         */
       
    93        void TimerExpired();
       
    94 
       
    95 
       
    96     protected: 
       
    97     
       
    98         // from base class CActive
       
    99         
       
   100         /**
       
   101          * From CActive.
       
   102          */
       
   103         void RunL();
       
   104         
       
   105         
       
   106         /**
       
   107          * From CActive.
       
   108          */
       
   109         void DoCancel();
       
   110 
       
   111                
       
   112     private:
       
   113 
       
   114         CCSCEngConnectionHandler( 
       
   115             MCSCEngConnectionObserver& aObserver );
       
   116 
       
   117         void ConstructL();
       
   118         
       
   119            
       
   120     private:  // data
       
   121         
       
   122         /**
       
   123          * Pointer to CSCEngTimer.
       
   124          * Own.
       
   125          */
       
   126         CCSCEngTimer* iTimer;
       
   127     
       
   128         /**
       
   129          * Reference for observer.
       
   130          */
       
   131         MCSCEngConnectionObserver& iObserver;
       
   132         
       
   133         /**
       
   134          * RConnection.
       
   135          */
       
   136         RConnection iConnection;
       
   137         
       
   138         /**
       
   139          * Socket server.
       
   140          */
       
   141         RSocketServ iSocketServ;
       
   142                 
       
   143         /**
       
   144          * Interface notifiaction buffer
       
   145          */
       
   146         TInterfaceNotificationBuf iInfoBuf;
       
   147         
       
   148 #ifdef _DEBUG
       
   149     friend class UT_CSCEngConnectionHandler;
       
   150 #endif   
       
   151     };
       
   152 
       
   153 #endif // C_CSCENGCONNECTIONHANDLER_H