natplugins/natpnatfwsdpprovider/inc/nspactive.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 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:  Timer objects for NAT FW SDP Provider
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NSPACTIVE_H
       
    19 #define NSPACTIVE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "mnatfwconnectivityobserver.h"
       
    23 
       
    24 class CSdpDocument;
       
    25 class CNSPController;
       
    26 
       
    27 /**
       
    28  *  Simple timer for NSP, also initiates UpdateSdp callbacks.
       
    29  *
       
    30  *  Class implements simple timer that is used as a waiting timer for
       
    31  *  FetchCandidate(s)L async NAT FW calls. If expected objects are not
       
    32  *  received in time, then session is continued, if possible.
       
    33  *
       
    34  *  @lib natfwsdpprovider.dll
       
    35  *  @since S60 3.2
       
    36  */
       
    37 class CNSPActive : public CActive
       
    38     {
       
    39 public: // Constructors and destructor
       
    40 
       
    41     /**
       
    42      * A two-phase constructor.
       
    43      */
       
    44     static CNSPActive* NewL( CNSPController& aController,
       
    45             TUint aSessionId, TUint aStreamId, TUint aTransactionId,
       
    46             MNATFWConnectivityObserver::TNATFWConnectivityEvent aEvent,
       
    47             TUint aTimerInMicroSeconds, CSdpDocument* aDocument = NULL );
       
    48     
       
    49     /**
       
    50      * A two-phase constructor.
       
    51      */
       
    52     static CNSPActive* NewLC( CNSPController& aController,
       
    53             TUint aSessionId, TUint aStreamId, TUint aTransactionId,
       
    54             MNATFWConnectivityObserver::TNATFWConnectivityEvent aEvent,
       
    55             TUint aTimerInMicroSeconds, CSdpDocument* aDocument = NULL );
       
    56     
       
    57     /**
       
    58      * Destructor.
       
    59      */
       
    60     virtual ~CNSPActive();
       
    61 
       
    62 
       
    63 private: // Constructors and destructor
       
    64 
       
    65     CNSPActive( CNSPController& aController, 
       
    66                 TUint aSessionId, TUint aStreamId, TUint aTransactionId,
       
    67                 MNATFWConnectivityObserver::TNATFWConnectivityEvent aEvent,
       
    68                 CSdpDocument* aDocument = NULL );
       
    69     
       
    70     void ConstructL( TUint aTimerInMicroSeconds );
       
    71 
       
    72 
       
    73 public: // From CActive
       
    74 
       
    75     /**
       
    76      * See base class.
       
    77      */
       
    78     void RunL();
       
    79     
       
    80     /**
       
    81      * See base class.
       
    82      */
       
    83     void DoCancel();
       
    84     
       
    85     /**
       
    86      * See base class.
       
    87      */
       
    88     TInt RunError( TInt aError );
       
    89 
       
    90 
       
    91 public: // New functions
       
    92 
       
    93     /**
       
    94      * Returns session identifier, used to map to correct session.
       
    95      *
       
    96      * @since           S60 3.2
       
    97      * @return          The session identifier
       
    98      */
       
    99     TUint SessionId() const;
       
   100     
       
   101     /**
       
   102      * Returns transaction identifier, used to map to correct transaction.
       
   103      *
       
   104      * @since           S60 3.2
       
   105      * @return          The transaction identifier.
       
   106      */
       
   107     TUint TransactionId() const;
       
   108 
       
   109 
       
   110 private: // data
       
   111 
       
   112     /**
       
   113      * Handle to timer resource
       
   114      */
       
   115     RTimer iTimer;
       
   116 
       
   117     /**
       
   118      * Controller object reference
       
   119      */
       
   120     CNSPController& iController;
       
   121     
       
   122     /**
       
   123      * Session identifier.
       
   124      */
       
   125     TUint iSessionId;
       
   126     
       
   127     /**
       
   128      * Stream identifier.
       
   129      */
       
   130     TUint iStreamId;
       
   131     
       
   132     /**
       
   133      * transaction identifier
       
   134      */
       
   135     TUint iTransactionId;
       
   136     
       
   137     /**
       
   138      * NAT FW event type
       
   139      */
       
   140     MNATFWConnectivityObserver::TNATFWConnectivityEvent iEvent;
       
   141     
       
   142     /**
       
   143      * Sdp document.
       
   144      * Own.
       
   145      */ 
       
   146     CSdpDocument* iDocument;
       
   147     
       
   148     };
       
   149 
       
   150 #endif // NSPACTIVE_H
       
   151 
       
   152 // end of file