messagingappbase/mce/inc/MceAttachmentAddition.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005 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:   Active object for adding an attachment to the entry
       
    15 *                in the message store (3.x platform).
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MCE_ATTACHMENT_ADDITION_H
       
    23 #define MCE_ATTACHMENT_ADDITION_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMsvEntry;
       
    31 class CMsvStore;
       
    32 class MMsvAttachmentManager;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  Active object for adding an attachment to the entry in the message store.
       
    39 *  @lib Mce.exe
       
    40 *  @since Series 60 3.0
       
    41 */
       
    42 class CMceAttachmentAddition : public CActive
       
    43 	{
       
    44     public:  // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49 	    static CMceAttachmentAddition* NewLC();
       
    50 	    
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54 	    ~CMceAttachmentAddition();
       
    55 	    
       
    56     public: // New functions	    
       
    57     
       
    58         /**
       
    59         * Requests the attachment manager to add the attachment and waits for the
       
    60         * operation to complete.
       
    61         * @since Series 60 3.0
       
    62         * @param aEntry: Entry in the message store
       
    63         * @param aFileName: Name of the attachment file
       
    64         * @param aSize: Size of the attachment file
       
    65         * @return None.
       
    66         */
       
    67         void AttachFileL( CMsvEntry* aEntry, TFileName aFileName, RFile& aFileHandle, TInt aSize );
       
    68 
       
    69 	    /**
       
    70         *
       
    71         * @since Series 60 3.0
       
    72         * @return Status of the asyncronous request.
       
    73         */	        
       
    74         TInt Result() const;
       
    75         
       
    76     public:  // Functions from base classes
       
    77     
       
    78         /**
       
    79         * From CActive, completion of the asyncronous request
       
    80         * @since Series 60 3.0
       
    81         * @return None.
       
    82         */ 
       
    83 	    void RunL();
       
    84 	    
       
    85 	    /**
       
    86         * From CActive, cancellation of the asyncronous request
       
    87         * @since Series 60 3.0
       
    88         * @return None.
       
    89         */        
       
    90         void DoCancel();
       
    91         
       
    92         /**
       
    93         * From CActive, handles the leaves from RunL
       
    94         * @since Series 60 3.0
       
    95         * @param aError: Error code
       
    96         * @return None.
       
    97         */
       
    98         TInt RunError( TInt );
       
    99 
       
   100     private:
       
   101 
       
   102         /**
       
   103         * C++ default constructor.
       
   104         */
       
   105 	    CMceAttachmentAddition();
       
   106 	
       
   107 	    /**
       
   108         * Resets internal state.
       
   109         * @since Series 60 3.0
       
   110         * @return None.
       
   111         */ 
       
   112 	    void Reset();
       
   113 
       
   114     private:     // Data
       
   115 
       
   116         CMsvStore*                  iStore;
       
   117         MMsvAttachmentManager*      iAttachmentManager;
       
   118         TInt                        iError;    
       
   119         CActiveSchedulerWait         iWait;
       
   120 	};
       
   121 
       
   122 #endif      // CMCE_ATTACHMENT_ADDITION_H
       
   123             
       
   124 // End of File