mmappcomponents/audiofetcher/inc/audiofetcher.h
changeset 0 a2952bb97e68
child 63 91d5ad76f5c6
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2009 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: Media Fetch plug-in for audio files
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef AUDIOFETCHER_H
       
    19 #define AUDIOFETCHER_H
       
    20 
       
    21 
       
    22 // INCLUDES
       
    23 #include <badesca.h>
       
    24 #include <f32file.h>
       
    25 #include <mediafetchimplementation.h>
       
    26 #include <MMGFetchCanceler.h> // MMGFetchCanceler
       
    27 
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  *  Media Fetch plug-in for audio files
       
    33  *
       
    34  *  Implements the Media Fetch Implementation API
       
    35  *
       
    36  *  @lib AudioFetcher.lib
       
    37  *  @since S60 5.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CAudioFetcher ) :	public CMediaFetchImplementation,
       
    40 										public MMGFetchCanceler 
       
    41                                                                                   														
       
    42 	{
       
    43 	
       
    44 	public: //constructor and desctructor
       
    45 
       
    46 		/**
       
    47 		* Two-phased constructor.
       
    48 		*
       
    49 		* @since 5.0
       
    50 		* @return Pointer to newly created object.
       
    51 		*/
       
    52 		static CAudioFetcher* NewL();
       
    53 		
       
    54 		/**
       
    55 		* Destructor.
       
    56 		*/
       
    57 		virtual ~CAudioFetcher();
       
    58 		
       
    59 	protected:	// from CMediaFetchImplementation
       
    60 
       
    61 		/**
       
    62 		* By default fetcher is single selection fetcher.
       
    63 		* If multi-selection is enabled then plug-in should display a
       
    64 		* multi-selection fetcher and allow user to select several items.
       
    65 		* @param aMultiSelect if ETrue then multiselection fetcher is enabled
       
    66 		*/
       
    67 		void SetMultiSelectionL( TBool aMultiSelect );
       
    68 
       
    69 		/**
       
    70 		* Not in requirement
       
    71 		* @param aMimeTypes plug-in should show only files with given Mime types
       
    72 		*/
       
    73 		void SetMimeTypesL( const MDesCArray& aMimeTypes );
       
    74 
       
    75 		/**
       
    76 		* Plug-in should use given text as selection key (SK1) label
       
    77 		* @param aSelectionSoftkey Custom selection softkey label
       
    78 		*/
       
    79 		void SetSelectionSoftkeyL( const TDesC& aSelectionSoftkey );
       
    80 
       
    81 		/**
       
    82 		* Plug-in should use given text as heading
       
    83 		* @param aTitle Custom title text for fetcher
       
    84 		*/
       
    85 		void SetHeadingL( const TDesC& aTitle );
       
    86 
       
    87 		/**
       
    88 		* Plug-in should call this interface before selection is done.
       
    89 		* if MMGFetchVerifier::VerifySelectionL() returns ETrue
       
    90 		* then the user's selection should be accepted and the fetcher
       
    91 		* closed. If EFalse is returned then user should change the current
       
    92 		* selection before it can be accepted and the fetcher closed.
       
    93 		* @param aVerifier See MMGFetchVerifier.h
       
    94 		*/
       
    95 		void SetVerifierL( MMGFetchVerifier& aVerifier );
       
    96 
       
    97 		/**
       
    98 		* Plug-in should return canceler interface.
       
    99 		* @param aCanceler See MMGFetchCanceler.h
       
   100 		*/
       
   101 		void GetCancelerL( MMGFetchCanceler*& aCanceler );
       
   102 
       
   103 		/**
       
   104 		* Plug-in should launch fetcher popup for given media type.
       
   105 		* @param aSelectedFiles plug-in appends selected files to this array
       
   106 		* @param aMediaType plug-in should display only files with this media type
       
   107 		* return ETrue if user selected file(s), EFalse if use cancelled.
       
   108 		*/
       
   109 		TBool LaunchL( CDesCArray& aSelectedFiles, TMediaFileType aMediaType );
       
   110     
       
   111 
       
   112 	private : // Constructor and desctructor  
       
   113 	
       
   114 		/**
       
   115 		* C++ default constructor.
       
   116 		*/
       
   117 		CAudioFetcher();
       
   118 		 
       
   119 		/**
       
   120 		* By default Symbian 2nd phase constructor is private.
       
   121 		*/
       
   122 		void ConstructL();
       
   123 
       
   124 	private: // New Functions
       
   125 	    
       
   126 	    /**
       
   127 	     * Gets the resource filename
       
   128 	     */
       
   129 	    void GetResourceFilenameL( TFileName& aResFile );
       
   130 
       
   131 		/** 
       
   132 		* @return view title when fetcher is opened for selecting audio
       
   133 		*/
       
   134 		HBufC* TitleForAudioFetcherL() const;
       
   135 		
       
   136 		/**
       
   137 		 * @return view title when fetcher is opened for selecting any media files
       
   138 		 */
       
   139 		HBufC* TitleForAnyMediaFileFetcherL() const;
       
   140 
       
   141 		/** 
       
   142 		* @param aSingleSelectionTitleResourceId Resource id for view title when 
       
   143 		*                                        single selection is active
       
   144 		* @param aMultiSelectionTitleResourceId Resource id for view title when 
       
   145 		*                                       multiselection is active
       
   146 		* @return view title depending whether fetcher is in multiselection or 
       
   147 		*         single selection mode, and whether client has defined the title
       
   148 		*/
       
   149 		HBufC* TitleL( TInt aSingleSelectionTitleResourceId ) const;   
       
   150         
       
   151 		
       
   152 	private: // From MMGFetchCanceler
       
   153 
       
   154 		/**
       
   155 		* @see MMGFetchCanceler
       
   156 		*/
       
   157  		void CancelFetcherL();
       
   158  
       
   159 	private: // Data
       
   160 
       
   161 		// Resource offset
       
   162 		TInt   iResourceOffset;
       
   163         
       
   164 		// media type   
       
   165 		TMediaFileType iMediaType;
       
   166 	
       
   167 		TBool iIsMultiSelection;
       
   168 
       
   169 		/**
       
   170 		* Left softkey label
       
   171 		* Own.
       
   172 		*/
       
   173 		HBufC* iSelectionSoftkey;
       
   174 
       
   175 		/**
       
   176 		* Popup heading text
       
   177 		* Own.
       
   178 		*/
       
   179 		HBufC* iTitle;
       
   180    
       
   181 		/**
       
   182 		* Verifier
       
   183 		*/
       
   184 		MMGFetchVerifier* iVerifier;
       
   185 		};
       
   186 
       
   187 #endif // AUDIOFETCHER_H
       
   188 
       
   189 // End of File
       
   190