wvuing/IMPSConnectionUI/ServiceSrc/CCnUiConnectionHandler.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:  Connection handler implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUICONNECTIONHANDLER_H
       
    19 #define __CCNUICONNECTIONHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include "MCnUiConnectionHandler.h"
       
    24 
       
    25 
       
    26 
       
    27 //FORWARD DECLARATION
       
    28 class CIMPSSAPSettings;
       
    29 class MCnUiClientStatusHandler;
       
    30 class CCnUiSapStoreProxy;
       
    31 class CPEngNWSessionSlot2;
       
    32 class CPEngNWSessionSlotID2;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36  * Connection handler implementation.
       
    37  *
       
    38  * @since 2.1
       
    39  */
       
    40 NONSHARABLE_CLASS( CCnUiConnectionHandler ) : public CBase,
       
    41         public MCnUiConnectionHandler
       
    42     {
       
    43 public:  // Two-phased constructors and destructor
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * @param aSapProxy The SAP store proxy to use.
       
    48      */
       
    49     static CCnUiConnectionHandler* NewL( CCnUiSapStoreProxy& aSapProxy );
       
    50 
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CCnUiConnectionHandler();
       
    56 
       
    57 
       
    58 private:
       
    59 
       
    60     /**
       
    61      * C++ constructor.
       
    62      */
       
    63     CCnUiConnectionHandler( CCnUiSapStoreProxy& aSapProxy );
       
    64 
       
    65 
       
    66     /**
       
    67      * Symbian OS constructor.
       
    68      */
       
    69     void ConstructL();
       
    70 
       
    71 
       
    72 
       
    73 public: // New SAP connection related functions from MCnUiConnectionHandler
       
    74 
       
    75     /**
       
    76      * From MCnUiConnectionHandler.
       
    77      * See it for details.
       
    78      *
       
    79      * @since 2.1
       
    80      */
       
    81     void OpenSapConnectionL( const CIMPSSAPSettings& aSapToLogin,
       
    82                              CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    83                              MPEngNWSessionOperationObserver2& aSlotOperationObserver );
       
    84 
       
    85     /**
       
    86      * From MCnUiConnectionHandler.
       
    87      * See it for details.
       
    88      *
       
    89      * @since 2.1
       
    90      */
       
    91     void CancelSapConnectionOpen( CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    92 
       
    93 
       
    94     /**
       
    95      * From MCnUiConnectionHandler.
       
    96      * See it for details.
       
    97      *
       
    98      * @since 2.1
       
    99      */
       
   100     void CloseSapConnectionL( CPEngNWSessionSlotID2& aNWSessionSlotID,
       
   101                               MPEngNWSessionOperationObserver2& aSlotOperationObserver );
       
   102 
       
   103 
       
   104     /**
       
   105      * From MCnUiConnectionHandler.
       
   106      * See it for details.
       
   107      *
       
   108      * @since 2.1
       
   109      */
       
   110     void CancelSapConnectionClose( CPEngNWSessionSlotID2& aNWSessionSlotID );
       
   111 
       
   112 
       
   113 public: // New client login related functions from MCnUiConnectionHandler
       
   114 
       
   115     /**
       
   116      * From MCnUiConnectionHandler.
       
   117      * See it for details.
       
   118      *
       
   119      * @since 2.1
       
   120      */
       
   121     void LoginTheClientL( TIMPSConnectionClient aClient );
       
   122 
       
   123     /**
       
   124      * From MCnUiConnectionHandler.
       
   125      * See it for details.
       
   126      *
       
   127      * @since 2.1
       
   128      */
       
   129     void LogoutTheClientL( TIMPSConnectionClient aClient );
       
   130 
       
   131 
       
   132 public: // New status getters from MCnUiConnectionHandler
       
   133 
       
   134     /**
       
   135      * From MCnUiConnectionHandler.
       
   136      * See it for details.
       
   137      *
       
   138      * @since 2.1
       
   139      */
       
   140     TBool TheClientLoggedInL( TIMPSConnectionClient aClient );
       
   141 
       
   142 
       
   143     /**
       
   144      * From MCnUiConnectionHandler.
       
   145      * See it for details.
       
   146      *
       
   147      * @since 2.1
       
   148      */
       
   149     void GetLoggedInClientsL( RArray< TIMPSConnectionClient >& aClients );
       
   150 
       
   151     /**
       
   152      * From MCnUiConnectionHandler.
       
   153      * See it for details.
       
   154      *
       
   155      * @since 2.1
       
   156      */
       
   157     TBool GetLoggedInSapL( CIMPSSAPSettings& aSap, TIMPSConnectionClient aClient );
       
   158 
       
   159 
       
   160     /**
       
   161      * From MCnUiConnectionHandler.
       
   162      * See it for details.
       
   163      *
       
   164      * @since 2.1
       
   165      */
       
   166     TCnUiSapCnStatus SapConnectionStatusL( const CIMPSSAPSettings& aSap,
       
   167                                            TIMPSConnectionClient aClient );
       
   168 
       
   169 
       
   170     /**
       
   171      * From MCnUiConnectionHandler.
       
   172      * See it for details.
       
   173      *
       
   174      * @since 2.1
       
   175      */
       
   176     TBool NwConnectionActiveL( CPEngNWSessionSlotID2& aIdToMatch );
       
   177 
       
   178 
       
   179     /**
       
   180      * From MCnUiConnectionHandler.
       
   181      * See it for details.
       
   182      *
       
   183      * @since 2.1
       
   184      */
       
   185     TPEngNWSessionSlotState ServiceStatusL( const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
   186 
       
   187 
       
   188     /**
       
   189      * Sets the given client as logged out.
       
   190      *
       
   191      * @since 3.0
       
   192      * @param aClient The client to logout.
       
   193      */
       
   194     void SetSessionSlotL( CPEngNWSessionSlot2* aSlot );
       
   195 
       
   196 
       
   197 private: // New helpers
       
   198     /**
       
   199       * Gets the corresponding network session slot for a slot ID
       
   200       *
       
   201       * @since 3.0
       
   202       * @param aNWSessionSlotID the network session slot ID
       
   203       * @return the network session slot
       
   204       */
       
   205     CPEngNWSessionSlot2* NetworkSessionSlotForIDL(
       
   206         const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
   207 
       
   208     /**
       
   209     * Calls ResetAndDestroy to given array
       
   210     * @since 3.0
       
   211     * @param aObject Array (RPointerArray<CPEngNWSessionSlotID2>)
       
   212     */
       
   213     static void DestroyCloseModelArray( TAny* aObject );
       
   214 
       
   215 private: // data
       
   216 
       
   217     ///<Client login status handler, owned
       
   218     MCnUiClientStatusHandler*               iClientStatusHandler;
       
   219 
       
   220     ///<SAP stettings store proxy, not owned
       
   221     CCnUiSapStoreProxy&                     iSapProxy;
       
   222 
       
   223     // owns: the network session slot ID
       
   224     CPEngNWSessionSlotID2*                  iNWSessionSlotID;
       
   225 
       
   226     CPEngNWSessionSlot2*                    iNWSessionSlot;
       
   227 
       
   228     };
       
   229 
       
   230 #endif      //  __CCNUICONNECTIONHANDLER_H
       
   231 
       
   232 //  End of File
       
   233