mobilemessaging/audiomsg/inc/audiomessageoperation.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:   Base class for operations
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __AUDIOMESSAGEOPERATION_H
       
    21 #define __AUDIOMESSAGEOPERATION_H
       
    22 
       
    23 
       
    24 #include "audiomessagedocument.h"
       
    25 #include "amsoperationobserver.h"
       
    26 
       
    27 /**
       
    28  * active object for saving,launching, inserting and sending opers. 
       
    29  *
       
    30  * @lib audiomessage.exe
       
    31  * @since S60 v3.1
       
    32  */
       
    33 
       
    34 class CAudioMessageOperation : public CActive
       
    35     {
       
    36     public:  // New methods
       
    37 
       
    38         /**
       
    39          * Destructor
       
    40          */
       
    41         virtual ~CAudioMessageOperation();
       
    42 
       
    43         /**
       
    44         * Returns the error code set by the operation
       
    45         */
       
    46         TInt GetError( );
       
    47         
       
    48 
       
    49 	// From CActive
       
    50     protected: 
       
    51         /**
       
    52         * From CActive
       
    53         */
       
    54         virtual TInt RunError( TInt aError );
       
    55         
       
    56 
       
    57     // New methods
       
    58         /**
       
    59          * Constructor.
       
    60          */
       
    61         CAudioMessageOperation(
       
    62             MAmsOperationObserver& aObserver,
       
    63             CAudioMessageDocument& aDocument);
       
    64 
       
    65 	    /** 
       
    66 	     * Get active and complete own status with error code.
       
    67 	     * To be used when state machine loop must be terminated with error
       
    68 	     */
       
    69         void CompleteSelf( TInt aError );
       
    70 
       
    71         /**
       
    72          * Makes storecommit
       
    73          */
       
    74  		void  MakeCommitL( );
       
    75         
       
    76         /**
       
    77          * Uninitializes store
       
    78          */
       
    79         void UnInit( );
       
    80         
       
    81         /**
       
    82          * Set error code
       
    83          * @param TInt error code
       
    84          */
       
    85         void SetError( TInt aError );
       
    86 
       
    87         /**
       
    88         * Resets error code
       
    89         */
       
    90         void ResetError( );
       
    91         
       
    92         /*
       
    93 		* Creates smill
       
    94 		*/
       
    95 		void AddSmilL();
       
    96 		
       
    97 		/**
       
    98          * Calculates amout of attachments
       
    99          */
       
   100 		TInt CheckAttasL( );
       
   101  
       
   102         /**
       
   103          * Sets store for editing and attachmentmanager
       
   104          */
       
   105        	void DoEditInitL( );
       
   106 
       
   107         /**
       
   108          * Sets store for reading and attachmentmanager
       
   109          */
       
   110         void DoReadInitL( );
       
   111 
       
   112         /**
       
   113          * Returns the index of attactment aId
       
   114          */
       
   115         TInt TMsvIdToIndexL( TMsvAttachmentId& aId );
       
   116         
       
   117     protected: // data
       
   118         MAmsOperationObserver& iObserver;
       
   119         CAudioMessageDocument& iDocument;
       
   120 
       
   121         /**
       
   122          * errors 
       
   123 		 */
       
   124         TInt iError;
       
   125         MMsvAttachmentManager* iManager;
       
   126         MMsvAttachmentManagerSync* iManagerSync;
       
   127 
       
   128         /**
       
   129          * store 
       
   130          * Own.  
       
   131 		 */
       
   132         CMsvStore* iStore;
       
   133         CMsvMimeHeaders* iHeaders;
       
   134 
       
   135         TFileName iContentLocationFileName;
       
   136 
       
   137 
       
   138        	};
       
   139 
       
   140 #endif // __AUDIOMESSAGEOPERATION_H
       
   141 
       
   142