multimediacommscontroller/mmccsubcontroller/inc/mccqoseventmonitor.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006-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:    Class definition for the MCC QoS Event Monitor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCQOSEVENTMONITOR_H
       
    22 #define MCCQOSEVENTMONITOR_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <es_sock.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MMccQosEventObserver;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  *  CMccQosEventMonitor for handling events from RSubConnection
       
    35  *
       
    36  *  CMccQosEventMonitor receives subconnection(Qos) events from RSubConnection
       
    37  *  class. Events are delivered to MCC subcontroller as callbacks.
       
    38  *
       
    39  *  @lib mccqosplugin.lib
       
    40  *  @since S60 3.1
       
    41  */
       
    42 NONSHARABLE_CLASS( CMccQosEventMonitor ) : public CActive
       
    43     {
       
    44 #ifdef TEST_EUNIT
       
    45     friend class UT_CMccQosEventMonitor;
       
    46 #endif
       
    47     
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Create a CMccQosEventMonitor object using two phase construction,
       
    52      * and return a pointer to the created object.
       
    53      *
       
    54      * @since S60 3.1
       
    55      * @param aObserver observer to asynchronous completion
       
    56      * @param handle to RSubConnection object
       
    57      * @return  Instance of class interface
       
    58      */
       
    59     static CMccQosEventMonitor* NewL( MMccQosEventObserver& aObserver, 
       
    60         RSubConnection& aSubConnection );
       
    61 
       
    62     /**
       
    63      * Create a CMccQosEventMonitor object using two phase construction,
       
    64      * and return a pointer to the created object.
       
    65      *
       
    66      * @since S60 3.1
       
    67      * @param aObserver observer to asynchronous completion
       
    68      * @param handle to RSubConnection object
       
    69      * @return  Instance of class interface
       
    70      */
       
    71     static CMccQosEventMonitor* NewLC( MMccQosEventObserver& aObserver, 
       
    72         RSubConnection& aSubConnection );
       
    73 
       
    74     /**
       
    75      * Destructor
       
    76      *
       
    77      * @return void
       
    78      */
       
    79     virtual ~CMccQosEventMonitor();
       
    80 
       
    81 protected: // from CActive
       
    82 
       
    83     /**
       
    84      * Callback function. Invoked to handle responses from the server.
       
    85      *
       
    86      * @return void
       
    87      */
       
    88     void RunL();
       
    89 
       
    90     /**
       
    91      * Cancel any outstanding operation.
       
    92      *
       
    93      * @return void
       
    94      */
       
    95     void DoCancel();
       
    96     
       
    97     /**
       
    98      * RunL error handling
       
    99      *
       
   100      * @return TInt System-wide error code
       
   101      */
       
   102     TInt RunError( TInt aError );
       
   103 
       
   104 private:
       
   105 
       
   106     /**
       
   107      * Perform the first phase of two phase construction.
       
   108      *
       
   109      * @since S60 3.1
       
   110      * @param aObserver observer to asynchronous completion
       
   111      * @param handle to RSubConnection object
       
   112      * @return void
       
   113      */
       
   114     CMccQosEventMonitor( MMccQosEventObserver& aObserver, 
       
   115         RSubConnection& aSubConnection );
       
   116         
       
   117     /**
       
   118      * By default Symbian 2nd phase constructor is private.
       
   119      *
       
   120      * @since S60 v3.1
       
   121      * @return void
       
   122      */
       
   123     void ConstructL();
       
   124     
       
   125     /**
       
   126      * Set active object active and start listening for QoS events
       
   127      * from RSubConnection.
       
   128      *
       
   129      * @since S60 3.1
       
   130      * @return void
       
   131      */
       
   132     void StartListenL();
       
   133 
       
   134 private: // data
       
   135 
       
   136     /**
       
   137      * Observer to report QoS status/error information
       
   138      */
       
   139     MMccQosEventObserver& iEventObserver;
       
   140 
       
   141     /**
       
   142      * Buffer for QoS events
       
   143      */
       
   144     TNotificationEventBuf iQoSNotifBuffer;
       
   145 
       
   146     /**
       
   147      * Reference to current subconnection Handle
       
   148      */
       
   149     RSubConnection& iSubConnection;
       
   150 
       
   151     /**
       
   152      * Last error reported from RSubConnection channel
       
   153      */
       
   154     TInt iLastError;
       
   155 
       
   156     };
       
   157 
       
   158 #endif      // MCCQOSEVENTMONITOR_H
       
   159 
       
   160 // End of File