emailuis/emailui/inc/FreestyleEmailUiAppui.h
branchRCL_3
changeset 12 f5907b1a1053
parent 8 e1b6206813b4
child 13 0396474f30f5
equal deleted inserted replaced
8:e1b6206813b4 12:f5907b1a1053
   117 class CAknNavigationDecorator;
   117 class CAknNavigationDecorator;
   118 class CFSEmailDownloadInfoMediator;
   118 class CFSEmailDownloadInfoMediator;
   119 class MAknNaviDecoratorObserver;
   119 class MAknNaviDecoratorObserver;
   120 class CCustomStatuspaneIndicators;
   120 class CCustomStatuspaneIndicators;
   121 
   121 
       
   122 /**
       
   123  * TDisplayImagesCache
       
   124  * 
       
   125  * Non-persistant cache for display images per message. When user allows images to be downloaded
       
   126  * for a message, that message's id will be stored into the cache. Later if the message is re-opened 
       
   127  * and it is found in cache, images are allowed to be downloaded no matter what the global setting 
       
   128  * is. Message is added to cache only when the user presses the button, it will be removed from cache
       
   129  * if the mailbox or the message itself is deleted.
       
   130  */
       
   131 class TDisplayImagesCache
       
   132     {
       
   133 public:
       
   134     
       
   135     /**
       
   136      * Destructor
       
   137      */
       
   138     ~TDisplayImagesCache();
       
   139 
       
   140     /**
       
   141      * Add message to cache.
       
   142      */
       
   143     void AddMessageL( const CFSMailMessageBase& aMsg );
       
   144     
       
   145     /**
       
   146      * Remove message from cache.
       
   147      */
       
   148     void RemoveMessage( const CFSMailMessageBase& aMsg );
       
   149     
       
   150     /**
       
   151      * Check if the message is in cache. Returns ETrue if the message is found.
       
   152      */
       
   153     TBool Contains( const CFSMailMessageBase& aMsg ) const;    
       
   154     
       
   155     /**
       
   156      * Removes message from cache.
       
   157      */
       
   158     void RemoveMessage( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
       
   159     
       
   160     /**
       
   161      * Removes mailbox from cache.
       
   162      */
       
   163     void RemoveMailbox( const TFSMailMsgId& aBoxId );
       
   164 
       
   165 private: // internal methods
       
   166     
       
   167     /**
       
   168      * Adds message to cache.
       
   169      */
       
   170     void AddMessageL( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
       
   171 
       
   172     /**
       
   173      * Check if the message is in cache. Returns ETrue if the message is found.
       
   174      */
       
   175     TBool Contains( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId ) const;    
       
   176 
       
   177     /**
       
   178      * Returns index for given mailbox in cache or KErrNotFound if the mailbox cannot
       
   179      * be found.
       
   180      */
       
   181     TInt MailBoxIndex( const TFSMailMsgId& aBoxId ) const;
       
   182     
       
   183     /**
       
   184      * Adds new mailbox and returns index in cache.
       
   185      */
       
   186     void AddMailBoxL( const TFSMailMsgId& aBoxId, TInt& aCacheIndex );
       
   187 
       
   188 private:    
       
   189     
       
   190     /**
       
   191      * Cache item.
       
   192      */
       
   193     class TItem  
       
   194         {
       
   195     public:
       
   196         /**
       
   197          * Constructor
       
   198          */        
       
   199         TItem( const TFSMailMsgId& aBoxId );
       
   200         
       
   201         /**
       
   202          * Destructor
       
   203          */
       
   204         ~TItem();
       
   205         
       
   206         /**
       
   207          * Returns ETrue if given message Id is found in this box.
       
   208          */
       
   209         TBool Contains( const TFSMailMsgId& aMsgId ) const;
       
   210 
       
   211         /**
       
   212          * Adds new message Id into box.
       
   213          */
       
   214         void AddMessageL( const TFSMailMsgId& aMsgId );
       
   215 
       
   216         /**
       
   217          * Removes message from box.
       
   218          */
       
   219         void RemoveMessage( const TFSMailMsgId& aMsgId );
       
   220     
       
   221         /**
       
   222          * Comparator for TLinearOrder, compares two items
       
   223          */
       
   224         static TInt CompareItem( const TItem& aItem1, const TItem& aItem2 );
       
   225     
       
   226     private:       
       
   227 
       
   228         /**
       
   229          * Comparator for TLinearOrder, compares two message Ids
       
   230          */
       
   231         static TInt CompareMsgId( const TFSMailMsgId& aId1, const TFSMailMsgId& aId2 );
       
   232         
       
   233         /**
       
   234          * Returns index of the message in box or KErrNotFound.
       
   235          */
       
   236         TInt MessageIndex( const TFSMailMsgId& aMsgId ) const;
       
   237     
       
   238     private:
       
   239         
       
   240         // Mailbox Id        
       
   241         TFSMailMsgId iMailBoxId;
       
   242         
       
   243         // Message Ids
       
   244         RArray<TFSMailMsgId> iMessageIds; 
       
   245         };
       
   246     
       
   247     // Cache
       
   248     RArray<TItem> iCache;    
       
   249     };
       
   250 
       
   251 
   122 class CFreestyleEmailUiAppUi : public CAknViewAppUi,
   252 class CFreestyleEmailUiAppUi : public CAknViewAppUi,
   123     			               public MAlfActionObserver,
   253     			               public MAlfActionObserver,
   124     			               public MFSMailRequestObserver,
   254     			               public MFSMailRequestObserver,
   125     			               public MFSMailEventObserver,
   255     			               public MFSMailEventObserver,
   126     			               public MMsvSessionObserver,
   256     			               public MMsvSessionObserver,
   339 
   469 
   340     // <cmail>
   470     // <cmail>
   341     TDisplayMode DisplayMode() const;
   471     TDisplayMode DisplayMode() const;
   342     // </cmail>
   472     // </cmail>
   343 
   473 
   344     /**
   474     
       
   475 	
       
   476 	
       
   477 	/**
   345      * Returns the current flip status.
   478      * Returns the current flip status.
   346      * @return True if the flip is open, false otherwise.
   479      * @return True if the flip is open, false otherwise.
   347      */
   480      */
   348     TBool IsFlipOpen() const;
   481     TBool IsFlipOpen() const;
   349 
   482 
       
   483     TDisplayImagesCache& DisplayImagesCache();
       
   484 
       
   485     // Set flag for judging if there is a embedded app in FSEmail.
       
   486     void SetEmbeddedApp( TBool aEmbeddedApp );
       
   487     
       
   488     // Return embedded app.
       
   489     TBool EmbeddedApp() const;
       
   490     
       
   491     // Set flag for judging if previous app is embedded.
       
   492     void SetEmbeddedAppToPreviousApp( TBool aEmbeddedApp );
       
   493     
       
   494     // if previous app is embedded.
       
   495     TBool EmbeddedAppIsPreviousApp() const;
       
   496     
       
   497     // Set flag for judging if email editor started from embedded app.
       
   498     void SetEditorStartedFromEmbeddedApp( TBool aEmbeddedApp );
       
   499     
       
   500     // if email editor started from embedded app.
       
   501     TBool EditorStartedFromEmbeddedApp() const;
   350 
   502 
   351 public: //from MFSMailEventObserver
   503 public: //from MFSMailEventObserver
   352     /**
   504     /**
   353      * Framework event message.
   505      * Framework event message.
   354      * Used here to catch the events thrown from new mailbox creation process.
   506      * Used here to catch the events thrown from new mailbox creation process.
   665     TForcedStatus iForcedConnectionStatus;
   817     TForcedStatus iForcedConnectionStatus;
   666 
   818 
   667     // Set true, when application is going to be switched to backgound
   819     // Set true, when application is going to be switched to backgound
   668     // after the view deactivation.
   820     // after the view deactivation.
   669     TBool iSwitchingToBackground;
   821     TBool iSwitchingToBackground;
       
   822     
       
   823     TDisplayImagesCache iDisplayImagesCache;
   670 
   824 
   671     // For handling the flip state.
   825     // For handling the flip state.
   672     CFreestyleEmailUiPropertySubscriber* iPropertySubscriber;
   826     CFreestyleEmailUiPropertySubscriber* iPropertySubscriber;
   673     TBool iFlipOpen;
   827     TBool iFlipOpen;
   674 
   828 
   675     /// Focus visibility state
   829     /// Focus visibility state
   676     TBool iFocusVisible;
   830     TBool iFocusVisible;
       
   831     TBool iTouchFeedbackCreated;
       
   832 
       
   833     // Embedded app flag.
       
   834     TBool iHasEmbeddedApp;
       
   835     
       
   836     // Flag for judging if previous app is embedded app.
       
   837     TBool iPreviousAppEmbedded;
       
   838     
       
   839     // Flag for judging if email editor started from embedded app.
       
   840     TBool iEditorStartedFromEmbeddedApp;
   677     };
   841     };
   678 
   842 
   679 
   843 
   680 /**
   844 /**
   681 *  CFSEmailUiAutosyncMonitor.
   845 *  CFSEmailUiAutosyncMonitor.