upnpsharing/upnpdlnaprofiler/inc/upnpdlnaprofiler.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006-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:      Header file of CUpnpDlnaProfiler class. CUpnpDlnaProfiler is 
       
    15 *                a class used for resolving a DLNA profile of a given file.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef C_UPNPDLNAPROFILER_H
       
    25 #define C_UPNPDLNAPROFILER_H
       
    26 
       
    27 // system includes
       
    28 #include <e32base.h>
       
    29 
       
    30 // user includes
       
    31 // NONE
       
    32 
       
    33 // forward declarations
       
    34 class MUpnpProfiler;
       
    35 class RFile;
       
    36 class CDesC16ArrayFlat;
       
    37 class CUpnpResParameters;
       
    38 
       
    39 // data types
       
    40 // NONE
       
    41 
       
    42 // constants
       
    43 const TInt KMimeStartLength = 5;
       
    44 _LIT8( KAudio, "audio" );
       
    45 _LIT8( KImage, "image" );
       
    46 _LIT8( KVideo, "video" );
       
    47 
       
    48 /**
       
    49  *  CUpnpDlnaProfiler is a class for resolving DLNA profile for a given file.
       
    50  *
       
    51  *  CUpnpDlnaProfiler class can be used to resolve a DLNA profile for a media 
       
    52  *  file (image, AV, video). User of this class can also query for a list of 
       
    53  *  currently supported DLNA profiles.
       
    54  *
       
    55  *  @lib dlnaprofiler.lib
       
    56  *  @since S60 v3.1
       
    57  */
       
    58 class CUpnpDlnaProfiler: public CBase
       
    59     {
       
    60 public:
       
    61 
       
    62     IMPORT_C static CUpnpDlnaProfiler* NewL();
       
    63 
       
    64     IMPORT_C static CUpnpDlnaProfiler* NewLC();
       
    65 
       
    66     virtual ~CUpnpDlnaProfiler();
       
    67 
       
    68     /**
       
    69      * SupportedProfilesL returns DLNA profiles that are currently supported.
       
    70      *
       
    71      * @since S60 v3.1
       
    72      * @param aProfiles Descriptor array where supported DLNA profiles are 
       
    73      *                  added.
       
    74      * @return TInt Error code, KErrNone if successfull.
       
    75      */
       
    76     IMPORT_C TInt SupportedProfilesL( CDesC16ArrayFlat* aProfiles ) const;
       
    77 
       
    78     /**
       
    79      * ProfileForFileL is for resolving a DLNA profile of a given file.
       
    80      *
       
    81      * @since S60 v3.1
       
    82      * @param aFileName Filename of the file which is to be resolved.
       
    83      *        Filename must contain full path (drive+path+filename).
       
    84      * @return DLNA profile of the file as a HBufC*, 
       
    85      *         NULL if could not be resolved
       
    86      */
       
    87     IMPORT_C HBufC* ProfileForFileL( const TDesC& aFilename );
       
    88     
       
    89     /**
       
    90      * ProfileForFileL is for resolving a DLNA profile of a given file.
       
    91      * Takes RFile and CUpnpResParameters parameters in order to minimize 
       
    92      * the amount of file opening.
       
    93      * @since S60 v3.1
       
    94      * @param aFileName Filename of the file which is to be resolved.
       
    95      *        Filename must contain full path (drive+path+filename).
       
    96      * @param aFile Handle to opened file specified by aFilename.
       
    97      * @param aParameters Res parameters that are already known.
       
    98      * @return DLNA profile of the file as a HBufC*, 
       
    99      *         NULL if could not be resolved
       
   100      */
       
   101     IMPORT_C HBufC* ProfileForFileL( const TDesC& aFilename, 
       
   102                                      RFile& aFile,
       
   103                                      CUpnpResParameters& aParameters );
       
   104     
       
   105 private:
       
   106 
       
   107     CUpnpDlnaProfiler();
       
   108 
       
   109     void ConstructL();
       
   110 
       
   111     /**
       
   112      * DlnaProfileFromSolversL checks the mime type given as parameter and
       
   113      * forwards the recognition task to solver plugins corresponding the
       
   114      * mimetype.
       
   115      * @param aFileName Filename of the file which is to be resolved.
       
   116      *        Filename must contain full path (drive+path+filename).
       
   117      * @param aMimeType Mime type of file specified by aFilename.
       
   118      * @param aFile Handle to opened file specified by aFilename.
       
   119      * @return pointer to descriptor containing resolved DLNA profile
       
   120      * @since S60 v3.1
       
   121      */
       
   122     HBufC* DlnaProfileFromSolversL( const TDesC& aFilename, 
       
   123                                     const TDesC8& aMimetype, 
       
   124                                     RFile& aFile );
       
   125 
       
   126 private: // data
       
   127 
       
   128     /**
       
   129      * iAudioSolvers is a list of audio solver plugins. Base solver plugin is 
       
   130      * the first one on the list and the rest are product specific solvers.
       
   131      * These are used for resolving a DLNA profile of an audio file.
       
   132      */
       
   133     RPointerArray<MUpnpProfiler> iAudioSolvers; // elements owned
       
   134 
       
   135     /**
       
   136      * iAvSolvers is a list of AV solver plugins. Base solver plugin is 
       
   137      * the first one on the list and the rest are product specific solvers.
       
   138      * These are used for resolving a DLNA profile of an AV (video) file.
       
   139      */
       
   140     RPointerArray<MUpnpProfiler> iAvSolvers; // elements owned
       
   141     
       
   142     /**
       
   143      * iImageSolvers is a list of image solver plugins. Base solver plugin is 
       
   144      * the first one on the list and the rest are product specific solvers.
       
   145      * These are used for resolving a DLNA profile of an image file.
       
   146      */
       
   147     RPointerArray<MUpnpProfiler> iImageSolvers; // elements owned
       
   148 
       
   149     };
       
   150 
       
   151 
       
   152 #endif // C_UPNPDLNAPROFILER_H