wvuing/IMPSConnectionUI/ServiceInc/MCnUiConnectionHandler.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 interface.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MCNUICONNECTIONHANDLER_H
       
    19 #define __MCNUICONNECTIONHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <PEngPresenceEngineConsts2.h>
       
    24 #include <impspresenceconnectionuiconstsng.h>
       
    25 
       
    26 
       
    27 
       
    28 //FORWARD DECLARATION
       
    29 class CCnUiSapStoreProxy;
       
    30 class CIMPSSAPSettings;
       
    31 class MCnUiConnectionHandler;
       
    32 class CPEngNWSessionSlotID2;
       
    33 class CPEngNWSessionSlot2;
       
    34 class MPEngNWSessionOperationObserver2;
       
    35 
       
    36 //DATA TYPES
       
    37 /**
       
    38  * Sap connection status.
       
    39  *
       
    40  * @since 2.1
       
    41  */
       
    42 enum TCnUiSapCnStatus
       
    43     {
       
    44     ECnUiSCS_NotConnected = 0,
       
    45     ECnUiSCS_SapConnected = 1,
       
    46     ECnUiSCS_SapConnected_PwdMissMatch = 2,
       
    47     ECnUiSCS_AnotherSapConnected = 3,
       
    48     ECnUiSCS_AnotherSapConnected_ClientsNotKnown = 4
       
    49     };
       
    50 
       
    51 
       
    52 /**
       
    53  * Factory method for connection handler construction.
       
    54  *
       
    55  * Global factory method to create concrete
       
    56  * connection handler.
       
    57  *
       
    58  * @since 2.1
       
    59  * @param aSapProxy The SAP store proxy to use.
       
    60  * @return New MCnUiConnectionHandler instance.
       
    61   */
       
    62 GLREF_D MCnUiConnectionHandler* CreateConnHandlerL( CCnUiSapStoreProxy& aSapProxy );
       
    63 
       
    64 
       
    65 
       
    66 
       
    67 // CLASS DECLARATION
       
    68 /**
       
    69  * Connection Handler.
       
    70  *
       
    71  * Abstract interface to to handle connections
       
    72  * and client logins.
       
    73  *
       
    74  * @since 2.1
       
    75  */
       
    76 NONSHARABLE_CLASS( MCnUiConnectionHandler )
       
    77     {
       
    78 public: // SAP connection mutators
       
    79 
       
    80     /**
       
    81      * Opens the SAP connection.
       
    82      *
       
    83      * @since 2.1
       
    84      * @param aSapToLogin The SAP where to login.
       
    85      * @param aStatus Request status to complete
       
    86      * when connection open is done.
       
    87      */
       
    88     virtual void OpenSapConnectionL(
       
    89         const CIMPSSAPSettings& aSapToLogin,
       
    90         CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    91         MPEngNWSessionOperationObserver2& aSlotOperationObserver ) = 0;
       
    92 
       
    93     /**
       
    94      * Cancels the SAP connection open.
       
    95      *
       
    96      * @since 2.1
       
    97      */
       
    98     virtual void CancelSapConnectionOpen( CPEngNWSessionSlotID2& aNWSessionSlotID ) = 0;
       
    99 
       
   100 
       
   101     /**
       
   102      * Closes the SAP connection.
       
   103      *
       
   104      * @since 2.1
       
   105      */
       
   106     virtual void CloseSapConnectionL(
       
   107         CPEngNWSessionSlotID2& aNWSessionSlotID,
       
   108         MPEngNWSessionOperationObserver2& aSlotOperationObserver ) = 0;
       
   109 
       
   110 
       
   111     /**
       
   112      * Cancels the SAP connection close.
       
   113      *
       
   114      * @since 2.1
       
   115      */
       
   116     virtual void CancelSapConnectionClose( CPEngNWSessionSlotID2& aNWSessionSlotID ) = 0;
       
   117 
       
   118 
       
   119 public: // Client login mutators
       
   120 
       
   121     /**
       
   122      * Sets the given client as logged in.
       
   123      *
       
   124      * @since 2.1
       
   125      * @param aClient The client to login.
       
   126      */
       
   127     virtual void LoginTheClientL( TIMPSConnectionClient aClient ) = 0;
       
   128 
       
   129 
       
   130     /**
       
   131      * Sets the given client as logged out.
       
   132      *
       
   133      * @since 2.1
       
   134      * @param aClient The client to logout.
       
   135      */
       
   136     virtual void LogoutTheClientL( TIMPSConnectionClient aClient ) = 0;
       
   137 
       
   138 
       
   139     /**
       
   140      * Sets the session slot.
       
   141      * Note, that if successfull, ownership is transferred away from caller.
       
   142      *
       
   143      * @since 3.0
       
   144      * @param aClient The client to logout.
       
   145      */
       
   146     virtual void SetSessionSlotL( CPEngNWSessionSlot2* aSlot ) = 0;
       
   147 
       
   148 public: // Status getters
       
   149 
       
   150     /**
       
   151      * Checks is the client logged in.
       
   152      *
       
   153      * @since 2.1
       
   154      * @param aClient The client to check.
       
   155      * @return ETrue if the client is logged in. Else EFalse.
       
   156      */
       
   157     virtual TBool TheClientLoggedInL( TIMPSConnectionClient aClient ) = 0;
       
   158 
       
   159 
       
   160     /**
       
   161      * Gets the logged in clients.
       
   162      *
       
   163      * @since 2.1
       
   164      * @param aClients The array to put logged in clients.
       
   165      */
       
   166     virtual void GetLoggedInClientsL( RArray< TIMPSConnectionClient >& aClients ) = 0;
       
   167 
       
   168 
       
   169     /**
       
   170      * Getter for currently logged in SAP.
       
   171      *
       
   172      * Gets currently logged in SAP. If not
       
   173      * currently logged in returns EFalse.
       
   174      * Else returns ETrue and aSap is set to
       
   175      * contain currently logged SAP's data.
       
   176      *
       
   177      * @since 2.1
       
   178      * @param aSap When logged in, the SAP is filled
       
   179      * with logged in SAP's details.
       
   180      * @return Login status.
       
   181      */
       
   182     virtual TBool GetLoggedInSapL( CIMPSSAPSettings& aSap, TIMPSConnectionClient aClient ) = 0;
       
   183 
       
   184 
       
   185     /**
       
   186      * Gets SAP connection status.
       
   187      *
       
   188      * @since 2.1
       
   189      * @param aSap The SAP to check.
       
   190      * @return SAP connection status from TCnUiSapCnStatus.
       
   191      */
       
   192     virtual TCnUiSapCnStatus SapConnectionStatusL( const CIMPSSAPSettings& aSap,
       
   193                                                    TIMPSConnectionClient aClient ) = 0;
       
   194 
       
   195 
       
   196     /**
       
   197      * Checks is there active network connection
       
   198      * or not. Uses the pattern matching of
       
   199      * network session slot ID. Assumes either
       
   200      * full ID or just application ID.
       
   201      *
       
   202      * @since 2.1
       
   203      * @return ETrue if there is a active NW connection.
       
   204      * Else EFalse.
       
   205      */
       
   206     virtual TBool NwConnectionActiveL( CPEngNWSessionSlotID2& aIdToMatch ) = 0;
       
   207 
       
   208 
       
   209     /**
       
   210      * Gets service status from PEC Engine.
       
   211      *
       
   212      * @since 2.1
       
   213      * @return Current service status.
       
   214      */
       
   215     virtual TPEngNWSessionSlotState ServiceStatusL(
       
   216         const CPEngNWSessionSlotID2& aNWSessionSlotID ) = 0;
       
   217 
       
   218 
       
   219 public:  //Destructor
       
   220 
       
   221     /**
       
   222      * Virtual inline destructor.
       
   223      * Allows destruction using this
       
   224      * interface
       
   225      */
       
   226     virtual ~MCnUiConnectionHandler() {};
       
   227     };
       
   228 
       
   229 
       
   230 #endif      //  __MCNUICONNECTIONHANDLER_H
       
   231 
       
   232 //  End of File
       
   233