wvuing/IMPSConnectionUI/OperationStepSrc/CCnUiLoginSAPSelectUiCntrlStep.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:  Login SAP select UI control.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUILOGINSAPSELECTUICNTRLSTEP_H
       
    19 #define __CCNUILOGINSAPSELECTUICNTRLSTEP_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <f32file.h>
       
    24 #include "MCnUiCntrlStep.h"
       
    25 #include "impspresenceconnectionuiconstsng.h"
       
    26 
       
    27 //FORWARD DECLARATION
       
    28 class MCnUiUiControlContext;
       
    29 class MCnUiOpContextAdv;
       
    30 class CIMPSSAPSettingsList;
       
    31 class CIMPSSAPSettings;
       
    32 class RResourceFile;
       
    33 class MIMPSSharedData;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  * Login SAP select UI control.
       
    38  *
       
    39  * @since 2.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CCnUiLoginSAPSelectUiCntrlStep ) : public CBase,
       
    42         public MCnUiCntrlStep
       
    43     {
       
    44 public:  // Two-phased constructors and destructor
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @param aCCntxt The UI control context.
       
    49      * @param aLoginSap login sap
       
    50      * @param aLoginType The login type mode.
       
    51      * @param aLastLoginSap
       
    52      */
       
    53     static CCnUiLoginSAPSelectUiCntrlStep* NewLC( MCnUiUiControlContext& aCCntxt,
       
    54     CIMPSSAPSettings& aLoginSap,
       
    55     TIMPSLoginType aLoginType, TBool aLastLoginSap = EFalse );
       
    56 
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     virtual ~CCnUiLoginSAPSelectUiCntrlStep();
       
    62 
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67      * C++ constructor.
       
    68      * @param aLastLoginSap
       
    69      */
       
    70     CCnUiLoginSAPSelectUiCntrlStep( MCnUiUiControlContext& aCCntxt,
       
    71                                     CIMPSSAPSettings& aLoginSap,
       
    72                                     TIMPSLoginType aLoginType, TBool aLastLoginSap = EFalse );
       
    73 
       
    74 
       
    75     /**
       
    76      * Symbian OS constructor.
       
    77      */
       
    78     void ConstructL();
       
    79 
       
    80 
       
    81 
       
    82 public: // New functions from MCnUiCntrlStep
       
    83 
       
    84 
       
    85     /**
       
    86      * Runs SAP selection step.
       
    87      *
       
    88      * @since 2.1
       
    89      * @return Error code from SAP selection.
       
    90      */
       
    91     TInt RunStepL();
       
    92 
       
    93 
       
    94     /**
       
    95      * Handles complete.
       
    96      *
       
    97      * If needed updates the selected login SAP
       
    98      * sername and passoword to those which were
       
    99      * logged in.
       
   100      *
       
   101      * @since 2.1
       
   102      * @return Always ECnUiStepContinueTeardown.
       
   103      */
       
   104     TCnUiHandleCompleteStatus HandleCompleteL();
       
   105 
       
   106 
       
   107     /**
       
   108      * Handles undo.
       
   109      *
       
   110      *
       
   111      * @since 2.1
       
   112      */
       
   113     void UndoStepL();
       
   114 
       
   115 
       
   116 
       
   117 public: // New functions, left public to allow testing
       
   118 
       
   119 
       
   120     /**
       
   121      * Shows a note about simultanously runing
       
   122      * login operation.
       
   123      *
       
   124      * @since 2.1
       
   125      */
       
   126     void ShowSimultanousLoginOperationNoteL();
       
   127 
       
   128 
       
   129     /**
       
   130      * Loads default SAP from SAP Settings
       
   131      * store as login SAP.
       
   132      *
       
   133      * @since 2.1
       
   134      * @param aSap
       
   135      * @return KErrNone / KErrNotFound.
       
   136      */
       
   137     TInt LoadDefaultSapL( CIMPSSAPSettings& aSap );
       
   138 
       
   139 
       
   140     /**
       
   141      * Loads SAP from SAP Settings
       
   142      * store as based on user selection.
       
   143      *
       
   144      * If 0 SAP ==> KErrNotFound
       
   145      * If 1 SAP ==> Selects this automaticly
       
   146      * If 2..n SAP ==> Shows a selection list
       
   147      * if user cancels the selection ==> KErrCancel
       
   148      *
       
   149      * @since 2.1
       
   150      * @param aSap
       
   151      * @return KErrNone / KErrNotFound / KErrCancel.
       
   152      */
       
   153     TInt SelectSapManuallyL( CIMPSSAPSettings& aSap );
       
   154 
       
   155 
       
   156     /**
       
   157      * Gets server list and index which to highlight
       
   158      * in selection list.
       
   159      *
       
   160      * @since 2.1
       
   161      * @param aIndexToHighlight On the return contains the
       
   162      * index that should be high lighted by default in the
       
   163      * selection list, or KErrNotFound if default index should
       
   164      * be ignored.
       
   165      * @return SAP settings list. Ownership of list returned to client.
       
   166      */
       
   167     CIMPSSAPSettingsList* ServerListLC( TInt& aIndexToHighlight );
       
   168 
       
   169 
       
   170     /**
       
   171      * Loads the used login SAP based the SAP Settings list
       
   172      * and index of selected server.
       
   173      *
       
   174      * @since 2.1
       
   175      * @param aList Server list.
       
   176      * @param aIndexOfSelectedServer The index of selected server.
       
   177      * @param aSap
       
   178      */
       
   179     void LoadSapByServerListL( const CIMPSSAPSettingsList& aList,
       
   180                                TInt aIndexOfSelectedServer,
       
   181                                CIMPSSAPSettings& aSap );
       
   182 
       
   183 
       
   184 private: // new helper
       
   185     /**
       
   186      * Gets the current client information from TLS
       
   187      *
       
   188      * @since 3.0
       
   189      */
       
   190     TIMPSConnectionClient ConnectionClient();
       
   191 
       
   192     /**
       
   193      * Opens correct resource file.
       
   194      * !!! Two items left to cleanup stack. !!!
       
   195      * @param aResourceFile Contains opened file on return
       
   196      * @since 3.1
       
   197      */
       
   198     void OpenResourceFileLC( RResourceFile& aResourceFile );
       
   199 
       
   200     /**
       
   201      * Resource reader for non-Cone situations
       
   202      * @param aResourceId The integer-valued resource id to read
       
   203      * @return The value of the integer
       
   204      * @since 3.1
       
   205      */
       
   206     TInt ReadResourceIntValueL( TInt aResourceId );
       
   207 
       
   208 
       
   209 private: // data
       
   210 
       
   211     ///< UI control context to use, not owned
       
   212     MCnUiUiControlContext&              iCCntxt;
       
   213 
       
   214     ///<Login SAP settings, not owned
       
   215     CIMPSSAPSettings&                     iLoginSap;
       
   216 
       
   217     ///<Login type setting, owned
       
   218     const TIMPSLoginType                iLoginType;
       
   219 
       
   220     ///<State flag, is post login SAP update needed, owned
       
   221     TBool                               iLoginSapUpdateNeeded;
       
   222 
       
   223     ///<Login SAP uid, owned
       
   224     TUint32                             iLoginSapUid;
       
   225 
       
   226     // file handle used by resource file reading routine
       
   227     RFs   iRFs;
       
   228 
       
   229     MIMPSSharedData*	iSharedData;
       
   230 
       
   231     //whether to use for new login
       
   232     //
       
   233     TBool iLastLoginSap;
       
   234 
       
   235     };
       
   236 
       
   237 #endif      //  __CCNUILOGINSAPSELECTUICNTRLSTEP_H
       
   238 
       
   239 //  End of File
       
   240