ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h
branchRCL_3
changeset 8 e1b6206813b4
parent 4 e7aa27f58ae1
child 24 d189ee25cf9d
equal deleted inserted replaced
4:e7aa27f58ae1 8:e1b6206813b4
    19 #ifndef IPSPLGSENDOPERATION_H
    19 #ifndef IPSPLGSENDOPERATION_H
    20 #define IPSPLGSENDOPERATION_H
    20 #define IPSPLGSENDOPERATION_H
    21 
    21 
    22 #include <smtcmtm.h>
    22 #include <smtcmtm.h>
    23 #include "ipsplgcommon.h"
    23 #include "ipsplgcommon.h"
       
    24 #include "ipsplgonlineoperation.h" // for MIpsPlgConnectOpCallback
    24 
    25 
    25 class CClientMtmRegistry;
    26 class CClientMtmRegistry;
    26 
    27 
    27 /**
    28 /**
    28  *  Class for smtp related operations
    29  *  Class for smtp related operations
       
    30  *
       
    31  *  This class encapsulates SMTP send new message and send pending messages
       
    32  *  operations.
       
    33  *
       
    34  *  This class requires CIpsPlgEventHandler for QueryUsrPassL method
       
    35  *  for handling login problems. Because this class is exported and
       
    36  *  CIpsPlgEventHandler isn`t, to avoid problems, iEventHandler is passed
       
    37  *  as TAny* and can be set only from ipssosplugin.
    29  *
    38  *
    30  *  @lib ipssosplugin.lib
    39  *  @lib ipssosplugin.lib
    31  *  @since FS 1.0
    40  *  @since FS 1.0
    32  */
    41  */
    33 //should this class inherited from online operation
    42 //should this class inherited from online operation
    34 NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : public CMsvOperation
    43 NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) :
       
    44     public CMsvOperation,
       
    45     public MIpsPlgConnectOpCallback
    35     {
    46     {
       
    47 public: //from MIpsPlgConnectOpCallback
       
    48 
       
    49     void CredientialsSetL( TInt aEvent );
       
    50 
    36 public:
    51 public:
    37 
    52 
    38     /**
    53     /**
    39      * Symbian 2nd phase construcror
    54      * Symbian 2nd phase construcror
    40      *
    55      *
    82     IMPORT_C void StartSendL( TMsvId aMessageId );
    97     IMPORT_C void StartSendL( TMsvId aMessageId );
    83     
    98     
    84     IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId );
    99     IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId );
    85 
   100 
    86     IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( );
   101     IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( );
       
   102 
       
   103 	/**
       
   104 	 *  Sets CIpsPlgEventHandler
       
   105 	 */
       
   106 	void SetEventHandler( TAny* aEventHandler );
    87     
   107     
    88 protected:
   108 protected:
    89 
   109 
    90     /**
   110     /**
    91      * Class constructor
   111      * Class constructor
   119 
   139 
   120 private: // From CActive
   140 private: // From CActive
   121 
   141 
   122     enum TIpsSendState
   142     enum TIpsSendState
   123         {
   143         {
   124         EMovingOutbox,
   144         EIdle,
   125         ESending
   145         EMovingOutbox,          // moving mail to OutBox folder
       
   146         ESending,               // sending mail
       
   147         EQueryingDetails,       // querying for password
       
   148         EQueryingDetailsBusy,   // another operation is querying for details
   126         };
   149         };
   127 
   150 
   128     /**
   151     /**
   129      * From CActive
   152      * From CActive
   130      *
   153      *
   156      * Validates an array of address
   179      * Validates an array of address
   157      * Either returns silently if everything id ok, or leaves with KErrBadName
   180      * Either returns silently if everything id ok, or leaves with KErrBadName
   158      * @param aRecipients array of addresses
   181      * @param aRecipients array of addresses
   159      */
   182      */
   160     void ValidateAddressArrayL( const CDesCArray& aRecipients );
   183     void ValidateAddressArrayL( const CDesCArray& aRecipients );
   161     
   184 
       
   185     /**
       
   186      * Send user password query request to CIpsPlgEventHandler
       
   187      * @return ETrue - if query send
       
   188      */
       
   189     TBool QueryUserPassL();
       
   190 
   162 private:
   191 private:
   163 
   192 
   164     CSmtpClientMtm*     iSmtpMtm;
   193     CSmtpClientMtm*     iSmtpMtm;
   165     CMsvOperation*      iOperation;
   194     CMsvOperation*      iOperation;
   166     CMsvEntrySelection* iSelection;
   195     CMsvEntrySelection* iSelection;
   167     CClientMtmRegistry* iMtmRegistry;
   196     CClientMtmRegistry* iMtmRegistry;
   168     TInt                iState;
   197     TInt                iState;
   169     TMsvId              iSmtpService;
   198     TMsvId              iSmtpService;
       
   199     // not owned
       
   200     TAny*               iEventHandler; // pointer to CIpsPlgEventHandler
   170     };
   201     };
   171 
   202 
   172 #endif /* IPSPLGSENDOPERATION_H */
   203 #endif /* IPSPLGSENDOPERATION_H */