nettools/conntest/inc/ProgressNotifier.h
changeset 0 857a3e953887
equal deleted inserted replaced
-1:000000000000 0:857a3e953887
       
     1 /*
       
     2 * Copyright (c) 2006 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: CProgressNotifier is used to notify about 
       
    15 * the current state of the request
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __PROGRESSNOTIFIER_H__
       
    20 #define __PROGRESSNOTIFIER_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <in_sock.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MProgressNotifyHandler;
       
    27 
       
    28 /**
       
    29 * Class for receiving notifications from interfaces.
       
    30 * Notifications are handled by the class, that implements
       
    31 * MProgressNotifyHandler interface.
       
    32 */
       
    33 class CProgressNotifier : public CActive
       
    34 {
       
    35 public: // new methods
       
    36     
       
    37     /**
       
    38     * Two-phased constructor.
       
    39     */
       
    40     static CProgressNotifier* NewL(RConnection& aConnection, MProgressNotifyHandler& aHandler);
       
    41     
       
    42     /**
       
    43     * Two-phased constructor.
       
    44     */
       
    45     static CProgressNotifier* NewLC(RConnection& aConnection, MProgressNotifyHandler& aHandler);
       
    46     
       
    47     /**
       
    48     * Destroy the object and release all memory objects
       
    49     */
       
    50     ~CProgressNotifier();
       
    51     
       
    52     /**
       
    53     * Start waiting for the progress notifications.
       
    54     */
       
    55     void StartNotify();
       
    56 
       
    57     /**
       
    58     * Reads the current stage of the interface when 
       
    59     * the progress notification is received, and issues
       
    60     * a new progress notification request.
       
    61     */
       
    62     void NotifyL();
       
    63     
       
    64 protected: // from CActive
       
    65 
       
    66     /**
       
    67     * Called when operation complete
       
    68     */
       
    69     void RunL();
       
    70 
       
    71     /**
       
    72     * Cancel any outstanding operation
       
    73     */
       
    74     void DoCancel();
       
    75     
       
    76 private: // New methods
       
    77     
       
    78     /**
       
    79     * Perform the first phase of two phase construction 
       
    80     */
       
    81     CProgressNotifier(RConnection& aConnection, MProgressNotifyHandler& aHandler);
       
    82     
       
    83     /**
       
    84     * Perform the second phase construction of two phase construction
       
    85     */
       
    86     void ConstructL();
       
    87     
       
    88 private:
       
    89     // Member variables
       
    90     RConnection&                iConnection;
       
    91     MProgressNotifyHandler&     iHandler;
       
    92     TNifProgressBuf             iProgressBuf;
       
    93 };
       
    94 
       
    95 #endif // __PROGRESSNOTIFIER_H__
       
    96