filehandling/fileconverterfw/INC/CONLIST.H
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 1997-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 #if !defined(__CONLIST_H__)
       
    17 #define __CONLIST_H__
       
    18 
       
    19 #if !defined(__E32BASE_H__)
       
    20 #include <e32base.h>
       
    21 #endif
       
    22 
       
    23 #if !defined(__F32FILE_H__)
       
    24 #include <f32file.h>
       
    25 #endif
       
    26 
       
    27 #if !defined(__CONARC_H__)
       
    28 #include <conarc.h>
       
    29 #endif
       
    30 
       
    31 #if !defined(__CONCNF_H__)
       
    32 #include <concnf.h>
       
    33 #endif
       
    34 
       
    35 #if !defined(__IMPLEMENTATION_INFORMATION_H__)
       
    36 #include <ecom/implementationinformation.h>
       
    37 #endif
       
    38 #if !defined(__ECOM_H__)
       
    39 #include <ecom/ecom.h>
       
    40 #endif
       
    41 
       
    42 
       
    43 /** Creates a converter dll's factory interface object.
       
    44 
       
    45 @publishedAll
       
    46 @deprecated
       
    47 */
       
    48 typedef CConverterLibrary* (*CreateCConverterLibrary)(); 
       
    49 
       
    50 struct SConverterInfo
       
    51 /** Describes a converter, as obtained from a converter list (CCnaConverterList).
       
    52 
       
    53 @publishedAll
       
    54 @released
       
    55 @see CCnaConverterList */
       
    56 	{
       
    57 	/** Localised name of the data type. */
       
    58 	TTranslation iTranslation;
       
    59 	/** Converter UID. */
       
    60 	TUid iUid;
       
    61 	/** Position of the converter in the list. */
       
    62 	TInt iIndex;
       
    63 	};
       
    64 
       
    65 class CCnaConverterList : public CBase
       
    66 /** Provides a list of available converters, allowing clients to search for and 
       
    67 obtain converters for specific source and target data types. 
       
    68 
       
    69 @publishedAll
       
    70 @released */
       
    71 	{
       
    72 public:
       
    73 	IMPORT_C static CCnaConverterList* NewL();
       
    74 	IMPORT_C static CCnaConverterList* NewLC();
       
    75 	IMPORT_C void Release();
       
    76 	IMPORT_C ~CCnaConverterList();
       
    77 //
       
    78 	IMPORT_C TInt CountL();
       
    79 	inline TInt Count();
       
    80 	IMPORT_C CConverterBase* NewConverterL(TUid aUid);
       
    81 	IMPORT_C void UpdateL();
       
    82 	IMPORT_C TUid ConvFromL(const TDataType& aMimeType); // searches for a particular converter
       
    83 	IMPORT_C TUid ConvToL(const TDataType& aMimeType);
       
    84 	IMPORT_C TUid ConverterL(const TDataType& aFrom,const TDataType& aTo);
       
    85 	IMPORT_C void ConvFromListL(const TDataType& aMimeType,CArrayFix<SConverterInfo>* aSConverterInfoArray);
       
    86 	IMPORT_C void ConvToListL(const TDataType& aMimeType,CArrayFix<SConverterInfo>* aSConverterInfoArray);
       
    87 	IMPORT_C TInt MimeTypeFrom(TDataType& aDataType,const SConverterInfo& aConverterInfo) const;
       
    88 	IMPORT_C TInt MimeTypeTo(TDataType& aDataType,const SConverterInfo& aConverterInfo) const;
       
    89 private:
       
    90 	CCnaConverterList();
       
    91 	void ConstructL();
       
    92 	CConverterBase* LoadConverterL(TUid aImplUid);
       
    93 private:
       
    94 	TBool iDoneScan;
       
    95 	CArrayPtr<CCnaConverter>* iConverters;
       
    96 	RImplInfoPtrArray iImplementationArray;
       
    97 	};
       
    98 
       
    99 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   100 class ConverterListUtil
       
   101 /** @internalComponent */
       
   102 	{
       
   103 public:
       
   104 	static CConverterBase* UtilityConverterL(TUid aUid);
       
   105 	static TInt CountUtilityConverters();
       
   106 	};
       
   107 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
   108 
       
   109 inline TInt CCnaConverterList::Count()
       
   110 /** @deprecated
       
   111 
       
   112 Deprecated - Use CCnaConverterList::CountL instead. 
       
   113 Rescan of the disk to refresh the list of converters could leave. */
       
   114 	{
       
   115 	return CountL();
       
   116 	}
       
   117 
       
   118 #endif