mtpfws/mtpfw/dataproviders/dputility/inc/rmtputility.h
changeset 0 d0791faffa3f
child 2 4843bb5893b6
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef RMTPUTILITY_H_
       
    23 #define RMTPUTILITY_H_
       
    24 
       
    25 #include <e32std.h> 
       
    26 #include <e32base.h>
       
    27 #include <badesca.h>
       
    28 #include <mtp/mtpprotocolconstants.h>
       
    29 #include "rmtpframework.h"
       
    30 #include "mtpdebug.h"
       
    31 
       
    32 class MMTPDataProviderFramework;
       
    33 class CMTPObjectMetaData;
       
    34 class CMTPExtensionMapping;
       
    35 
       
    36 class RMTPUtility
       
    37 	{
       
    38 public:
       
    39 	RMTPUtility();
       
    40 	
       
    41     void OpenL(MMTPDataProviderFramework& aFramework);
       
    42     void Close();
       
    43     
       
    44 public:
       
    45 	IMPORT_C TBool TTime2MTPTimeStr(const TTime& aTime, TDes& aRet ) const;
       
    46 	IMPORT_C TBool MTPTimeStr2TTime(const TDesC& aTimeString, TTime& aRet) const;
       
    47 	IMPORT_C void RenameObjectL( TUint aObjectHandle, const TDesC& aNewName );
       
    48 	IMPORT_C HBufC* ContainerMimeType( const TDesC& aFullPath );
       
    49 	IMPORT_C TMTPFormatCode FormatFromFilename( const TDesC& aFullFileName );
       
    50 	IMPORT_C void FormatExtensionMapping();
       
    51 	IMPORT_C TMTPFormatCode GetFormatByExtension(const TDesC& aExtension);
       
    52 	IMPORT_C TUint32 GetDpId(const TDesC& aExtension,const TDesC& aMIMEType);
       
    53     IMPORT_C TUint GetEnumerationFlag(const TDesC& aExtension);	
       
    54 	
       
    55 private:
       
    56 	void RenameAllChildrenL(TUint32 aStorageId, TUint32 aParentHandle, const TDesC& aNewFolderName, const TDesC& aOldFolderName);
       
    57 	TBool GetYear(const TDesC& aTimeString, TInt& aYear) const;
       
    58 	TBool GetMonth(const TDesC& aTimeString, TMonth& aMonth) const;
       
    59 	TBool GetDay(const TDesC& aTimeString, TInt& aDay) const;
       
    60 	TBool GetHour(const TDesC& aTimeString, TInt& aHour) const;
       
    61 	TBool GetMinute(const TDesC& aTimeString, TInt& aMinute) const;
       
    62 	TBool GetSecond(const TDesC& aTimeString, TInt& aSecond) const;
       
    63 	TBool GetTenthSecond(const TDesC& aTimeString, TInt& aTenthSecond) const;
       
    64 	TBool GetTimeZone(const TDesC& aTimeString, TBool& aPositiveTimeZone, TInt& aTimeZoneInHour, TInt& aTimeZoneInMinute) const;
       
    65 	HBufC* OdfMimeTypeL( const TDesC& aFullFileName );
       
    66 	void AppendFormatExtensionMapping(const CDesCArray& aFormatExtensionMapping,TUint32 aDpId);
       
    67 	
       
    68 	
       
    69 private:
       
    70     /**
       
    71     FLOGGER debug trace member variable.
       
    72     */
       
    73     __FLOG_DECLARATION_MEMBER_MUTABLE;
       
    74     
       
    75 	MMTPDataProviderFramework*  iFramework;
       
    76 	RMTPFramework				iSingleton;
       
    77     RPointerArray<CMTPExtensionMapping> iFormatMappings;
       
    78     
       
    79 	};
       
    80 
       
    81 #endif /* RMTPUTILITY_H_ */