emailuis/emailui/inc/FreestyleEmailUiAppui.h
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 17 67369d1b217f
child 23 dcf0eedfc1a3
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
    43 #include <iaupdateobserver.h>
    43 #include <iaupdateobserver.h>
    44 #include "cfsmailcommon.h"
    44 #include "cfsmailcommon.h"
    45 #include "cmailcustomstatuspaneindicators.h"
    45 #include "cmailcustomstatuspaneindicators.h"
    46 
    46 
    47 // INTERNAL INCLUDES
    47 // INTERNAL INCLUDES
       
    48 #include "cconnectionstatusqueryext.h"
    48 #include "FreestyleEmailUiPropertySubscriber.h"
    49 #include "FreestyleEmailUiPropertySubscriber.h"
    49 #include "FreestyleEmailUiConstants.h"
    50 #include "FreestyleEmailUiConstants.h"
    50 
       
    51 enum TForcedStatus
       
    52 	{
       
    53     ENoForce = 0,
       
    54     EForceToSync,
       
    55     EForceToConnected,
       
    56     EForceToDisconnected
       
    57     };
       
    58 
    51 
    59 // FORWARD DECLARATIONS
    52 // FORWARD DECLARATIONS
    60 class CFreestyleEmailUiView;
    53 class CFreestyleEmailUiView;
    61 class CFSEmailUiViewerControl;
    54 class CFSEmailUiViewerControl;
    62 class CFSEmailUiLauncherGrid;
    55 class CFSEmailUiLauncherGrid;
   118 class MAknNaviDecoratorObserver;
   111 class MAknNaviDecoratorObserver;
   119 class CCustomStatuspaneIndicators;
   112 class CCustomStatuspaneIndicators;
   120 
   113 
   121 /**
   114 /**
   122  * TDisplayImagesCache
   115  * TDisplayImagesCache
   123  * 
   116  *
   124  * Non-persistant cache for display images per message. When user allows images to be downloaded
   117  * Non-persistant cache for display images per message. When user allows images to be downloaded
   125  * for a message, that message's id will be stored into the cache. Later if the message is re-opened 
   118  * for a message, that message's id will be stored into the cache. Later if the message is re-opened
   126  * and it is found in cache, images are allowed to be downloaded no matter what the global setting 
   119  * and it is found in cache, images are allowed to be downloaded no matter what the global setting
   127  * is. Message is added to cache only when the user presses the button, it will be removed from cache
   120  * is. Message is added to cache only when the user presses the button, it will be removed from cache
   128  * if the mailbox or the message itself is deleted.
   121  * if the mailbox or the message itself is deleted.
   129  */
   122  */
   130 class TDisplayImagesCache
   123 class TDisplayImagesCache
   131     {
   124     {
   132 public:
   125 public:
   133     
   126 
   134     /**
   127     /**
   135      * Destructor
   128      * Destructor
   136      */
   129      */
   137     ~TDisplayImagesCache();
   130     ~TDisplayImagesCache();
   138 
   131 
   139     /**
   132     /**
   140      * Add message to cache.
   133      * Add message to cache.
   141      */
   134      */
   142     void AddMessageL( const CFSMailMessageBase& aMsg );
   135     void AddMessageL( const CFSMailMessageBase& aMsg );
   143     
   136 
   144     /**
   137     /**
   145      * Remove message from cache.
   138      * Remove message from cache.
   146      */
   139      */
   147     void RemoveMessage( const CFSMailMessageBase& aMsg );
   140     void RemoveMessage( const CFSMailMessageBase& aMsg );
   148     
   141 
   149     /**
   142     /**
   150      * Check if the message is in cache. Returns ETrue if the message is found.
   143      * Check if the message is in cache. Returns ETrue if the message is found.
   151      */
   144      */
   152     TBool Contains( const CFSMailMessageBase& aMsg ) const;    
   145     TBool Contains( const CFSMailMessageBase& aMsg ) const;
   153     
   146 
   154     /**
   147     /**
   155      * Removes message from cache.
   148      * Removes message from cache.
   156      */
   149      */
   157     void RemoveMessage( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
   150     void RemoveMessage( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
   158     
   151 
   159     /**
   152     /**
   160      * Removes mailbox from cache.
   153      * Removes mailbox from cache.
   161      */
   154      */
   162     void RemoveMailbox( const TFSMailMsgId& aBoxId );
   155     void RemoveMailbox( const TFSMailMsgId& aBoxId );
   163 
   156 
   164 private: // internal methods
   157 private: // internal methods
   165     
   158 
   166     /**
   159     /**
   167      * Adds message to cache.
   160      * Adds message to cache.
   168      */
   161      */
   169     void AddMessageL( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
   162     void AddMessageL( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
   170 
   163 
   171     /**
   164     /**
   172      * Check if the message is in cache. Returns ETrue if the message is found.
   165      * Check if the message is in cache. Returns ETrue if the message is found.
   173      */
   166      */
   174     TBool Contains( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId ) const;    
   167     TBool Contains( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId ) const;
   175 
   168 
   176     /**
   169     /**
   177      * Returns index for given mailbox in cache or KErrNotFound if the mailbox cannot
   170      * Returns index for given mailbox in cache or KErrNotFound if the mailbox cannot
   178      * be found.
   171      * be found.
   179      */
   172      */
   180     TInt MailBoxIndex( const TFSMailMsgId& aBoxId ) const;
   173     TInt MailBoxIndex( const TFSMailMsgId& aBoxId ) const;
   181     
   174 
   182     /**
   175     /**
   183      * Adds new mailbox and returns index in cache.
   176      * Adds new mailbox and returns index in cache.
   184      */
   177      */
   185     void AddMailBoxL( const TFSMailMsgId& aBoxId, TInt& aCacheIndex );
   178     void AddMailBoxL( const TFSMailMsgId& aBoxId, TInt& aCacheIndex );
   186 
   179 
   187 private:    
   180 private:
   188     
   181 
   189     /**
   182     /**
   190      * Cache item.
   183      * Cache item.
   191      */
   184      */
   192     class TItem  
   185     class TItem
   193         {
   186         {
   194     public:
   187     public:
   195         /**
   188         /**
   196          * Constructor
   189          * Constructor
   197          */        
   190          */
   198         TItem( const TFSMailMsgId& aBoxId );
   191         TItem( const TFSMailMsgId& aBoxId );
   199         
   192 
   200         /**
   193         /**
   201          * Destructor
   194          * Destructor
   202          */
   195          */
   203         ~TItem();
   196         ~TItem();
   204         
   197 
   205         /**
   198         /**
   206          * Returns ETrue if given message Id is found in this box.
   199          * Returns ETrue if given message Id is found in this box.
   207          */
   200          */
   208         TBool Contains( const TFSMailMsgId& aMsgId ) const;
   201         TBool Contains( const TFSMailMsgId& aMsgId ) const;
   209 
   202 
   214 
   207 
   215         /**
   208         /**
   216          * Removes message from box.
   209          * Removes message from box.
   217          */
   210          */
   218         void RemoveMessage( const TFSMailMsgId& aMsgId );
   211         void RemoveMessage( const TFSMailMsgId& aMsgId );
   219     
   212 
   220         /**
   213         /**
   221          * Comparator for TLinearOrder, compares two items
   214          * Comparator for TLinearOrder, compares two items
   222          */
   215          */
   223         static TInt CompareItem( const TItem& aItem1, const TItem& aItem2 );
   216         static TInt CompareItem( const TItem& aItem1, const TItem& aItem2 );
   224     
   217 
   225     private:       
   218     private:
   226 
   219 
   227         /**
   220         /**
   228          * Comparator for TLinearOrder, compares two message Ids
   221          * Comparator for TLinearOrder, compares two message Ids
   229          */
   222          */
   230         static TInt CompareMsgId( const TFSMailMsgId& aId1, const TFSMailMsgId& aId2 );
   223         static TInt CompareMsgId( const TFSMailMsgId& aId1, const TFSMailMsgId& aId2 );
   231         
   224 
   232         /**
   225         /**
   233          * Returns index of the message in box or KErrNotFound.
   226          * Returns index of the message in box or KErrNotFound.
   234          */
   227          */
   235         TInt MessageIndex( const TFSMailMsgId& aMsgId ) const;
   228         TInt MessageIndex( const TFSMailMsgId& aMsgId ) const;
   236     
   229 
   237     private:
   230     private:
   238         
   231 
   239         // Mailbox Id        
   232         // Mailbox Id
   240         TFSMailMsgId iMailBoxId;
   233         TFSMailMsgId iMailBoxId;
   241         
   234 
   242         // Message Ids
   235         // Message Ids
   243         RArray<TFSMailMsgId> iMessageIds; 
   236         RArray<TFSMailMsgId> iMessageIds;
   244         };
   237         };
   245     
   238 
   246     // Cache
   239     // Cache
   247     RArray<TItem> iCache;    
   240     RArray<TItem> iCache;
   248     };
   241     };
   249 
   242 
   250 
   243 
   251 class CFreestyleEmailUiAppUi : public CAknViewAppUi,
   244 class CFreestyleEmailUiAppUi : public CAknViewAppUi,
   252     			               public MAlfActionObserver,
   245     			               public MAlfActionObserver,
   414 
   407 
   415     // Set connection status icon of title pane to visible
   408     // Set connection status icon of title pane to visible
   416     void ShowTitlePaneConnectionStatus();
   409     void ShowTitlePaneConnectionStatus();
   417     // Set connection status icon of title pane to hided
   410     // Set connection status icon of title pane to hided
   418     void HideTitlePaneConnectionStatus();
   411     void HideTitlePaneConnectionStatus();
       
   412     void GetConnectionStatusL( CConnectionStatusQueryExtension::TConnectionStatus& aConnStatus );
   419     // Draw connection status icon into title pane if set as visible.
   413     // Draw connection status icon into title pane if set as visible.
   420     // It is also possible to force connection indicator to wanted value
   414     // It is also possible to force connection indicator to wanted value
   421     // to achieve better user experience.
   415     // to achieve better user experience.
   422     void UpdateTitlePaneConnectionStatus( TForcedStatus aForcedStatus = ENoForce );
   416     void UpdateTitlePaneConnectionStatus( TForcedStatus aForcedStatus = ENoForce );
   423     // Return pointer to custom status pane indicators object
   417     // Return pointer to custom status pane indicators object
   466 
   460 
   467     // <cmail>
   461     // <cmail>
   468     TDisplayMode DisplayMode() const;
   462     TDisplayMode DisplayMode() const;
   469     // </cmail>
   463     // </cmail>
   470 
   464 
   471     
   465 
   472 	
   466 
   473 	
   467 
   474 	/**
   468 	/**
   475      * Returns the current flip status.
   469      * Returns the current flip status.
   476      * @return True if the flip is open, false otherwise.
   470      * @return True if the flip is open, false otherwise.
   477      */
   471      */
   478     TBool IsFlipOpen() const;
   472     TBool IsFlipOpen() const;
   479 
   473 
   480     TDisplayImagesCache& DisplayImagesCache();
   474     TDisplayImagesCache& DisplayImagesCache();
   481 
   475 
   482     // Set flag for judging if there is a embedded app in FSEmail.
   476     // Set flag for judging if there is a embedded app in FSEmail.
   483     void SetEmbeddedApp( TBool aEmbeddedApp );
   477     void SetEmbeddedApp( TBool aEmbeddedApp );
   484     
   478 
   485     // Return embedded app.
   479     // Return embedded app.
   486     TBool EmbeddedApp() const;
   480     TBool EmbeddedApp() const;
   487     
   481 
   488     // Set flag for judging if previous app is embedded.
   482     // Set flag for judging if previous app is embedded.
   489     void SetEmbeddedAppToPreviousApp( TBool aEmbeddedApp );
   483     void SetEmbeddedAppToPreviousApp( TBool aEmbeddedApp );
   490     
   484 
   491     // if previous app is embedded.
   485     // if previous app is embedded.
   492     TBool EmbeddedAppIsPreviousApp() const;
   486     TBool EmbeddedAppIsPreviousApp() const;
   493     
   487 
   494     // Set flag for judging if email editor started from embedded app.
   488     // Set flag for judging if email editor started from embedded app.
   495     void SetEditorStartedFromEmbeddedApp( TBool aEmbeddedApp );
   489     void SetEditorStartedFromEmbeddedApp( TBool aEmbeddedApp );
   496     
   490 
   497     // if email editor started from embedded app.
   491     // if email editor started from embedded app.
   498     TBool EditorStartedFromEmbeddedApp() const;
   492     TBool EditorStartedFromEmbeddedApp() const;
   499 
   493 
   500     // returns last seen pointer position
   494     // returns last seen pointer position
   501     const TPoint& LastSeenPointerPosition() const;
   495     const TPoint& LastSeenPointerPosition() const;
   502     
   496 
   503     // Runs fake sync animation (needed for better user experience as
   497     // Runs fake sync animation (needed for better user experience as
   504     // otherwise in some connection/sync states pressing "send & receive"
   498     // otherwise in some connection/sync states pressing "send & receive"
   505     // wouldn't have any visible effect.
   499     // wouldn't have any visible effect.
   506     void RunFakeSyncAnimL();
   500     void RunFakeSyncAnimL();
   507     
   501 
   508 public: //from MFSMailEventObserver
   502 public: //from MFSMailEventObserver
   509     /**
   503     /**
   510      * Framework event message.
   504      * Framework event message.
   511      * Used here to catch the events thrown from new mailbox creation process.
   505      * Used here to catch the events thrown from new mailbox creation process.
   512      *
   506      *
   818     TForcedStatus iForcedConnectionStatus;
   812     TForcedStatus iForcedConnectionStatus;
   819 
   813 
   820     // Set true, when application is going to be switched to backgound
   814     // Set true, when application is going to be switched to backgound
   821     // after the view deactivation.
   815     // after the view deactivation.
   822     TBool iSwitchingToBackground;
   816     TBool iSwitchingToBackground;
   823     
   817 
   824     TDisplayImagesCache iDisplayImagesCache;
   818     TDisplayImagesCache iDisplayImagesCache;
   825 
   819 
   826     // For handling the flip state.
   820     // For handling the flip state.
   827     CFreestyleEmailUiPropertySubscriber* iPropertySubscriber;
   821     CFreestyleEmailUiPropertySubscriber* iPropertySubscriber;
   828     TBool iFlipOpen;
   822     TBool iFlipOpen;
   831     TBool iFocusVisible;
   825     TBool iFocusVisible;
   832     TBool iTouchFeedbackCreated;
   826     TBool iTouchFeedbackCreated;
   833 
   827 
   834     // Embedded app flag.
   828     // Embedded app flag.
   835     TBool iHasEmbeddedApp;
   829     TBool iHasEmbeddedApp;
   836     
   830 
   837     // Flag for judging if previous app is embedded app.
   831     // Flag for judging if previous app is embedded app.
   838     TBool iPreviousAppEmbedded;
   832     TBool iPreviousAppEmbedded;
   839     
   833 
   840     // Flag for judging if email editor started from embedded app.
   834     // Flag for judging if email editor started from embedded app.
   841     TBool iEditorStartedFromEmbeddedApp;
   835     TBool iEditorStartedFromEmbeddedApp;
   842     
   836 
   843     TPoint iLastPointerPosition;
   837     TPoint iLastPointerPosition;
   844     };
   838     };
   845 
   839 
   846 
   840 
   847 /**
   841 /**