00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef BRCTLDIALOGSPROVIDER_H
00045 #define BRCTLDIALOGSPROVIDER_H
00046
00047
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
00081 class TBrCtlSelectOptionData;
00082 class CBrCtlObjectInfo;
00083 class TBrCtlImageCarrier;
00084
00101 class MBrCtlDialogsProvider
00102 {
00103 public:
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:
00405
00406 TPtrC iText;
00407
00408 TBool iIsSelected;
00409
00410 TBool iIsOptGroup;
00411
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
00526 TBool iAppSupported;
00527
00528 TBool iPluginSupported;
00529
00530 TPtrC iSize;
00531
00532 TPtrC iAppName;
00533
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
00612 #endif
00613
00614