emailservices/emailserver/inc/fsnotificationhandlerbase.h
branchRCL_3
changeset 22 d620048b4810
parent 12 4ce476e64c59
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
    27 class CFSMailClient;
    27 class CFSMailClient;
    28 class CFSMailFolder;
    28 class CFSMailFolder;
    29 class CFSMailMessage;
    29 class CFSMailMessage;
    30 class MFSNotificationHandlerMgr;
    30 class MFSNotificationHandlerMgr;
    31 class CFSNotificationHandlerHSConnection;
    31 class CFSNotificationHandlerHSConnection;
    32 
    32 class TFSMailMsgId;
       
    33 
       
    34 
       
    35 class TNewMailInfo
       
    36     {
       
    37 public:
       
    38     inline TNewMailInfo( TFSMailMsgId aMsgId, 
       
    39                          TFSMailMsgId aMailBoxId,
       
    40                          TFSMailMsgId aParentFolderId) 
       
    41     : iMsgId( aMsgId ), iMailBox( aMailBoxId ), iParentFolderId( aParentFolderId)
       
    42     { }
       
    43     
       
    44     TFSMailMsgId iMsgId;
       
    45     TFSMailMsgId iMailBox;
       
    46     TFSMailMsgId iParentFolderId;
       
    47     };
       
    48 
       
    49 class MFSTimerObserver
       
    50     {
       
    51     public:
       
    52 
       
    53     /**
       
    54      * TODO document me
       
    55      */
       
    56      virtual void TimerExpiredL() = 0;
       
    57 
       
    58      };
       
    59 
       
    60 class CNewMailNotificationTimer : public CTimer
       
    61     {
       
    62 public:
       
    63 
       
    64     static CNewMailNotificationTimer* NewL(
       
    65             MFSTimerObserver& aObserver );
       
    66     static CNewMailNotificationTimer* NewLC(
       
    67             MFSTimerObserver& aObserver );
       
    68 
       
    69     /**
       
    70      * Destructor.
       
    71      */
       
    72     virtual ~CNewMailNotificationTimer();
       
    73 
       
    74 
       
    75 protected:
       
    76   
       
    77     /**
       
    78      * Constructor.
       
    79      *
       
    80      * @since S60 ?S60_version
       
    81      * @param aObserver Observer of this timer.
       
    82      */ 
       
    83     CNewMailNotificationTimer(
       
    84             MFSTimerObserver& aObserver );
       
    85     void ConstructL();
       
    86 
       
    87 // from base class CActive
       
    88     virtual void DoCancel();
       
    89     virtual void RunL();
       
    90 
       
    91 private:
       
    92 
       
    93 
       
    94             
       
    95 private: // data
       
    96 
       
    97     /**
       
    98      * Observer and user of this timer.
       
    99      */    
       
   100     MFSTimerObserver& iObserver;
       
   101 
       
   102     };
    33 
   103 
    34 /**
   104 /**
    35  *  A base class for notification handlers that need timer services.
   105  *  A base class for notification handlers that need timer services.
    36  *
   106  *
    37  *  @code
   107  *  @code
    39  *  @endcode
   109  *  @endcode
    40  *
   110  *
    41  *  @lib ?library
   111  *  @lib ?library
    42  *  @since S60 ?S60_version *** for example, S60 v3.0
   112  *  @since S60 ?S60_version *** for example, S60 v3.0
    43  */
   113  */
    44 class CFSNotificationHandlerBase : public CBase, public MFSMailEventObserver
   114 class CFSNotificationHandlerBase : public CBase, public MFSMailEventObserver, public MFSTimerObserver
    45     {
   115     {
    46 public:
   116 public:
    47     
   117     
    48     /**
   118     /**
    49      * Two-phased constructor.
   119      * Two-phased constructor.
   131     *                   for newest unread message.
   201     *                   for newest unread message.
   132     * @return Boolean value to indicate whether newest unread
   202     * @return Boolean value to indicate whether newest unread
   133     *         messages was found among the identified messages.
   203     *         messages was found among the identified messages.
   134     */
   204     */
   135     virtual TBool MessagesCauseNotificationL( TFSMailMsgId aMailboxId,
   205     virtual TBool MessagesCauseNotificationL( TFSMailMsgId aMailboxId,
   136                                               CFSMailFolder& aParentFolder,
   206                                               TFSMailMsgId aParentFolderId,
   137                                               const RArray<TFSMailMsgId>& aMsgIdList );
   207                                               const RArray<TFSMailMsgId>& aMsgIdList );
   138     
   208     
   139 
   209 
   140     /**
   210     /**
   141     * Function that checks whether the given message is unread
   211     * Function that checks whether the given message is unread
   232      *
   302      *
   233      * @since S60 ?S60_version
   303      * @since S60 ?S60_version
   234      */  
   304      */  
   235     virtual void TurnNotificationOff() = 0;
   305     virtual void TurnNotificationOff() = 0;
   236     
   306     
       
   307 // from TODO
       
   308     virtual void TimerExpiredL();
       
   309     
   237 protected: // data
   310 protected: // data
   238 
   311 
   239     /**
   312     /**
   240      * Owner and manager of the instance of this handler class.
   313      * Owner and manager of the instance of this handler class.
   241      */    
   314      */    
   251      */    
   324      */    
   252     TBool iObserving;
   325     TBool iObserving;
   253     
   326     
   254     // Destructor key for the ECOM plugin
   327     // Destructor key for the ECOM plugin
   255     TUid                               iDestructorKey;
   328     TUid                               iDestructorKey;
       
   329     
       
   330     RArray<TNewMailInfo> iNewInboxEntries;
       
   331     
       
   332     CNewMailNotificationTimer* iTimer;
   256     };
   333     };
   257 
   334 
   258 #include "fsnotificationhandlerbase.inl"
   335 #include "fsnotificationhandlerbase.inl"
   259 
   336 
   260 #endif  //__FSNOTIFICATIONHANDLERBASE_H__
   337 #endif  //__FSNOTIFICATIONHANDLERBASE_H__