emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 17 67369d1b217f
child 20 efd4f1afd43e
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
    35 class CMailMailboxDetails;
    35 class CMailMailboxDetails;
    36 class CMailCpsSettings;
    36 class CMailCpsSettings;
    37 class CMailExternalAccount;
    37 class CMailExternalAccount;
    38 class CMailPluginProxy;
    38 class CMailPluginProxy;
    39 class CEmailObserverPlugin;
    39 class CEmailObserverPlugin;
       
    40 class CMailCpsUpdateHelper;
    40 
    41 
    41 /**
    42 /**
    42  * CMail ContentPublishingService Handler class
    43  * CMail ContentPublishingService Handler class
    43  * Class implementing a handler functionality towards rest of the MailServer
    44  * Class implementing a handler functionality towards rest of the MailServer
    44  * 
    45  * 
    75     
    76     
    76     /**
    77     /**
    77      * Wraps all "Update*" methods
    78      * Wraps all "Update*" methods
    78      */
    79      */
    79     void UpdateFullL();    
    80     void UpdateFullL();    
       
    81 
       
    82     /**
       
    83      * Method that actually does the full update.
       
    84      * Used by CMailCpsUpdateHelper.
       
    85      */
       
    86     void DoUpdateFullL();    
    80 	
    87 	
    81     /**
    88     /**
    82      *
    89      *
    83      */
    90      */
    84     void UpdateMailboxesL(TInt aInstance, const TDesC& aContentId);
    91     void UpdateMailboxesL(TInt aInstance, const TDesC& aContentId);
   451     HBufC*                             iWaitingForNewMailbox;
   458     HBufC*                             iWaitingForNewMailbox;
   452     //
   459     //
   453     TFSMailMsgId                       iWaitingForNewWidget;
   460     TFSMailMsgId                       iWaitingForNewWidget;
   454     //
   461     //
   455     CAknGlobalNote*                    iQuery;
   462     CAknGlobalNote*                    iQuery;
       
   463     // Helper for limiting rate of updates to Homescreen widget
       
   464     CMailCpsUpdateHelper*              iUpdateHelper;
   456     };
   465     };
   457 
   466 
       
   467 //-----------------------------------------------------------------------------
       
   468 //-----------------------------------------------------------------------------
       
   469 
       
   470 // Helper class for limiting rate of updates to Homescreen widget
       
   471 
       
   472 // Don't make widget updates more often than this delay (milliseconds)
       
   473 #define KMailCpsHandlerUpdateDelay 1000
       
   474 
       
   475 class CMailCpsUpdateHelper : public CTimer
       
   476     {
       
   477     public:
       
   478         static CMailCpsUpdateHelper* NewLC( CMailCpsHandler *aHandler );
       
   479         static CMailCpsUpdateHelper* NewL( CMailCpsHandler *aHandler );
       
   480 
       
   481         virtual ~CMailCpsUpdateHelper();
       
   482 
       
   483         // Notify that Homescreen widget(s) should be updated
       
   484         void UpdateL();	
       
   485 
       
   486     protected:
       
   487         void ConstructL();
       
   488         virtual void RunL();
       
   489         TInt RunError( TInt aError );
       
   490 
       
   491     private:
       
   492         CMailCpsUpdateHelper( CMailCpsHandler *aHandler );
       
   493 
       
   494         // Performs the update, resets the timer, etc.
       
   495         void DoUpdateL();
       
   496 
       
   497         // Handler to use to do updates (not owned)
       
   498         CMailCpsHandler *iCpsHandler;
       
   499         // Whether or not an update is pending
       
   500         TBool iPending;
       
   501     };
       
   502 
       
   503 
   458 #endif  //__CMAILCPSHANDLER_H__
   504 #endif  //__CMAILCPSHANDLER_H__