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