wvuing/IMPSConnectionUI/UISrc/CCnUiUiFacade.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:  UI facade.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CCNUIFACADE_H
       
    19 #define __CCNUIFACADE_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include "mimpsconnprocessobserverng.h"
       
    24 #include "MCnUiUiFacade.h"
       
    25 #include "CCnUiSignInControl.h"
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CCoeEnv;
       
    30 class MCnUiWaitNoteObserver;
       
    31 class CCommandAbsorbingControl;
       
    32 class CAknIconArray;
       
    33 class CIMPSSAPSettings;
       
    34 class MIMPSSharedData;
       
    35 class CBrowserLauncher;
       
    36 
       
    37 /**
       
    38  * Internal note type enumeration.
       
    39  * @since 2.1
       
    40  */
       
    41 enum TCnUiConnUiNoteType
       
    42     {
       
    43     EInfoNote = 0,
       
    44     EConfirmationNote,
       
    45     EErrorNote,
       
    46     EConfirmedErrorNote,
       
    47     EConfirmedErrorNoteMSKSelectIcon
       
    48     };
       
    49 
       
    50 
       
    51 
       
    52 // CLASS DECLARATION
       
    53 /**
       
    54  * UI facade implementation for
       
    55  * Connection UI
       
    56  *
       
    57  * @since 2.1
       
    58  */
       
    59 NONSHARABLE_CLASS( CCnUiUiFacade ) : public CBase,
       
    60         public MCnUiUiFacade,
       
    61         public MIMPSConnProcessUi
       
    62     {
       
    63 public:  // Two-phased constructors and destructor
       
    64 
       
    65     /**
       
    66      * Two-phased constructor.
       
    67      */
       
    68     static CCnUiUiFacade* NewL();
       
    69 
       
    70 
       
    71     /**
       
    72      * Destructor.
       
    73      */
       
    74     virtual ~CCnUiUiFacade();
       
    75 
       
    76 private:
       
    77 
       
    78     /**
       
    79      * C++ constructor.
       
    80      */
       
    81     CCnUiUiFacade();
       
    82 
       
    83 
       
    84     /**
       
    85      * Symbian OS constructor.
       
    86      */
       
    87     void ConstructL();
       
    88 
       
    89 
       
    90 public: // Functions from MCnUiUiFacade
       
    91 
       
    92 
       
    93     /**
       
    94      * @see MCnUiUiFacade
       
    95      * @since 2.1
       
    96      */
       
    97     MIMPSConnProcessUi& ConnProcessUi();
       
    98 
       
    99 
       
   100     /**
       
   101      * @see MCnUiUiFacade
       
   102      * @since 2.1
       
   103      */
       
   104     void CommandAbsorbOnLC();
       
   105 
       
   106 
       
   107     /**
       
   108      * @see MCnUiUiFacade
       
   109      * @since 2.1
       
   110      */
       
   111     void FlushCommandBuffer();
       
   112 
       
   113 
       
   114     /**
       
   115      * @see MCnUiUiFacade
       
   116      * @since 2.1
       
   117      */
       
   118     MCnUiConnWaitNote* WaitNoteL( TCnUiConnectionWaitNotes aNoteId,
       
   119                                   MCnUiWaitNoteObserver* aObserver = NULL );
       
   120 
       
   121     /**
       
   122      * @see MCnUiUiFacade
       
   123      * @since 2.1
       
   124      */
       
   125     MCnUiConnWaitNote* WaitNoteL( TCnUiConnectionWaitNotesDynText aNoteId,
       
   126                                   const TDesC& aInsertText,
       
   127                                   MCnUiWaitNoteObserver* aObserver = NULL );
       
   128 
       
   129 
       
   130     /**
       
   131      * @see MCnUiUiFacade
       
   132      * @since 2.1
       
   133      */
       
   134     MCnUiConnQuery* QueryL( TCnUiConnAsyncQuery aQueryId,
       
   135                             MCnUiConnQueryObserver& aObserver );
       
   136 
       
   137 
       
   138     /**
       
   139      * @see MCnUiUiFacade
       
   140      * @since 2.1
       
   141      */
       
   142     MCnUiConnQuery* QueryL( TCnUiConnAsyncQueryDynText aQueryId,
       
   143                             const TDesC& aInsertText,
       
   144                             MCnUiConnQueryObserver& aObserver );
       
   145 
       
   146     /**
       
   147      * @see MCnUiUiFacade
       
   148      * @since 2.1
       
   149      */
       
   150     void ShowNoteL( TCnUiConnectionNotes aNoteId );
       
   151 
       
   152 
       
   153     /**
       
   154      * @see MCnUiUiFacade
       
   155      * @since 2.1
       
   156      */
       
   157     void ShowNoteL( TCnUiConnectionNotesDynText aNoteId,
       
   158                     const TDesC& aInsertText );
       
   159 
       
   160     /**
       
   161      * @see MCnUiUiFacade
       
   162      * @since 2.1
       
   163      */
       
   164     void ShowLoginErrorNoteL( TInt aErrorCode );
       
   165 
       
   166     /**
       
   167      * @see MCnUiUiFacade
       
   168      * @since 2.1
       
   169      */
       
   170     void ShowLogoutErrorNoteL( TInt aErrorCode );
       
   171 
       
   172 
       
   173     /**
       
   174      * @see MCnUiUiFacade
       
   175      * @since 2.1
       
   176      */
       
   177     TBool ConfirmationQueryL( TCnUiConnectionQueries aQueryId );
       
   178 
       
   179 
       
   180     /**
       
   181      * @see MCnUiUiFacade
       
   182      * @since 2.1
       
   183      */
       
   184     TBool ConfirmationQueryL( TCnUiConnectionQueriesDynText aQueryId,
       
   185                               const TDesC& aInsertText );
       
   186 
       
   187     /**
       
   188      * @see MCnUiUiFacade
       
   189      * @since 2.1
       
   190      */
       
   191     TBool LoginQueryL( TDes& aUsername,
       
   192                        TDes& aPassword,
       
   193                        CIMPSSAPSettings& aSap,
       
   194                        TCnUiLoginDataQueryMode aMode );
       
   195 
       
   196 
       
   197     /**
       
   198      * @see MCnUiUiFacade
       
   199      * @since 2.1
       
   200      */
       
   201     TBool ServerToUseQueryL( MDesCArray& aServers,
       
   202                              TInt aIndexToHighlight,
       
   203                              TInt& aSelectedIndex );
       
   204     /**
       
   205      * @see MCnUiUiFacade
       
   206      * @since 2.1
       
   207      */
       
   208     void HandleIfError( TInt aErr );
       
   209 
       
   210     /**
       
   211      * @see MCnUiUiFacade
       
   212      * @since 2.6
       
   213      */
       
   214     void SwitchResourceFileL( const TDesC& aNewResourceFile );
       
   215 
       
   216     /**
       
   217      * @see MCnUiUiFacade
       
   218      * @since 3.1u
       
   219      */
       
   220     TInt DisplayDomainSelectionQueryL( TDes& aSelectedDomain,
       
   221                                        CIMPSSAPSettings* aSap = NULL );
       
   222 
       
   223     /**
       
   224      * @see MCnUiUiFacade
       
   225      * @since 3.1u
       
   226      */
       
   227     TBool DisplayTermsOfUseAndQueryL();
       
   228 
       
   229 public: //from MIMPSConnProcessUi
       
   230 
       
   231     /**
       
   232      * Sets the new resource file to use in Connection UI.
       
   233      *
       
   234      * @see MIMPSConnProcessUi
       
   235      * @since 2.1
       
   236      */
       
   237     void UseResourceFileL( const TDesC& aNewResourceFile );
       
   238 
       
   239 
       
   240     /**
       
   241      * Gets Connection UI's default resource file name.
       
   242      *
       
   243      * @see MIMPSConnProcessUi
       
   244      * @since 2.1
       
   245      */
       
   246     void ResourceFileNameL( TDes& aResourceFileName );
       
   247 
       
   248 
       
   249 private: //New helpers
       
   250 
       
   251 
       
   252     /**
       
   253      * Removes the possibly added resource file
       
   254      * from resource file stack,
       
   255      * @since 2.1
       
   256      */
       
   257     void RemoveUsedResourceFile();
       
   258 
       
   259 
       
   260     /**
       
   261      * Retrieves a system error text for given
       
   262      * error code and returns it as a HBufC.
       
   263      * Ownership of HBufC is returned to caller.
       
   264      *
       
   265      * If any matching system error text isn't
       
   266      * found for error number, returns a NULL.
       
   267      *
       
   268      * Performs internally certain filtering and
       
   269      * mapping operations for basic KErr* error
       
   270      * codes.
       
   271      *
       
   272      * @since 2.1
       
   273      * @param aErrorCode for which to get the error
       
   274      * text.
       
   275      * @return HbufC buffer containing the proper error
       
   276      * text or NULL pointer if matching text wasn't found.
       
   277      */
       
   278     HBufC* SystemErrorTextOrNullForCodeL( TInt aErrorCode );
       
   279 
       
   280 
       
   281     /**
       
   282      * Shows a desired type note with desired text
       
   283      * loaded from given resource id.
       
   284      *
       
   285      * @since 2.1
       
   286      * @param aNoteTextResourceId Resource of the note text to show.
       
   287      * @param aNoteType Type of shown note.
       
   288      */
       
   289     void DoShowNoteL( TInt aNoteTextResourceId, TCnUiConnUiNoteType aNoteType );
       
   290 
       
   291 
       
   292     /**
       
   293      * Shows a desired type note with given text.
       
   294      *
       
   295      * @since 2.1
       
   296      * @param aNotePrompt The prompt text to show in note.
       
   297      * @param aNoteType Type of shown note.
       
   298      */
       
   299     void DoShowNoteL( const TDesC& aNotePrompt, TCnUiConnUiNoteType aNoteType );
       
   300 
       
   301 
       
   302     /**
       
   303      * Shows a confirmation query with given text.
       
   304      *
       
   305      * @since 2.1
       
   306      * @param aPromptText The prompt text to show in query.
       
   307      * @return ETrue if user accepted the query, else EFalse.
       
   308      */
       
   309     TBool DoShowConfirmationQueryL( const TDesC& aPromptText );
       
   310 
       
   311     /**
       
   312     * Constructs complete path from parts and checks for correctness.
       
   313     * @param aResult, the complete path.
       
   314     * @param aModuleId, dll's (or app) id. For example "IM".
       
   315     * @param aAlternative, id for alternative (for example operator "Oper1" ) files.
       
   316     * @param aFileName, filename of the complete path
       
   317     * @return ETrue if path was found from C or MMC card, otherwise false
       
   318     * @since 2.1
       
   319     */
       
   320     TBool ConstructCompletePathAndCheck( TDes& aResult,
       
   321                                          const TDesC& aModuleId,
       
   322                                          const TDesC& aAlternative,
       
   323                                          const TDesC& aFileName );
       
   324 
       
   325     /**
       
   326     * Returns MMC drive.
       
   327     * @param aDrive, the result.
       
   328     */
       
   329     void MMCDrive( TDes& aDrive ) const;
       
   330 
       
   331     /**
       
   332      * Loads the branded server icons to iIconArray
       
   333      * @param aServers List of the server names
       
   334      */
       
   335     void LoadServerIconsL( MDesCArray& aServers );
       
   336 
       
   337 
       
   338     /**
       
   339      * Opens correct resource file.
       
   340      * !!! Two items left to cleanup stack. !!!
       
   341      * @param aResourceFile Contains opened file on return
       
   342      * @since 3.2
       
   343      */
       
   344     void OpenResourceFileLC( RResourceFile& aResourceFile );
       
   345 
       
   346     /**
       
   347      * Reads integer resource value from resources
       
   348      * @param aResourceId resource id which is read
       
   349      * @return value of wanted integer resource flag
       
   350      */
       
   351     TInt IntResourceValueL( TInt aResourceId );
       
   352 
       
   353     /**
       
   354      * Shows WAP registration query
       
   355      * @return command id for user action
       
   356      */
       
   357     TInt ShowWAPQueryL();
       
   358 
       
   359     /**
       
   360      * Shows Terms and Conditions query
       
   361      * @return command id for user action
       
   362      */
       
   363     TInt ShowTAndCDlgL();
       
   364 
       
   365     /**
       
   366      * Opens native browser with the specified URL
       
   367      * @param a Url
       
   368      */
       
   369     void OpenWebBrowserL( const TDesC& aUrl );
       
   370 
       
   371     TInt GetIntResourceValueL( TInt aResourceId );
       
   372 
       
   373 private: // data
       
   374     ///<Cached pointer to control environment, not owned
       
   375     CCoeEnv*                    iCoeEnv;
       
   376 
       
   377     ///<Resource file offset, owned
       
   378     TInt                        iResourceFileOffset;
       
   379 
       
   380     ///<Default resource file name, owned
       
   381     HBufC*                      iDefaultRssFileName;
       
   382 
       
   383     ///<Flag wether the resource file has been added or not.
       
   384     TBool                       iResourceFileAdded;
       
   385 
       
   386     ///<Command absorber, owned
       
   387     CCommandAbsorbingControl*   iCommandAbsorber;
       
   388 
       
   389     ///<Icon array for server list query, owned
       
   390     CAknIconArray* iIconArray;
       
   391 
       
   392     MIMPSSharedData* iSharedData;
       
   393 
       
   394     // Browser launcher
       
   395     CBrowserLauncher* iBrLauncher;
       
   396     // file handle used by resource file reading routine
       
   397     RFs   iRFs;
       
   398     CCnUiSignInControl* iControl;
       
   399     };
       
   400 
       
   401 #endif      //  __CCNUIFACADE_H
       
   402 
       
   403 //  End of File
       
   404