omads/omadsextensions/adapters/contactsgroup/inc/contactsgrpconverter.h
branchRCL_3
changeset 24 8e7494275d3a
equal deleted inserted replaced
23:2bb96f4ecad8 24:8e7494275d3a
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Group vCard object conversion routines
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CONTACTSGRPCONVERTER_H__
       
    20 #define __CONTACTSGRPCONVERTER_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <cntitem.h>
       
    25 
       
    26 class CContactIdArray;
       
    27 
       
    28 /* @brief CContactsGrpConverter Class
       
    29  * This class is used to convert Contact Group items to vCard presentation and vice versa.
       
    30  */
       
    31 
       
    32 NONSHARABLE_CLASS( CContactsGrpConverter ): public CBase
       
    33 	{
       
    34 public:
       
    35 
       
    36 	static CContactsGrpConverter* NewL();
       
    37 	static CContactsGrpConverter* NewLC();
       
    38 	~CContactsGrpConverter();
       
    39 
       
    40 	// returns group label
       
    41 	const TDesC& GroupLabel() const;
       
    42 	// returns contact items beloging to group
       
    43 	const CContactIdArray& ItemsContained() const;
       
    44 	
       
    45 	// Import group item
       
    46 	void ImportDbItemL( CContactGroup& aItem );
       
    47 	
       
    48 	// Export / Import vCard info from/to this object
       
    49 	void ExportVCardL( CBufBase& aBuffer );
       
    50 	void ExportVCardL( RWriteStream& aWriteStream );
       
    51 	void ImportVCardL( const TDesC8& aBuffer );
       
    52 	
       
    53 	// Reset all data
       
    54 	void ResetL();
       
    55 	
       
    56 private:
       
    57     
       
    58     CContactsGrpConverter();	
       
    59 	void ConstructL();
       
    60 	
       
    61     void SetContactItemsL( const TDesC& aValue );
       
    62         
       
    63     void SplitL( const TDesC& aText, const TChar aSeparator, RArray<TPtrC>& aArray );
       
    64     void TrimAll( TPtrC& aValue );
       
    65 private:
       
    66     HBufC*           iGroupLabel;
       
    67     CContactIdArray* iContactsIdArray;
       
    68     
       
    69 	};
       
    70 
       
    71 #endif // __CONTACTSGRPCONVERTER_H__