emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h
branchRCL_3
changeset 16 b5fbb9b25d57
parent 13 8592a65ad3fb
child 22 d620048b4810
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    23 
    23 
    24 #include <coecntrl.h>
    24 #include <coecntrl.h>
    25 #include <brctlspecialloadobserver.h>
    25 #include <brctlspecialloadobserver.h>
    26 #include <brctllinkresolver.h>
    26 #include <brctllinkresolver.h>
    27 
    27 
    28 #include <finditemengine.h>
       
    29 
       
    30 #include "FreestyleEmailUiAknStatusIndicator.h"
    28 #include "FreestyleEmailUiAknStatusIndicator.h"
    31 #include "FreestyleEmailDownloadInformationMediator.h"
    29 #include "FreestyleEmailDownloadInformationMediator.h"
    32 #include "freestyleemailcenrepkeys.h"
    30 #include "freestyleemailcenrepkeys.h"
    33 #include "OverlayControl.h"
    31 #include "OverlayControl.h"
    34 
    32 
    35 class CFSMailMessage;
    33 class CFSMailMessage;
    36 class CFreestyleEmailUiAppUi;
    34 class CFreestyleEmailUiAppUi;
    37 class CFreestyleMessageHeaderURLEventHandler;
    35 class CFreestyleMessageHeaderURLEventHandler;
    38 struct TAttachmentData;
    36 struct TAttachmentData;
    39 
       
    40 class CFsEmailUiHtmlViewerContainer;
    37 class CFsEmailUiHtmlViewerContainer;
    41 class MTouchFeedback;
    38 class MTouchFeedback;
       
    39 class CFindItemEngine;
    42 
    40 
    43 /**
    41 /**
    44  * Single key listener
    42  * Single key listener
    45  */
    43  */
    46 class CEUiHtmlViewerSettingsKeyListener : public CActive
    44 class CEUiHtmlViewerSettingsKeyListener : public CActive
   260     void DisplayStatusIndicatorL(TInt aDuration = KStatusIndicatorDefaultDuration);
   258     void DisplayStatusIndicatorL(TInt aDuration = KStatusIndicatorDefaultDuration);
   261     
   259     
   262     // Inform that maillist model has updated
   260     // Inform that maillist model has updated
   263     void MailListModelUpdatedL();
   261     void MailListModelUpdatedL();
   264     
   262     
       
   263     // Zoom handling
       
   264     void ZoomInL();
       
   265     void ZoomOutL();
       
   266     TInt ZoomLevelL() const;
       
   267     void SetZoomLevelL( const TInt aZoomLevel );
       
   268     TInt MaxZoomLevel() const;
       
   269 
       
   270 private:
       
   271     
       
   272     static TInt DoZoom( TAny* aPtr  );
       
   273     void DoZoomL();
       
   274     
   265 private: // from CEUiHtmlViewerSettings::MObserver
   275 private: // from CEUiHtmlViewerSettings::MObserver
   266 
   276 
   267     /**
   277     /**
   268      * @see CEUiHtmlViewerSettings::MObserver::ViewerSettingsChangedL
   278      * @see CEUiHtmlViewerSettings::MObserver::ViewerSettingsChangedL
   269      */
   279      */
   270     void ViewerSettingsChangedL( const TUint32 aKey );
   280     void ViewerSettingsChangedL( const TUint32 aKey );
   271 
   281 
   272 private:
   282 private:
   273 
   283 
       
   284     void CreateBrowserControlInterfaceL();
       
   285     
   274     // Second phase constructor.
   286     // Second phase constructor.
   275     void ConstructL();
   287     void ConstructL();
   276     // C++ constructor.
   288     // C++ constructor.
   277     CFsEmailUiHtmlViewerContainer( CFreestyleEmailUiAppUi& aAppUi,
   289     CFsEmailUiHtmlViewerContainer( CFreestyleEmailUiAppUi& aAppUi,
   278         CFsEmailUiHtmlViewerView& aView );
   290         CFsEmailUiHtmlViewerView& aView );
   322     void EnsureHTMLResourceL(); 
   334     void EnsureHTMLResourceL(); 
   323     void ConvertToHTML( const TDesC& aContent,
   335     void ConvertToHTML( const TDesC& aContent,
   324             const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
   336             const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
   325     HBufC8* GetCharacterSetL( CFSMailMessagePart& aHtmlBodyPart );
   337     HBufC8* GetCharacterSetL( CFSMailMessagePart& aHtmlBodyPart );
   326     TBool IsMessageBodyURLL(const TDesC& aUrl);
   338     TBool IsMessageBodyURLL(const TDesC& aUrl);
   327 	void CreateHyperlinksFromUrlsL( RBuf& aSource );
       
   328 	TInt TotalLengthOfItems( CFindItemEngine& aItemEngine ) const;
   339 	TInt TotalLengthOfItems( CFindItemEngine& aItemEngine ) const;
   329 	
   340 	
   330     //Returns ETrue of clicking on a link requires a browser to be launched
   341     //Returns ETrue of clicking on a link requires a browser to be launched
   331     TBool NeedToLaunchBrowserL( const TDesC& aUrl );
   342     TBool NeedToLaunchBrowserL( const TDesC& aUrl );
   332     //Launch the browser as a standalone app
   343     //Launch the browser as a standalone app
   338     CBrCtlInterface* FindWindowL( const TDesC& aTargetName ) const;  
   349     CBrCtlInterface* FindWindowL( const TDesC& aTargetName ) const;  
   339     void HandleWindowCommandL( const TDesC& aTargetName, TBrCtlWindowCommand aCommand ); 
   350     void HandleWindowCommandL( const TDesC& aTargetName, TBrCtlWindowCommand aCommand ); 
   340        
   351        
   341     TRect CalcAttachmentStatusRect();
   352     TRect CalcAttachmentStatusRect();
   342     void TouchFeedback();
   353     void TouchFeedback();
       
   354     
       
   355     void WriteToFileL( const TDesC& aFileName, RBuf& aHtmlText );
   343 
   356 
   344 private: // data
   357 private: // data
   345 
   358 
   346     // Reference to AppUi.
   359     // Reference to AppUi.
   347     CFreestyleEmailUiAppUi& iAppUi;
   360     CFreestyleEmailUiAppUi& iAppUi;
   379     CEUiHtmlViewerSettings* iViewerSettings;
   392     CEUiHtmlViewerSettings* iViewerSettings;
   380     
   393     
   381     TBool iHeaderExpanded;
   394     TBool iHeaderExpanded;
   382     // tactile feed back -- not owned
   395     // tactile feed back -- not owned
   383     MTouchFeedback* iTouchFeedBack;
   396     MTouchFeedback* iTouchFeedBack;
       
   397     
       
   398     TInt iZoomLevel;
   384     };
   399     };
   385 
   400 
   386 
   401 
       
   402 /**
       
   403 * PlainTextToHtmlConverter
       
   404 * 
       
   405 * PlainTextToHtmlConverter converts plain text to html. It adds html entities
       
   406 * and hyperlinks.
       
   407 */
       
   408 NONSHARABLE_CLASS (PlainTextToHtmlConverter)
       
   409     {
       
   410     private:
       
   411         PlainTextToHtmlConverter();
       
   412         
       
   413     public:
       
   414         static void PlainTextToHtmlL(const TDesC& aPlainText, RBuf& aHtmlText);
       
   415         
       
   416     private:
       
   417         static void ConvertTextL(const TDesC& aSource, RBuf& aTarget);
       
   418         static void ConvertUrlL(const TDesC& aSource, RBuf& aTarget);
       
   419     };
   387 #endif // __FREESTYLEEMAILUI_HTML_VIEWER_CONTAINER_H__
   420 #endif // __FREESTYLEEMAILUI_HTML_VIEWER_CONTAINER_H__