wvuing/IMPSConnectionUI/OperationStepSrc/CCnUiNWDisconnectUiCntrlStep.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Network connection close UI control.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUINWDISCONNECTUICNTRLSTEP_H
       
    19 #define __CCNUINWDISCONNECTUICNTRLSTEP_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Std.h>
       
    23 #include <impspresenceconnectionuiconstsng.h>
       
    24 #include "CCnUiLogoutUiCntrlStep.h"
       
    25 
       
    26 
       
    27 //FORWARD DECLARATION
       
    28 class CIMPSSAPSettings;
       
    29 class CPEngNWSessionSlotID2;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 /**
       
    34  * Network connection close UI control.
       
    35  * Closes network connection by issuing logout
       
    36  * one by one for each logged in client.
       
    37  *
       
    38  * Extends CCnUiLogoutUiCntrlStep behaviour
       
    39  * by looping back from HandleCompleteL()
       
    40  * after each client logout.
       
    41  *
       
    42  * @since 2.1
       
    43  */
       
    44 NONSHARABLE_CLASS( CCnUiNWDisconnectUiCntrlStep ) : public CCnUiLogoutUiCntrlStep
       
    45     {
       
    46 public:  // Two-phased constructors and destructor
       
    47 
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      * @param aCCntxt UI control context.
       
    51      * @param aLogoutSap The SAP that was logouted.
       
    52      * @param aDisconnectedClients During client logout,
       
    53      * logouted client id's are appended to this array.
       
    54      * So after whole control execution, this array will
       
    55      * contain the clients which were logged out.
       
    56      * @param aMainLevelOperation ETrue if this operation is carried
       
    57      * on main level, else EFalse (Operation is a sub operation for login).
       
    58      */
       
    59     static CCnUiNWDisconnectUiCntrlStep* NewLC(
       
    60         MCnUiUiControlContext& aCCntxt,
       
    61         CIMPSSAPSettings& aLogoutSap,
       
    62         RArray< TIMPSConnectionClient >& aDisconnectedClients,
       
    63         TBool aMainLevelOperation,
       
    64         const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    65 
       
    66     /**
       
    67      * Destructor.
       
    68      */
       
    69     virtual ~CCnUiNWDisconnectUiCntrlStep();
       
    70 
       
    71 
       
    72 protected: //protected to allow derivation
       
    73 
       
    74     /**
       
    75      * C++ constructor.
       
    76      */
       
    77     CCnUiNWDisconnectUiCntrlStep( MCnUiUiControlContext& aCCntxt,
       
    78                                   CIMPSSAPSettings& aLogoutSap,
       
    79                                   RArray< TIMPSConnectionClient >& aDisconnectedClients,
       
    80                                   TBool aMainLevelOperation );
       
    81 
       
    82     /**
       
    83      * Symbian OS constructor.
       
    84      */
       
    85     void ConstructL( const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    86 
       
    87 
       
    88 
       
    89 public: // Overridden functions from MCnUiCntrlStep
       
    90 
       
    91 
       
    92     /**
       
    93      * Overridden HandleCompleteL().
       
    94      * Appends the logged out client to
       
    95      * parameter aDisconnectedClients array.
       
    96      *
       
    97      * If there is still more clients to logout,
       
    98      * issues a new round.
       
    99      *
       
   100      * @since 2.1
       
   101      * @return ECnUiRestartSte if there is another clients to disconnect.
       
   102      * Else ECnUiStepContinueTeardown.
       
   103      */
       
   104     TCnUiHandleCompleteStatus HandleCompleteL();
       
   105 
       
   106 
       
   107     /**
       
   108      * Undo step.
       
   109      *
       
   110      * @since 2.1
       
   111      */
       
   112     void UndoStepL();
       
   113 
       
   114 
       
   115 protected: // Over written framework methods
       
   116 
       
   117     /**
       
   118      * Over written framework method.
       
   119      *
       
   120      * Setups the disconnect step as needed.
       
   121      *
       
   122      * @since 2.1
       
   123      *
       
   124      * @param aClient Init has to initialize the aClient
       
   125      * with the client id to log out.
       
   126      *
       
   127      * @return Error status from init. If init returns something
       
   128      * else  than ECnUiLogoutInitContinue login operation RunStepL()
       
   129      * is breaked with return value.
       
   130      */
       
   131     TInt DoInitLogoutStepL( TIMPSConnectionClient& aClient );
       
   132 
       
   133 
       
   134     /**
       
   135      * Over written framework method.
       
   136      *
       
   137      * Shows a proper note for
       
   138      * successful logout.
       
   139      *
       
   140      * @since 2.1
       
   141      * @param aClient The accessed client.
       
   142      */
       
   143     void DoShowLogoutOkNoteL( TIMPSConnectionClient aClient );
       
   144 
       
   145 
       
   146 protected: // New helper functions
       
   147 
       
   148     /**
       
   149      * Initializes the disconnect.
       
   150      * Gets the SAP o disconnect and
       
   151      * populates the clients to logout.
       
   152      *
       
   153      * @since 2.1
       
   154      */
       
   155     void InitNWDisconnectL();
       
   156 
       
   157 
       
   158 
       
   159 private: // private data
       
   160 
       
   161     ///<Cached reference to aDisconnectedClients parameter, not owned
       
   162     RArray< TIMPSConnectionClient >& iRequestedDisconnClients;
       
   163 
       
   164     ///<Is this mainlevel operation or not,oned
       
   165     TBool                            iMainlevelOperation;
       
   166 
       
   167     ///<Has the disconnect initialization done, owned
       
   168     TBool                            iInitDone;
       
   169 
       
   170     ///<Clients to disconnect, owned
       
   171     RArray< TIMPSConnectionClient >  iClientsToDisconn;
       
   172 
       
   173     };
       
   174 
       
   175 #endif      //  __CCNUINWDISCONNECTUICNTRLSTEP_H
       
   176 
       
   177 //  End of File
       
   178