natfw/natfwclient/inc/mnatfwpluginobserver.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:    Callback hook for the plug-ins to the client
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_MNATFWPLUGINONSERVER_H
       
    22 #define M_MNATFWPLUGINONSERVER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class CNATFWPluginApi;
       
    27 class CNATFWCandidatePair;
       
    28 class CNATFWCandidate;
       
    29 
       
    30 /**
       
    31  *  Observer interface for clients to receive events from NAT-plugin.
       
    32  *
       
    33  *  @lib natconfw.lib
       
    34  *  @since S60 v3.2
       
    35  */
       
    36 class MNATFWPluginObserver
       
    37     {
       
    38 
       
    39 public:
       
    40     
       
    41     /** NAT-plugin events. */
       
    42     enum TNATFWPluginEvent
       
    43         {
       
    44         /** Completing event for ConnectServerL. */
       
    45         EServerConnected        = 1,
       
    46         
       
    47         /** Completing event for FetchCandidate(s). */
       
    48         EFetchingCompleted      = 2,
       
    49         
       
    50         /** Completing event for SetupTcpConnectionL. */
       
    51         ETcpConnSetupCompleted  = 3,
       
    52         
       
    53         /** Completing event for SetReceivingStateL. */
       
    54         EReceivingActivated     = 4,
       
    55         
       
    56         /** Completing event for SetReceivingStateL. */
       
    57         EReceivingDeactivated   = 5,
       
    58         
       
    59         /** Completing event for SetSendingStateL. */
       
    60         ESendingActivated       = 6,
       
    61         
       
    62         /** Completing event for SetSendingStateL. */
       
    63         ESendingDeactivated     = 7,
       
    64         
       
    65         /** Completing event for PerformConnectivityChecksL. */
       
    66         EConnChecksCompleted    = 8
       
    67         };
       
    68     
       
    69     /**
       
    70      * Called when an error within a stream has occured and no
       
    71      * asynchronous operation is ongoing. Error during asynchronous
       
    72      * operation is reported by completing operation with error code.
       
    73      * 
       
    74      * @since   S60 v3.2
       
    75      * @param   aPlugin         The plugin raising event
       
    76      * @param   aStreamId       The ID identifying stream
       
    77      * @param   aErrorCode      Standard system wide error code
       
    78      */
       
    79     virtual void Error( const CNATFWPluginApi& aPlugin,
       
    80         TUint aStreamId, TInt aErrorCode ) = 0;
       
    81     
       
    82     /**
       
    83      * Notifies the client of plugin events.
       
    84      *
       
    85      * @since   S60 v3.2
       
    86      * @param   aPlugin         The plugin raising event
       
    87      * @param   aStreamId       The ID identifying stream
       
    88      * @param   aEvent          The event
       
    89      * @param   aErrCode        Standard system wide error code
       
    90      */
       
    91     virtual void Notify( const CNATFWPluginApi& aPlugin,
       
    92         TUint aStreamId, TNATFWPluginEvent aEvent, TInt aErrCode ) = 0;
       
    93     
       
    94     /**
       
    95      * Called when working candidate pair has been found. Ownership of
       
    96      * the candidate pair is transferred.
       
    97      *
       
    98      * @since   S60 v3.2
       
    99      * @param   aPlugin         The plugin raising event
       
   100      * @param   aCandidatePair  The candidate pair which was found
       
   101      */
       
   102     virtual void NewCandidatePairFound( const CNATFWPluginApi& aPlugin,
       
   103         CNATFWCandidatePair* aCandidatePair ) = 0;
       
   104     
       
   105     /**
       
   106      * Called when a new local candidate has been found. Ownership of the
       
   107      * candidate is transferred.
       
   108      *
       
   109      * @since   S60 v3.2
       
   110      * @param   aPlugin         The plugin raising event
       
   111      * @param   aCandidate      The local candidate that was found
       
   112      */
       
   113     virtual void NewLocalCandidateFound( const CNATFWPluginApi& aPlugin,
       
   114         CNATFWCandidate* aCandidate ) = 0;
       
   115     };
       
   116 
       
   117 
       
   118 #endif // M_MNATFWPLUGINONSERVER_H