ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h
changeset 0 8466d47a6819
child 4 e7aa27f58ae1
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: This file defines class CIpsPlgSmtpOperation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IPSPLGSENDOPERATION_H
       
    20 #define IPSPLGSENDOPERATION_H
       
    21 
       
    22 #include <smtcmtm.h>
       
    23 #include "ipsplgcommon.h"
       
    24 
       
    25 class CClientMtmRegistry;
       
    26 
       
    27 /**
       
    28  *  Class for smtp related operations
       
    29  *
       
    30  *  @lib ipssosplugin.lib
       
    31  *  @since FS 1.0
       
    32  */
       
    33 //should this class inherited from online operation
       
    34 NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : public CMsvOperation
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Symbian 2nd phase construcror
       
    40      *
       
    41      * @since FS 1.0
       
    42      * @return None
       
    43      */
       
    44     IMPORT_C static CIpsPlgSmtpOperation* NewL( 
       
    45         CMsvSession& aMsvSession, 
       
    46         TInt aPriority, 
       
    47         TRequestStatus& aObserverRequestStatus,
       
    48         TBool aUsePublishSubscribe );
       
    49 
       
    50     /**
       
    51      * Symbian 2nd phase construcror
       
    52      *
       
    53      * @since FS 1.0
       
    54      * @return None
       
    55      */
       
    56     IMPORT_C static CIpsPlgSmtpOperation* NewLC(
       
    57         CMsvSession& aMsvSession, 
       
    58         TInt aPriority, 
       
    59         TRequestStatus& aObserverRequestStatus,
       
    60         TBool aUsePublishSubscribe );
       
    61 
       
    62     /**
       
    63      * Class destructor
       
    64      *
       
    65      * @since FS 1.0
       
    66      * @return None
       
    67      */ 
       
    68     virtual ~CIpsPlgSmtpOperation( );
       
    69     
       
    70     /**
       
    71      * From CMsvOperation
       
    72      */ 
       
    73     virtual const TDesC8& ProgressL();
       
    74     
       
    75     /**
       
    76      * Stard sending operation
       
    77      *
       
    78      * @param aSelection message selection for send messages
       
    79      * @since FS 1.0
       
    80      * @return None
       
    81      */     
       
    82     IMPORT_C void StartSendL( TMsvId aMessageId );
       
    83     
       
    84     IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId );
       
    85 
       
    86     IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( );
       
    87     
       
    88 protected:
       
    89 
       
    90     /**
       
    91      * Class constructor
       
    92      *
       
    93      * @since FS 1.0
       
    94      * @return None
       
    95      */
       
    96     CIpsPlgSmtpOperation( 
       
    97         CMsvSession& aMsvSession, 
       
    98         TInt aPriority, 
       
    99         TRequestStatus& aObserverRequestStatus );
       
   100     
       
   101     /**
       
   102      * Constructor for leaving methods
       
   103      *
       
   104      * @since FS 1.0
       
   105      * @return None
       
   106      */    
       
   107     void ConstructL( );
       
   108 
       
   109 private: // From CActive
       
   110 
       
   111     enum TIpsSendState
       
   112         {
       
   113         EMovingOutbox,
       
   114         ESending
       
   115         };
       
   116 
       
   117     /**
       
   118      * From CActive
       
   119      *
       
   120      * @since FS 1.0
       
   121      */
       
   122     void RunL( );
       
   123     void DoCancel( );
       
   124     
       
   125     /**
       
   126      *
       
   127      * @since FS 1.0
       
   128      */
       
   129     void CallSendL( );
       
   130     
       
   131     /**
       
   132      *
       
   133      * @since FS 1.0
       
   134      */
       
   135     void ConstructSmtpMtmL();
       
   136     
       
   137     /**
       
   138      * Validates all recipient addresses (to, cc, bcc)
       
   139      * Either returns silently if everything id ok, or leaves with KErrBadName
       
   140      * @param aEntry refers to message to be validated
       
   141      */
       
   142     void ValidateRecipientsL( CMsvEntry& aEntry );
       
   143     
       
   144     /**
       
   145      * Validates an array of address
       
   146      * Either returns silently if everything id ok, or leaves with KErrBadName
       
   147      * @param aRecipients array of addresses
       
   148      */
       
   149     void ValidateAddressArrayL( const CDesCArray& aRecipients );
       
   150     
       
   151 private:
       
   152 
       
   153     CSmtpClientMtm*     iSmtpMtm;
       
   154     CMsvOperation*      iOperation;
       
   155     CMsvEntrySelection* iSelection;
       
   156     CClientMtmRegistry* iMtmRegistry;
       
   157     TInt                iState;
       
   158     TMsvId              iSmtpService;
       
   159     };
       
   160 
       
   161 #endif /* IPSPLGSENDOPERATION_H */