inc/cimpspresenceaaconnectionng.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2003 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:  IMPS connection management services to AA plugins.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CIMPSPRESENCEAACONNECTIONNG_H
       
    19 #define __CIMPSPRESENCEAACONNECTIONNG_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <E32base.h>
       
    23 #include <PEngPresenceEngineConsts2.h>
       
    24 #include <impspresenceconnectionuiconstsng.h>
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 class CIMPSPresenceAAConnectionImp;
       
    28 class CIMPSSAPSettingsStore;
       
    29 class CPEngNWSessionSlotID2;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  * CIMPSPresenceAAConnection.
       
    34  *
       
    35  * CIMPSPresenceAAConnection provides presence
       
    36  * connection management services to
       
    37  * presence / IMPS always automatic plugins.
       
    38  *
       
    39  *
       
    40  * @lib IMPSConnectionUi
       
    41  * @since 2.1
       
    42  */
       
    43 class CIMPSPresenceAAConnection : public CBase
       
    44     {
       
    45     public:  // Two-phased constructors and destructor
       
    46 
       
    47         /**
       
    48          * Two-phased constructor.
       
    49          *
       
    50          * @param aSapStore The SAP settings store to use.
       
    51          * Given SAP settings store object lifetime must be
       
    52          * longer created CIMPSPresenceConnectionUi.
       
    53          * If no SAP settings store provided, creates own
       
    54          * SAP Settings store internally when needed.
       
    55          */
       
    56         IMPORT_C static CIMPSPresenceAAConnection* NewL(
       
    57             TIMPSConnectionClient aClient,
       
    58             CIMPSSAPSettingsStore* aSapStore = NULL );
       
    59 
       
    60         /**
       
    61          * Two-phased constructor.
       
    62          * Leaves CIMPSPresenceAAConnection object on the
       
    63          * CleanupStack.
       
    64          *
       
    65          * @param aSapStore The SAP settings store to use.
       
    66          * Given SAP settings store object lifetime must be
       
    67          * longer created CIMPSPresenceConnectionUi.
       
    68          * If no SAP settings store provided, creates own
       
    69          * SAP Settings store internally when needed.
       
    70          */
       
    71         IMPORT_C static CIMPSPresenceAAConnection* NewLC(
       
    72             TIMPSConnectionClient aClient,
       
    73             CIMPSSAPSettingsStore* aSapStore = NULL );
       
    74 
       
    75 
       
    76         /**
       
    77          * Destructor.
       
    78          */
       
    79         IMPORT_C virtual ~CIMPSPresenceAAConnection();
       
    80 
       
    81 
       
    82     public:  // New connection handling methods
       
    83 
       
    84 
       
    85         /**
       
    86          * Connects to remote presence server.
       
    87          *
       
    88          * Connects the given client group to remote presence
       
    89          * server. Connection is established to default SAP defined
       
    90          * in SAP Settings Store.
       
    91          *
       
    92          * Status of the connection operation is returned as
       
    93          * return value. Internal Symbian OS errors (like running out
       
    94          * of resources, or other fatal errors coming from underlying
       
    95          * Presence Engine) are handled by leaving.
       
    96          *
       
    97          * @since 2.1
       
    98          * @param aClient Which client group to login.
       
    99          * @param aShowDetailedError Should we show error note to user
       
   100          * in case an error occurs during login.
       
   101          * @return
       
   102          */
       
   103         IMPORT_C TInt LoginL( TIMPSConnectionClient aClient,
       
   104                               TBool aShowDetailedError = EFalse );
       
   105 
       
   106 
       
   107         /**
       
   108          * Disconnects from remote presence server.
       
   109          *
       
   110          * Internal Symbian OS errors (like running out of resources,
       
   111          * or other fatal errors coming from underlying Presence Engine)
       
   112          * are handled by leaving.
       
   113          *
       
   114          * @since 2.1
       
   115          * @param aClient The client using the Connection UI to logout
       
   116          * from presence service. (This client is logged out.)
       
   117          * @param aIsScheduled Tells if this is a normal scheduled
       
   118          * scheduled logout (Need to ask confirmation from user)
       
   119          * @return Currently always KErrNone.
       
   120          */
       
   121         IMPORT_C TInt LogoutL( TIMPSConnectionClient aClient,
       
   122                                TBool aIsScheduled = EFalse );
       
   123 
       
   124 
       
   125         /**
       
   126          * Gets the remote presence server connection status.
       
   127          *
       
   128          * Gets the remote presence server connection status
       
   129          * for desired client group.
       
   130          *
       
   131          * @since 2.1
       
   132          * @param aClient The client which connection status
       
   133          * to check.
       
   134          * @return ETrue if client is logged in, else EFalse.
       
   135          */
       
   136         IMPORT_C TBool LoggedInL( TIMPSConnectionClient aClient );
       
   137 
       
   138 
       
   139         /**
       
   140          * Gets the pure connection status from Presence Engine.
       
   141          *
       
   142          * @since 2.1
       
   143          * @return Connection status from Presence Engine.
       
   144          */
       
   145         IMPORT_C TPEngNWSessionSlotState PureServiceStatusL(
       
   146             const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
   147 
       
   148 
       
   149         /**
       
   150          * Gets the current default server name.
       
   151          * !!!Note!!! Ownership is transferred to the caller!
       
   152          *
       
   153          * @since 2.6
       
   154          * @return the current default server name
       
   155          */
       
   156         IMPORT_C HBufC* DefaultServerNameL( TIMPSConnectionClient aClient );
       
   157 
       
   158         /**
       
   159          * Gets the active network session slot ID
       
   160          * @param aClient The client whose active session slot ID to get
       
   161          * !!!Note!!! Ownership is transferred to the caller!
       
   162          * @since 3.0
       
   163          */
       
   164         IMPORT_C CPEngNWSessionSlotID2* GetActiveNWSessionSlotIDL(
       
   165             TIMPSConnectionClient aClient );
       
   166 
       
   167     private: //Constructors.
       
   168 
       
   169         /**
       
   170          * C++ default constructor.
       
   171          */
       
   172         CIMPSPresenceAAConnection();
       
   173 
       
   174 
       
   175         /**
       
   176          * Symbian OS constructor.
       
   177          */
       
   178         void ConstructL( TIMPSConnectionClient aClient,
       
   179                          CIMPSSAPSettingsStore* aSapStore );
       
   180 
       
   181 
       
   182     private: //Data
       
   183         CIMPSPresenceAAConnectionImp*       iImp;          ///<Implementation, owned
       
   184         TAny*                               iReserved1;    ///<Reserved, owned
       
   185     };
       
   186 
       
   187 
       
   188 
       
   189 #endif      //__CIMPSPRESENCEAACONNECTIONNG_H
       
   190 
       
   191 //  End of File
       
   192