browserui/browser/BrowserAppInc/BrowserDialogsProviderProxy.h
branchRCL_3
changeset 64 6385c4c93049
parent 63 4baee4f15982
child 65 8e6fa1719340
equal deleted inserted replaced
63:4baee4f15982 64:6385c4c93049
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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:  Forwards Dialog requests to the BrowserDialogsProvider
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BROWSERDIALOGSPROVIDERPROXY_H
       
    21 #define BROWSERDIALOGSPROVIDERPROXY_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 // User includes
       
    26 
       
    27 // System Includes
       
    28 #include <brctldialogsprovider.h>
       
    29 #include <browserdialogsprovider.h>
       
    30 #include <e32std.h>
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CBrCtlDialogsProvider;
       
    36 class CBrowserDialogsProviderBlocker;
       
    37 class CBrowserWindowFocusNotifier;
       
    38 class CBrowserWindow;
       
    39 class MBrowserDialogsProviderObserver;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 *  Provide dialogs needed for browser operation
       
    45 *
       
    46 *  @since 3.0
       
    47 */
       
    48 class CBrowserDialogsProviderProxy :    public  CBase,
       
    49                                         public  MBrCtlDialogsProvider
       
    50     {
       
    51     // Construction/Destruction
       
    52     public:
       
    53                        
       
    54         // Two stage constructor
       
    55         static CBrowserDialogsProviderProxy* NewL( 
       
    56                         CBrowserDialogsProvider& aDialogsProvider,
       
    57                         MBrowserDialogsProviderObserver* aDialogsObserver,
       
    58                         CBrowserWindow& aBrowserWindow );
       
    59 
       
    60         // Destructor
       
    61         virtual ~CBrowserDialogsProviderProxy();
       
    62 
       
    63     protected:
       
    64 
       
    65         // 1st stage Constructor
       
    66         CBrowserDialogsProviderProxy( 
       
    67                         CBrowserDialogsProvider& aDialogsProvider,
       
    68                         MBrowserDialogsProviderObserver* aDialogsObserver,
       
    69                         CBrowserWindow& aBrowserWindow );
       
    70         
       
    71 
       
    72         // 2nd stage constructor
       
    73         void ConstructL();
       
    74 
       
    75     public: // From  MBrCtlDialogsProvider
       
    76         
       
    77         /**
       
    78         * Notify the user of an error
       
    79         * @since 3.0
       
    80         * @param aErrCode The error that occured
       
    81         * @return void
       
    82         */
       
    83         virtual void DialogNotifyErrorL( TInt aErrCode );
       
    84 
       
    85         /**
       
    86         * Notify the user of an http error
       
    87         * @since 3.0
       
    88         * @param aErrCode The error that occured
       
    89         * @param aUri The uri of the request that failed
       
    90         * @return void
       
    91         */
       
    92         virtual void DialogNotifyHttpErrorL( TInt aErrCode,
       
    93                                                         const TDesC& aUri );
       
    94 
       
    95         /**
       
    96         * File selection dialog
       
    97         * @since 3.0
       
    98         * @param aStartPath The initial displayed directory
       
    99         * @param aRootPath The top most directory that the user can go up to
       
   100         * @param aSelectedFileName The selected file name. 
       
   101         * Returned on cleanup stack. Browser control will free the buffer
       
   102         * @return EFalse if the user canceled, ETrue otherwise
       
   103         */
       
   104         virtual TBool DialogFileSelectLC( const TDesC& aStartPath,
       
   105                                             const TDesC& aRootPath,
       
   106                                             HBufC*& aSelectedFileName);
       
   107 
       
   108         /**
       
   109         * List selection dialog
       
   110         * @since 3.0
       
   111         * @param aTitle The title, could be empty
       
   112         * @param aBrowserSelectOptionType The type of the list box 
       
   113         * @param aOptions A list of options to display
       
   114         * @return EFalse if the user canceled, ETrue otherwise
       
   115         */
       
   116         virtual TBool DialogSelectOptionL(
       
   117                             const TDesC& aTitle, 
       
   118                             TBrCtlSelectOptionType aBrowserSelectOptionType, 
       
   119                             CArrayFix<TBrCtlSelectOptionData>& aOptions );
       
   120 
       
   121         /**
       
   122         * User Authentication dialog. 
       
   123         * User name and password are returned on cleanup stack
       
   124         * @since 3.0
       
   125         * @param aUrl The url requiring authentication
       
   126         * @param aRealm The realm requiring authentication
       
   127         * @param aDefaultUser/Name The user name that was used before for this
       
   128         * realm and path, if any
       
   129         * @param aReturnedUserName The user name entered by the user
       
   130         * @param aReturnedPasswd The password entered by the user
       
   131         * @param aBasicAuthentication A flag if basic authentication was used
       
   132         * @return EFalse if the user canceled, ETrue otherwise
       
   133         */
       
   134         virtual TBool DialogUserAuthenticationLC(
       
   135                                         const TDesC& aUrl, 
       
   136                                         const TDesC& aRealm, 
       
   137                                         const TDesC& aDefaultUserName, 
       
   138                                         HBufC*& aReturnedUserName, 
       
   139                                         HBufC*& aReturnedPasswd,
       
   140                                         TBool aBasicAuthentication = EFalse);
       
   141 
       
   142         /**
       
   143         * Display a note to the user. No softkeys
       
   144         * @since 3.0
       
   145         * @param aMessage The message to display
       
   146         * @return void
       
   147         */
       
   148         virtual void DialogNoteL( const TDesC& aMessage ); 
       
   149  
       
   150         /**
       
   151         * Display a note to the user with ok softkey only
       
   152         * @since 3.0
       
   153         * @param aTitle The title, could be empty
       
   154         * @param aMessage The message to display
       
   155         * @return void
       
   156         */
       
   157         virtual void DialogAlertL( const TDesC& aTitle,
       
   158                                     const TDesC& aMessage );
       
   159 
       
   160         /**
       
   161         * Display confirmation message to the user
       
   162         * @since 3.0
       
   163         * @param aTitle The title, could be empty
       
   164         * @param aMessage The message to display
       
   165         * @param aYesMessage The text to display on left softkey
       
   166         * @param aNoMessage The text to display on right softkey
       
   167         * @return EFalse if the user canceled, ETrue otherwise
       
   168         */
       
   169         virtual TBool DialogConfirmL(  const TDesC& aTitle,
       
   170                                         const TDesC& aMessage,
       
   171                                         const TDesC& aYesMessage,
       
   172                                         const TDesC& aNoMessage);
       
   173 
       
   174         /**
       
   175         * Display input dialog to the user
       
   176         * @since 3.0
       
   177         * @param aTitle The title, could be empty
       
   178         * @param aMessage The message to display
       
   179         * @param aDefaultInput The default input if available
       
   180         * @param aReturnedInput The input entered by the user
       
   181         * Returned on the cleanup stack, owned by the calling application
       
   182         * @return EFalse if the user canceled, ETrue otherwise
       
   183         */
       
   184         virtual TBool DialogPromptLC(const TDesC& aTitle,
       
   185                                      const TDesC& aMessage,
       
   186                                      const TDesC& aDefaultInput,
       
   187                                      HBufC*& aReturnedInput);
       
   188 
       
   189         /**
       
   190         * Display object info and ask confirmation before download
       
   191         * @since 3.0
       
   192         * @param aBrCtlObjectInfo The object info
       
   193         * @return EFalse if the user canceled, ETrue otherwise
       
   194         */
       
   195         virtual TBool DialogDownloadObjectL( 
       
   196                                         CBrCtlObjectInfo* aBrCtlObjectInfo );
       
   197 
       
   198         /**
       
   199         * DIsplay the images that appear in the current page
       
   200         * @since 3.0
       
   201         * @param aPageImages The images that appear in this page
       
   202         * @return vois
       
   203         */
       
   204         virtual void DialogDisplayPageImagesL( 
       
   205                             CArrayFixFlat<TBrCtlImageCarrier>& aPageImages);
       
   206 
       
   207         /**
       
   208         * Cancel any dialog that is being displayed due to 
       
   209         * e.g. Browser exit or page was destroyed
       
   210         * @since 3.0
       
   211         * @return void
       
   212         */
       
   213         virtual void CancelAll();
       
   214         
       
   215         /**
       
   216         * Display search on page dialog
       
   217         * @since 3.0
       
   218         * @return void
       
   219         */
       
   220         virtual void DialogFindL() { /* TODO: implement this body!!! */ } ;
       
   221         
       
   222         /**
       
   223         * Mime File selection dialog for specific mime type files
       
   224         * @since 3.2
       
   225         * @param aSelectedFileName The selected file name. 
       
   226         * @param aMimeType The accepted mime type
       
   227         * Returned on cleanup stack. Browser control will free the buffer
       
   228         * @return EFalse if the user canceled, ETrue otherwise
       
   229         */
       
   230         virtual TBool DialogMimeFileSelectLC( HBufC*& aSelectedFileName,
       
   231 									  const TDesC& aMimeType );
       
   232         
       
   233     
       
   234     public:     // New functions
       
   235     
       
   236         /**
       
   237         * Display a tooltip (info popup note)
       
   238         * @since 3.0
       
   239         * @return void
       
   240         */                                   
       
   241         void ShowTooltipL( const TDesC& aText, TInt aDuration, TInt aDelay );
       
   242         
       
   243         /**
       
   244         * Display a dialog which tracks upload progress
       
   245         * @since 3.0    
       
   246         * @param aTotalSize     the total size of a file being uploaded
       
   247         * @param aChunkSize     the size of the current chunk being uploaded
       
   248         * @param aIsLastChunk   boolean value indicating whether the current 
       
   249         * @param aObserver      an observer for the upload progress dialog
       
   250         * chunk is the last one in the entire download
       
   251         * @return void
       
   252         */
       
   253         void UploadProgressNoteL( 
       
   254                             TInt32 aTotalSize, 
       
   255                             TInt32 aChunkSize,
       
   256                             TBool aIsLastChunk,
       
   257                             MBrowserDialogsProviderObserver* aObserver );
       
   258     
       
   259         /**
       
   260         * Callback from Window, indicating that the window is now active
       
   261         * @since 3.0
       
   262         */
       
   263         void WindowActivated();
       
   264 
       
   265     // DATA MEMBERS
       
   266     private:
       
   267 
       
   268         CBrowserDialogsProvider&            iDialogsProvider;
       
   269         MBrowserDialogsProviderObserver*    iDialogsObserver;
       
   270         CBrowserWindow&                     iBrowserWindow;
       
   271         
       
   272         // Stores data on blocked dialogs
       
   273         CBrowserWindowFocusNotifier*        iWinFocusNotifier;  // owned
       
   274         
       
   275         TBool iCancelWaitingDialogs;    // ETrue means that waiting dialogs should not be displayed when flushed
       
   276         
       
   277     };
       
   278 
       
   279 #endif      // BROWSERDIALOGSPROVIDERPROXY_H   
       
   280             
       
   281 // End of File