ipsservices/ipssosplugin/inc/ipsplgeventhandler.h
branchRCL_3
changeset 24 d189ee25cf9d
parent 8 e1b6206813b4
child 25 3533d4323edc
equal deleted inserted replaced
23:dcf0eedfc1a3 24:d189ee25cf9d
    27 class CIpsPlgSosBasePlugin;
    27 class CIpsPlgSosBasePlugin;
    28 class CMsvSession;
    28 class CMsvSession;
    29 class CRepository;
    29 class CRepository;
    30 class CIpsPlgSettingsObserver;
    30 class CIpsPlgSettingsObserver;
    31 class CIpsPlgSyncStateObserver;
    31 class CIpsPlgSyncStateObserver;
    32 class CIpsSetDataApi;
    32 // <qmail> CIpsSetDataApi removed
    33 /**
    33 /**
    34 * MIpsPlgPropertyObserver
    34 * MIpsPlgPropertyObserver
    35 *
    35 *
    36 */
    36 */
    37 class MIpsPlgPropertyObserver
    37 class MIpsPlgPropertyObserver
    61     };
    61     };
    62 
    62 
    63 /**
    63 /**
    64 * Helper class to keep track of accounts
    64 * Helper class to keep track of accounts
    65 */
    65 */
    66 class CIPSAccountInfo : public CBase
    66 NONSHARABLE_CLASS ( CIPSAccountInfo ) : public CBase
    67     {
    67     {
    68 public:
    68 public:
    69 
    69 
    70     static CIPSAccountInfo* NewL(
    70     static CIPSAccountInfo* NewL(
    71         const TDesC& aName,
    71         const TDesC& aName,
    86 /**
    86 /**
    87  *
    87  *
    88  *  @lib ipssosplugin.lib
    88  *  @lib ipssosplugin.lib
    89  *  @since
    89  *  @since
    90  */
    90  */
    91 class CIpsPlgEventHandler : public CBase,
    91 NONSHARABLE_CLASS ( CIpsPlgEventHandler ) : public CBase,
    92                             public MMsvSessionObserver,
    92                             public MMsvSessionObserver,
    93                             public MIpsPlgSettingsObserverCallback,
    93                             public MIpsPlgSettingsObserverCallback,
    94                             public MIpsPlgPropertyObserver,
    94                             public MIpsPlgPropertyObserver
    95                             public MFSMailExceptionEventCallback
    95 // <qmail> not needed       public MFSMailExceptionEventCallback
    96     {
    96     {
    97 
    97 //public://from MFSMailExceptionEventCallback
    98 public://from MFSMailExceptionEventCallback
    98 //
    99 
    99 //    void ExceptionEventCallbackL( TFSMailMsgId aMailboxId, TInt aEventType, TBool aResponse );
   100     void ExceptionEventCallbackL( TFSMailMsgId aMailboxId, TInt aEventType, TBool aResponse );
   100 // </qmail>
   101 
   101 
   102 public: //from MIpsPlgPropertyObserver
   102 public: //from MIpsPlgPropertyObserver
   103     void HandlePropertyEventL(
   103     void HandlePropertyEventL(
   104             TInt aEvent, TInt aMailbox, TInt aPluginId, TInt aError );
   104             TInt aEvent, TInt aMailbox, TInt aPluginId, TInt aError );
   105 
   105 
   178 
   178 
   179     /**
   179     /**
   180      * Adds property observer, p&s (property) events are signaled to these
   180      * Adds property observer, p&s (property) events are signaled to these
   181      * observers
   181      * observers
   182      * @param aObservers interface to observer object
   182      * @param aObservers interface to observer object
   183      * @return error code from RProperty::Define function
   183      */
   184      */
   184     void RegisterPropertyObserverL( MIpsPlgPropertyObserver* aObserver );
   185     TInt RegisterPropertyObserverL( MIpsPlgPropertyObserver* aObserver );
       
   186 
   185 
   187     /**
   186     /**
   188      * Removes property observer
   187      * Removes property observer
   189      * @param aObserver pointer to observer to be removed, if null or
   188      * @param aObserver pointer to observer to be removed, if null or
   190      *                  unregisterd observer then function simply returns
   189      *                  unregisterd observer then function simply returns
   195      * Used by CIpsPlgPropetyWatcher active object
   194      * Used by CIpsPlgPropetyWatcher active object
   196      * @param aEvent property event
   195      * @param aEvent property event
   197      */
   196      */
   198     void NotifyPropertyEventL( TIpsPlgPropertyEvent aEvent );
   197     void NotifyPropertyEventL( TIpsPlgPropertyEvent aEvent );
   199 
   198 
   200     /**
   199 // <qmail> removing unused functions
   201      * used to inform ui offline state if connection attempt
   200     //    void SignalMailboxOfflineStateL( const TFSMailMsgId& aAccount );
   202      * was not successfull
   201     //    void QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback=NULL );
   203      * @param aAccount FS mailbox id
   202     //    void SignalCredientialsSetL( TInt aMailboxId, TBool aCancelled );
   204      */
   203 // </qmail>
   205     void SignalMailboxOfflineStateL( const TFSMailMsgId& aAccount );
       
   206 
       
   207     /**
       
   208      * Send user password query request to fs email ui.
       
   209      * Request is handled by emailserver.
       
   210      * Only one query at a time is allowed - restriction of CFSMailMessageQueryHandler
       
   211      * Operation callback is registered in handler and will receive notification
       
   212      * on query password finished.
       
   213      * 
       
   214      * @param aMbox entry id of mailbox service
       
   215      * @param aCallback callback interface to connection operation, defaut NULL
       
   216      * @param aIncoming incoming or outgoing password query
       
   217      * @return ETrue query invoked, wait for notification
       
   218      *         EFalse another query is in progress
       
   219      */
       
   220     TBool QueryUsrPassL(
       
   221         TMsvId aMbox,
       
   222         MIpsPlgConnectOpCallback* aCallback=NULL,
       
   223         TBool aIncoming=ETrue );
       
   224 
       
   225     /**
       
   226      * Query in progress is for incoming or outgoing mail.
       
   227      */
       
   228     TBool IncomingPass() const;
       
   229 
       
   230     /**
       
   231      * Send user password (=credentials) set signal to all plugin
       
   232      * instances via p&s (property) mechanism
       
   233      * @param aMailboxId entry id of mailbox
       
   234      * @param aCancelled indicates is user cancelled password dialog
       
   235      */
       
   236     void SignalCredientialsSetL( TInt aMailboxId, TBool aCancelled );
       
   237 
       
   238 private:
   204 private:
   239 
   205 // <qmail> removed enum TQueryUsrPassState
   240     /** States of Query user password operation */
       
   241     enum TQueryUsrPassState
       
   242         {
       
   243         EReady,                 // ready for action
       
   244         EBusy,                  // request in progress (invoker eventhandler`s state)
       
   245         ENotificationRequest,   // user notification request (emailserver eventhandler`s state)
       
   246         EPasswordRequest,       // password request (emailserver eventhandler`s state)
       
   247         ERequestResponding      // response for request received, handling in progress (invoker eventhandler`s state)
       
   248         };
       
   249 
   206 
   250     /**
   207     /**
   251     * Checks the source type of event and also
   208     * Checks the source type of event and also
   252     * checks is the event from IPS type  ( imap/pop ) entry
   209     * checks is the event from IPS type  ( imap/pop ) entry
   253     *
   210     *
   385         const TMsvEmailEntry& aParent,
   342         const TMsvEmailEntry& aParent,
   386         const CMsvEntrySelection& aDeletedIds,
   343         const CMsvEntrySelection& aDeletedIds,
   387         TFSMailMsgId& aFSParent,
   344         TFSMailMsgId& aFSParent,
   388         RArray<TFSMailMsgId>& aFSDeletedArray );
   345         RArray<TFSMailMsgId>& aFSDeletedArray );
   389 
   346 
   390 
   347     // <qmail> does nothing; removing
   391     /**
   348     //    void SaveSyncStatusL( TMsvId aMailboxId, TInt aState );
   392     * Saves last signalled sync status to settings
       
   393     */
       
   394     void SaveSyncStatusL( TMsvId aMailboxId, TInt aState );
       
   395 
   349 
   396     /**
   350     /**
   397     * Appends folder id to array if not already in there
   351     * Appends folder id to array if not already in there
   398     */
   352     */
   399     void SetFolderIdToArrayL( TMsvId aNewId );
   353     void SetFolderIdToArrayL( TMsvId aNewId );
   432     inline TFSMailMsgId SymId2FsId( const TMsvEntry& aEntry );
   386     inline TFSMailMsgId SymId2FsId( const TMsvEntry& aEntry );
   433 
   387 
   434     /**
   388     /**
   435     * Fills RArray FSMessage objects created from CMsvEntrySelection
   389     * Fills RArray FSMessage objects created from CMsvEntrySelection
   436     */
   390     */
   437     inline void FillFSMessageArray(
   391     inline void FillFSMessageArrayL(
   438             RArray<TFSMailMsgId>& aFSArray,
   392             RArray<TFSMailMsgId>& aFSArray,
   439             const CMsvEntrySelection* aSelection,
   393             const CMsvEntrySelection* aSelection,
   440             TUint aMtmUid );
   394             TUint aMtmUid );
   441 
   395 
       
   396 // <qmail> new function
       
   397     /**
       
   398      * Convert sync operation completion code to email framework's syncState
       
   399      * @param aStatus
       
   400      * @return syncstate
       
   401      */
       
   402     TSSMailSyncState ConvertCompletionCode( TInt aCompletionCode );
       
   403 // </qmail>
       
   404     
   442     CRepository*                            iCenRep;
   405     CRepository*                            iCenRep;
   443     CIpsSetDataApi*                         iSettingsApi;
       
   444 
   406 
   445     // not owned
   407     // not owned
   446     CMsvSession*                            iSession;
   408     CMsvSession*                            iSession;
   447 
   409 
   448     CIpsPlgSosBasePlugin&                   iBasePlugin;
   410     CIpsPlgSosBasePlugin&                   iBasePlugin;
   469     // base plugin id
   431     // base plugin id
   470     TUint                                   iPluginId;
   432     TUint                                   iPluginId;
   471 
   433 
   472     RArray<TMsvId>                          iImapFolderIds;
   434     RArray<TMsvId>                          iImapFolderIds;
   473 
   435 
   474     // state of the query user password operation
   436 // <qmail> MIpsPlgConnectOpCallback not used any more
   475     // diffrent states are for query invoker and query handler (emailserver)
   437 // <qmail> iQueryPassState, iConnOpCallbacks, iIncomingPass removed
   476     TQueryUsrPassState                      iQueryPassState;
       
   477     // array of operations which wait for query response
       
   478     // or possibilty to perform a query
       
   479     RPointerArray<MIpsPlgConnectOpCallback> iConnOpCallbacks;
       
   480     // query user password for incoming or outgoing
       
   481     TBool                                   iIncomingPass;
       
   482     };
   438     };
   483 
   439 
   484 
   440 
   485 #endif // IPSPLGEVENTHANDLER_H
   441 #endif // IPSPLGEVENTHANDLER_H
   486 
   442