00001 /* 00002 * ============================================================================ 00003 * Name : BCardEng.h 00004 * Part of : BCardEng.dll 00005 * 00006 * Description: 00007 * A class to convert Phonebook items to vCard stream and vice versa 00008 * Version: 00009 * 00010 * Copyright (C) 2002 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. All rights are reserved. Copying, 00014 * including reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia Corporation. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia Corporation. 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef __BCARDENG_H__ 00023 #define __BCARDENG_H__ 00024 00025 00026 // INCLUDES 00027 #include <badesca.h> // CDesCArrayFlat 00028 #include "PbkFields.hrh" // TPbkFieldId 00029 00030 00031 // CONSTANTS 00032 _LIT(KPbkvCardFileExtension, ".vcf"); 00033 00034 // FORWARD DECLARATIONS 00035 class CPbkContactEngine; 00036 class CPbkContactItem; 00037 class RWriteStream; 00038 class CBCardFieldUidMapping; 00039 class CBCardExportProperty; 00040 class CParserVCard; 00041 00042 // CLASS DECLARATION 00043 00048 class CBCardEngine : public CBase 00049 { 00050 public: // Constructors and destructor 00056 IMPORT_C static CBCardEngine* NewL(CPbkContactEngine* aEngine); 00057 00061 IMPORT_C ~CBCardEngine(); 00062 00063 public: // The main public interface 00072 IMPORT_C void ImportBusinessCardL(CPbkContactItem& aDestItem, 00073 RReadStream &aSourceStream); 00074 00083 IMPORT_C void ExportBusinessCardL(RWriteStream& aDestStream, 00084 CPbkContactItem& aSourceItem); 00085 00096 IMPORT_C TBool ImportCompactBusinessCardL(CPbkContactItem& aDestItem, 00097 RReadStream &aSourceStream); 00098 00104 IMPORT_C TBool SupportsFieldType(TPbkFieldId aFieldId); 00105 00106 private: // Constructors 00107 CBCardEngine(); 00108 void ConstructL(CPbkContactEngine* aEngine); 00109 00110 private: // Private utility methods 00111 void ProcessExportPropertyL( 00112 CParserVCard& aParser, 00113 CPbkContactItem& aSourceItem, 00114 const CBCardExportProperty& aExportProperty); 00115 TInt GetLineFromStreamL(TDes& aBuf, RReadStream& aSourceStream); 00116 TInt GetByteFromStream(TUint8& aByte, RReadStream& aSourceStream); 00117 class CBCardFieldAction; 00118 00119 private: 00121 HBufC* iPictureFileName; 00123 HBufC* iThumbnailFileName; 00125 CBCardFieldUidMapping* iNameUidMap; 00127 CBCardFieldAction* iFieldAction; 00129 CPbkContactEngine* iEngine; 00131 RPointerArray<CBCardExportProperty> iExportProperties; 00132 }; 00133 00134 // __BCARDENG_H__ 00135 #endif 00136 00137 // End of File