mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h
branchRCL_3
changeset 17 780c925249c1
parent 14 05b0d2323768
child 30 6f9f6e99a23e
equal deleted inserted replaced
15:d240f0a77280 17:780c925249c1
    22 #include <mtp/mtpprotocolconstants.h>
    22 #include <mtp/mtpprotocolconstants.h>
    23 
    23 
    24 #include "mmmtpdpfiledefs.h"
    24 #include "mmmtpdpfiledefs.h"
    25 
    25 
    26 // forward declacration
    26 // forward declacration
    27 class CMTPObjectMetaData;
    27 class RFs;
    28 class MMTPDataProviderFramework;
       
    29 
    28 
    30 class MmMtpDpUtility
    29 class MmMtpDpUtility
    31     {
    30     {
    32 public:
    31 public:
    33     /**
    32     /**
    50     * @return TBool for decide if there are some references
    49     * @return TBool for decide if there are some references
    51     */
    50     */
    52     static TBool HasReference( TUint16 aObjFormatCode );
    51     static TBool HasReference( TUint16 aObjFormatCode );
    53 
    52 
    54     /**
    53     /**
    55     * Utility function to decide if the file is video.
       
    56     * @param aFullFileName, the full file name
       
    57     * @return TBool for decide if the file is video
       
    58     */
       
    59     IMPORT_C static TBool IsVideo( const TDesC& aFullFileName );
       
    60 
       
    61     /**
       
    62     * Utility function to decide if the file is video.
       
    63     * For internal use, this is fast version by querying framework DB
       
    64     * @param aFullFileName, the full file name
       
    65     * @param aFramework, the mtp framework instance pointer, default is null
       
    66     * @return TBool for decide if the file is video
       
    67     */
       
    68     static TBool IsVideoL( const TDesC& aFullFileName, const MMTPDataProviderFramework& aFramework );
       
    69 
       
    70     /**
       
    71     * Utility function to decide if the file is video.
       
    72     * For internal use, this is fast version by querying framework DB
       
    73     * @param aFormatCode,
       
    74     * @param aSubFormatCode,
       
    75     * @return TBool for decide if the file is video
       
    76     */
       
    77     static TBool IsVideoL( TUint aFormatCode, TUint aSubFormatCode );
       
    78 
       
    79     /**
       
    80     * Check the filename length to see if it exceeds Symbian 256 limit.
    54     * Check the filename length to see if it exceeds Symbian 256 limit.
    81     * @param aPathName, the path name of the file
    55     * @param aPathName, the path name of the file
    82     * @param aFileName, the file to be check
    56     * @param aFileName, the file to be check
    83     * @return TBool for decide if the file name validate
    57     * @return TBool for decide if the file name validate
    84     */
    58     */
    97     * Get file date modified info
    71     * Get file date modified info
    98     * @param aFs , handle of file server session
    72     * @param aFs , handle of file server session
    99     * @param aFullFileName, fine name
    73     * @param aFullFileName, fine name
   100     * @return TTime for specified file
    74     * @return TTime for specified file
   101     */
    75     */
   102     static TTime GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName );
    76     static void GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName, TDes& aDateModified );
   103 
    77 
   104     /**
    78     /**
   105     * Check if file is read-only, if file doesn't exist, leave
    79     * Check if file is read-only, if file doesn't exist, leave
   106     * @param aFs , handle of file server session
    80     * @param aFs , handle of file server session
   107     * @param aFullFileName, the file to be check
    81     * @param aFullFileName, the file to be check
   159     * get the sub format code by mime
   133     * get the sub format code by mime
   160     * @param aMimeType, mime type
   134     * @param aMimeType, mime type
   161     * @param aSubFormatCode, output the sub format code
   135     * @param aSubFormatCode, output the sub format code
   162     * @return if success, return KErrNone, otherwise, error code
   136     * @return if success, return KErrNone, otherwise, error code
   163     */
   137     */
   164     static TInt SubFormatCodeFromMime( const TDesC8& aMimeType, TMmMtpSubFormatCode& aSubFormatCode );
   138     static TMmMtpSubFormatCode SubFormatCodeFromMime( const TDesC8& aMimeType );
   165 
   139 
   166     /**
   140     /**
   167     * Get DRM status
   141     * Get DRM status
   168     * @param aFullFileName, full file name
   142     * @param aFullFileName, full file name
   169     * @return return DRM status code
   143     * @return return DRM status code