brctldialogsprovider.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : BrCtlDialogsProvider.h
00004 *  Part of     : WebKit \ BrowserControl
00005 *  Interface   : Browser Control API
00006 *  Description : Handle dialogs needed for browser operation
00007 *  Version     : %Version%
00008 *
00009 *    Copyright (c) 2006, Nokia Corporation
00010 *    All rights reserved.
00011 *
00012 *   Redistribution and use in source and binary forms, with or without
00013 *   modification, are permitted provided that the following conditions
00014 *   are met:
00015 *
00016 *      * Redistributions of source code must retain the above copyright
00017 *        notice, this list of conditions and the following disclaimer.
00018 *      * Redistributions in binary form must reproduce the above copyright
00019 *        notice, this list of conditions and the following disclaimer in
00020 *        the documentation and/or other materials provided with the
00021 *        distribution.
00022 *      * Neither the name of the Nokia Corporation nor the names of its
00023 *        contributors may be used to endorse or promote products derived
00024 *        from this software without specific prior written permission.
00025 *
00026 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033 *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034 *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035 *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00036 *   USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00037 *   DAMAGE.
00038 *
00039 *    Please see file patentlicense.txt for further grants.
00040 * ==============================================================================
00041 */
00042 
00043 
00044 #ifndef BRCTLDIALOGSPROVIDER_H
00045 #define BRCTLDIALOGSPROVIDER_H
00046 
00047 //  INCLUDES
00048 #include <e32std.h>
00049 #include <e32base.h>
00050 
00054 enum TBrCtlSelectOptionType
00055     {
00056     ESelectTypeMultiple,  
00057     ESelectTypeSingle,    
00058     ESelectTypeNone,      
00059 
00064     ESelectTypeOkOnly
00065     };
00066 
00072 enum TBrCtlImageType
00073     {
00074     EImageTypeAny, 
00075     EImageTypeWbmp, 
00076     EImageTypeOta 
00077     };
00078 
00079 
00080 // FORWARD DECLARATIONS
00081 class TBrCtlSelectOptionData;
00082 class CBrCtlObjectInfo;
00083 class TBrCtlImageCarrier;
00084 
00101 class MBrCtlDialogsProvider
00102     {
00103     public: // New functions
00104 
00112         virtual void DialogNotifyErrorL(TInt aErrCode) = 0;
00113 
00122         virtual void DialogNotifyHttpErrorL(TInt aErrCode, const TDesC& aUri) = 0;
00123 
00135         virtual TBool DialogFileSelectLC(const TDesC& aStartPath,
00136                                          const TDesC& aRootPath,
00137                                          HBufC*& aSelectedFileName) = 0;
00138 
00156         virtual TBool DialogSelectOptionL(const TDesC& aTitle,
00157                                           TBrCtlSelectOptionType aBrCtlSelectOptionType,
00158                                           CArrayFix<TBrCtlSelectOptionData>& aOptions) = 0;
00159 
00175         virtual TBool DialogUserAuthenticationLC(const TDesC& aUrl,
00176                                                  const TDesC& aRealm,
00177                                                  const TDesC& aDefaultUserName,
00178                                                  HBufC*& aReturnedUserName,
00179                                                  HBufC*& aReturnedPasswd,
00180                                                  TBool aBasicAuthentication = EFalse) = 0;
00181 
00192         virtual void DialogNoteL(const TDesC& aMessage) = 0;
00193 
00203         virtual void DialogAlertL(const TDesC& aTitle, const TDesC& aMessage) = 0;
00204 
00216         virtual TBool DialogConfirmL(const TDesC& aTitle,
00217                                      const TDesC& aMessage,
00218                                      const TDesC& aYesMessage,
00219                                      const TDesC& aNoMessage) = 0;
00220 
00232         virtual TBool DialogPromptLC(const TDesC& aTitle,
00233                                      const TDesC& aMessage,
00234                                      const TDesC& aDefaultInput,
00235                                      HBufC*& aReturnedInput) = 0;
00236 
00252         virtual TBool DialogDownloadObjectL(CBrCtlObjectInfo* aBrCtlObjectInfo) = 0;
00253 
00267         virtual void DialogDisplayPageImagesL(CArrayFixFlat<TBrCtlImageCarrier>& aPageImages) = 0;
00268 
00274         virtual void CancelAll() = 0;
00275 
00281        virtual void DialogFindL() = 0;
00282 
00283     };
00284 
00285 
00296 class TBrCtlSelectOptionData
00297     {
00298     public:
00304         inline TBrCtlSelectOptionData()
00305                 {
00306                 iText.Set(NULL, 0);
00307                 iIsSelected = EFalse;
00308                 iIsOptGroup = EFalse;
00309                 iHasOnPick = EFalse;
00310                 }
00311 
00321         inline TBrCtlSelectOptionData( const TDesC& aText,
00322                                         TBool aIsSelected,
00323                                         TBool aIsOptGroup,
00324                                         TBool aHasOnPick )
00325                                                             {
00326                                                             iText.Set(aText);
00327                                                             iIsSelected = aIsSelected;
00328                                                             iIsOptGroup = aIsOptGroup;
00329                                                             iHasOnPick = aHasOnPick;
00330                                                             }
00337         inline const TDesC& Text() const {return iText;}
00344         inline TBool IsSelected() const {return iIsSelected;}
00352         inline TBool IsOptGroup() const {return iIsOptGroup;}
00360         inline TBool HasOnPick() const {return iHasOnPick;}
00369         inline void SetText( TDesC& aText )             { iText.Set( aText ); }
00379         inline void SetIsSelected( TBool aIsSelected )  { iIsSelected = aIsSelected; }
00391         inline void SetIsOptGroup( TBool aIsOptGroup )  { iIsOptGroup = aIsOptGroup; }
00402         inline void SetHasOnPick( TBool aHasOnPick )    { iHasOnPick = aHasOnPick; }
00403 
00404     private:    // Data
00405         // The text associated with the element
00406         TPtrC iText;
00407         // Flag if the element is selected
00408         TBool iIsSelected;
00409         // Flag if an element or oprion group title
00410         TBool iIsOptGroup;
00411         // Flag if the element has onPick
00412         TBool iHasOnPick;
00413     };
00414 
00425 class CBrCtlObjectInfo : public CBase
00426   {
00427   public:
00432         CBrCtlObjectInfo();
00433 
00444     CBrCtlObjectInfo(TBool aAppSupported, TBool aPluginSupported,
00445                          const TDesC& aSize, const TDesC& aAppName,
00446                          const TDesC& aFileType);
00447   public:
00455         inline void SetAppSupported(TBool aAppSupported) {iAppSupported = aAppSupported;}
00463         inline void SetPluginSupported(TBool aPluginSupported) {iPluginSupported = aPluginSupported;}
00470         inline void SetSize(const TDesC& aSize) {iSize.Set(aSize);}
00478     inline void SetAppName(const TDesC& aAppName) {iAppName.Set(aAppName);}
00485     inline void SetFileType(const TDesC& aFileType) {iFileType.Set(aFileType);}
00493         inline TBool AppSupported() {return iAppSupported;}
00501         inline TBool PluginSupported() {return iPluginSupported;}
00508         inline const TDesC& Size() const {return iSize;}
00516     inline const TDesC& AppName() const {return iAppName;}
00523     inline const TDesC& FileType() const {return iFileType;}
00524   private:
00525     // A flag if there is a viewer app for this object
00526         TBool iAppSupported;
00527         // A flag if there is a Netscape plugin for this object
00528     TBool iPluginSupported;
00529         // The size of the object
00530     TPtrC iSize;
00531         // The name of the viewer app or Netscape plugin
00532     TPtrC iAppName;
00533         // The content type of the object
00534     TPtrC iFileType;
00535   };
00536 
00547 class TBrCtlImageCarrier
00548     {
00549     public:
00558         TBrCtlImageCarrier(const TDesC8& aRawData, const TDesC& aUrl,
00559             const TDesC& aAltText, TBrCtlImageType aImageType, const TDesC& aContentType ) :
00560             iRawData( aRawData ),
00561             iUrl( aUrl ),
00562             iAltText( aAltText ),
00563             iImageType(aImageType),
00564       iContentType(aContentType)
00565             {
00566             }
00573         inline const TDesC8& RawData() const {return iRawData;}
00580         inline const TDesC& Url() const {return iUrl;}
00587         inline const TDesC& AltText() const {return iAltText;}
00594         inline TBrCtlImageType ImageType() const {return iImageType;}
00601         inline const TDesC& ContentType() const {return iContentType;}
00602     private:
00603         TPtrC8 iRawData;
00604         TPtrC iUrl;
00605         TPtrC iAltText;
00606         TBrCtlImageType iImageType;
00607     TPtrC iContentType;
00608     };
00609 
00610 
00611 // BRCTLDIALOGSPROVIDER_H
00612 #endif
00613 
00614 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top