wvuing/wvuiprocess/Inc/CCALoginPC.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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:  Process Component for Login,Logout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCALOGINPC_H
       
    21 #define CCALOGINPC_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "MCALoginPC.h"
       
    27 #include "MCABackgroundTaskObserver.h"
       
    28 #include <cimpspresenceconnectionuing.h>
       
    29 // FORWARD DECLARATIONS
       
    30 class CCAEngine;
       
    31 class CPEngNWSessionSlotID2;
       
    32 class CIMPSSAPSettings;
       
    33 class TPEngWVCspServicesTree2;
       
    34 class MCAMainViewArrayPC;
       
    35 class MCALoginRefreshObserverPC;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * CCALoginPC
       
    41 * Process Component for Login,Logout
       
    42 * @lib wvuiprocessng.dll
       
    43 * @since 3.2
       
    44 */
       
    45 class CCALoginPC : public CBase, public MCALoginPC
       
    46     {
       
    47     public:
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @param aEngine - Reference to chat engine component
       
    51         */
       
    52         static CCALoginPC* NewL( CCAEngine& aEngine );
       
    53 
       
    54         /**
       
    55          * Second phased symbian constructor.
       
    56          */
       
    57         void ConstructL();
       
    58         /**
       
    59          * Destructor
       
    60          */
       
    61         virtual ~CCALoginPC();
       
    62 
       
    63     private:
       
    64 
       
    65         /**
       
    66         * Default Constructor
       
    67         * @param aEngine - reference to chat engine
       
    68         */
       
    69         CCALoginPC( CCAEngine& aEngine );
       
    70 
       
    71     public:
       
    72 
       
    73         /**
       
    74          * Does Login to IM Engine
       
    75          * @param aState - NetworkState login/logout
       
    76          * @param aSettings - pointer to SAP Settings
       
    77          * @param aSessionSlotID - Specifies the current session
       
    78          * @param aImpsServices - Reference to the supported IMPS Services
       
    79          * @return true if logged in successfully else false
       
    80          */
       
    81         TBool LoginL( TNetworkState aState, CIMPSSAPSettings* aSettings,
       
    82                       CPEngNWSessionSlotID2* aSessionSlotID,
       
    83                       TPEngWVCspServicesTree2 &aImpsServices );
       
    84 
       
    85         /**
       
    86          * Notifies the IM Engine about the Logged out state
       
    87          * @param aState - NetworkState login/logout
       
    88          * @param aSessionSlotID - Specifies the current session
       
    89          * @param aImpsServices - Reference to the supported IMPS Services
       
    90          * @return true if notified successfully else false
       
    91          */
       
    92         TBool NotifyEngineForLogoutL( TNetworkState aState,
       
    93                                       CPEngNWSessionSlotID2* aSessionSlotID,
       
    94                                       TPEngWVCspServicesTree2 &aImpsServices );
       
    95 
       
    96         /**
       
    97          * Logout - Does Logout from IM Engine
       
    98          */
       
    99         void LogoutL();
       
   100 
       
   101         /**
       
   102          * PerformNetworkStateChangeL -for IM Engine
       
   103          */
       
   104         void PerformNetworkStateChangeL( TNetworkState aState,
       
   105                                          CPEngNWSessionSlotID2* aSessionSlotID,
       
   106                                          TPEngWVCspServicesTree2 &aImpsServices );
       
   107 
       
   108         /**
       
   109          * ReadyForShutdown for engine
       
   110          * @return true if ready for shutdown
       
   111          */
       
   112         TBool ReadyForShutdown();
       
   113 
       
   114         /**
       
   115          * Cancel All engine requests
       
   116          */
       
   117         void CancelAllRequests();
       
   118 
       
   119         /**
       
   120          * Used To get MainViewArrayPC
       
   121          * @ return Pointer to MCAMainViewArrayPC
       
   122          * @ since 3.2
       
   123          */
       
   124         IMPORT_C MCAMainViewArrayPC* GetArrayInterface() const;
       
   125 
       
   126         /**
       
   127          * Tells if Logged in with a different userid or not
       
   128          * @return ETrue if yes else EFalse.
       
   129          */
       
   130         TBool FreshLoginL( );
       
   131 
       
   132 
       
   133         /**
       
   134          * Set the value to show nickname or not
       
   135          * @param aShowNickName 'Show nick name' -value
       
   136          */
       
   137         void SetShowNicknameL( TBool aShowNickName );
       
   138 
       
   139         /**
       
   140          * Set the alias
       
   141          * @param aAlias - Alias value to be set
       
   142          */
       
   143         void SetAliasL( const TDesC& aAlias );
       
   144 
       
   145     public : //from MCALoginPC
       
   146 
       
   147         /**
       
   148         * AddObserver
       
   149         */
       
   150         void AddObserver( MCALoginRefreshObserverPC *aObserver );
       
   151 
       
   152         /**
       
   153         * RemoveObserver
       
   154         */
       
   155         void RemoveObserver();
       
   156 
       
   157 
       
   158         /**
       
   159          * Register to receive notifications related to
       
   160          * start and completetion of background task
       
   161          * @param MCABackGroundTaskObserver- object
       
   162          */
       
   163         void RegisterBackGroundTaskObserver( MCABackGroundTaskObserver *aObserver );
       
   164 
       
   165         /**
       
   166          * UnRegister from receiving notifications related to
       
   167          * start and completetion of backgroundtask
       
   168          */
       
   169         void UnRegisterBackGroundTaskObserver( MCABackGroundTaskObserver* aObserver );
       
   170 
       
   171         /**
       
   172          * To know whether Background task has started
       
   173          * @return TBool
       
   174          */
       
   175         TBool IsBackgroundTaskPending();
       
   176 
       
   177 
       
   178 
       
   179     private://Data
       
   180 
       
   181         //Ref. to chat engine,doesnt own
       
   182         CCAEngine& iEngine;
       
   183 
       
   184         //Pointer to MainViewArrayPC,owns
       
   185         MCAMainViewArrayPC* iMainViewArrayPC;
       
   186         CIMPSSAPSettings* iLoggedInSap;
       
   187 
       
   188         //last logged in user id
       
   189         HBufC* iLoggedUserId;
       
   190 
       
   191         HBufC* iOldLoggedUserId;
       
   192 
       
   193         //tells if it is first login or not
       
   194         TBool iFirstLogin;
       
   195 
       
   196 
       
   197         // owned ,Login refresh for conversation container
       
   198         MCALoginRefreshObserverPC* iRefreshObserver;
       
   199 
       
   200 
       
   201     };
       
   202 
       
   203 #endif      // CCALOGINPC_H
       
   204 
       
   205 // End of File