epoc32/include/conlist.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 conlist.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 class ConverterListUtil
       
   100 /** @internalComponent */
       
   101 	{
       
   102 public:
       
   103 	static CConverterBase* UtilityConverterL(TUid aUid);
       
   104 	static TInt CountUtilityConverters();
       
   105 	};
       
   106 
       
   107 inline TInt CCnaConverterList::Count()
       
   108 /** @deprecated
       
   109 
       
   110 Deprecated - Use CCnaConverterList::CountL instead. 
       
   111 Rescan of the disk to refresh the list of converters could leave. */
       
   112 	{
       
   113 	return CountL();
       
   114 	}
       
   115 
       
   116 #endif