voicerecorder/AppSrc/CVRNewFileService.h
branchRCL_3
changeset 20 072a5fa0c63b
parent 19 2f5c9ee7098c
child 21 c6bafb5162d8
equal deleted inserted replaced
19:2f5c9ee7098c 20:072a5fa0c63b
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     This class is part of new file service framework.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CVRNEWFILESERVICE_H__
       
    21 #define __CVRNEWFILESERVICE_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <CNewFileServiceBase.h>
       
    25 #include "MVREmbeddedObserver.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31 * This class is part of new file service framework.
       
    32 */
       
    33 class CVRNewFileService
       
    34 	: public CNewFileServiceBase, public MVREmbeddedObserver
       
    35 	{
       
    36 
       
    37 	public:
       
    38 		static CVRNewFileService* NewL();
       
    39 		~CVRNewFileService();
       
    40 
       
    41 		/*
       
    42 		* Receive message from service to record new files
       
    43 		*/
       
    44         void HandleNewFileL( MNewFileServiceObserver* aObserver,
       
    45         							  CDesCArray& aFilenameArray,
       
    46         							  TNewServiceFileType aType,
       
    47         							  TBool aMultipleFiles );
       
    48 		/*
       
    49 		* Receive message from service to record new file into file handle
       
    50 		*/
       
    51         void HandleNewFileL( MNewFileServiceObserver* aObserver,
       
    52         							  RFile& aFile,
       
    53         							  TNewServiceFileType aType );
       
    54 
       
    55 		/*
       
    56 		* Receive message from service that file service has completed
       
    57 		* and can be closed
       
    58 		*/
       
    59 		void ServiceCompleteL();
       
    60 		
       
    61 	public: // MVREmbeddedObserver        							  
       
    62 		/*
       
    63 		* Receive comand from application that file named aName has been recorded
       
    64 		* @param aName The name of the recorded file
       
    65 		* @return Can the application be closed or should we wait
       
    66 		*/
       
    67 		virtual TBool FileCompleteL( const TDesC& aName );
       
    68 		
       
    69 		/*
       
    70 		* Receive command from application that file service must be aborted
       
    71 		*/
       
    72 		void AbortL();		
       
    73 
       
    74 	private:
       
    75 		CVRNewFileService();
       
    76 		
       
    77 	private: // data
       
    78 		/*
       
    79 		* Pointer to file service observer
       
    80 		*/
       
    81 		MNewFileServiceObserver* iObserver;
       
    82 		
       
    83 		/*
       
    84 		* If file service has already completed
       
    85 		*/
       
    86 		TBool iCompleted;
       
    87 
       
    88         /*
       
    89         * Are we recording to file handle or filenamearray
       
    90         */		
       
    91 		TBool iFileHandleUsed;
       
    92 	
       
    93 	    /*
       
    94 	    * Contains name of the target file. Not owned.
       
    95 	    */
       
    96 		CDesCArray* iFilenameArray;
       
    97 		
       
    98 		/*
       
    99 		* Used for asynchronic operations
       
   100 		*/
       
   101 		CActiveSchedulerWait iActiveWait;
       
   102 		
       
   103 	};
       
   104 
       
   105 #endif // __CVNEWFILESERVICE_H__
       
   106