pimprotocols/phonebooksync/inc/SyncContactICCEntry.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 // Copyright (c) 2002-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 // Header file for Phonebook Synchroniser internal ICC Entry representation
       
    15 // class.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #ifndef __SYNCCONTACTICCENTRY_H__
       
    25 #define __SYNCCONTACTICCENTRY_H__
       
    26 
       
    27 
       
    28 #include <s32mem.h>
       
    29 #include "phbksync.h"
       
    30 #include <etelmm.h>
       
    31 
       
    32 
       
    33 /**
       
    34  *  This class is used to store the contacts phonebook data (supplied in
       
    35  *  CContactICCEntry) in the Phonebook Server internal format. This class
       
    36  *  is needed as CContactICCEntry also contains some data used only by the
       
    37  *  Contacts Model and not needed by the Synchroniser at all. Additonally this
       
    38  *  class supports streaming.
       
    39  */
       
    40 class CSyncContactICCEntry : public CBase
       
    41 	{
       
    42 public:
       
    43 	enum 
       
    44 		{
       
    45 		KMaxPhBkNameSize = 241
       
    46 		};
       
    47 
       
    48 	typedef TBuf16<KMaxPhBkNameSize> TSyncEntryName;
       
    49 	typedef TBuf16<RMobilePhone::KMaxMobileTelNumberSize> TSyncEntryNumber;
       
    50 
       
    51 	class TSyncAdditionalNumber
       
    52 		{
       
    53 	public:
       
    54 		void InternalizeL(RReadStream& aStream);
       
    55 		void ExternalizeL(RWriteStream& aStream) const;
       
    56 
       
    57 		TSyncEntryNumber  iNumber;		 // Additional number 
       
    58 		TSyncEntryName  iNumberString;	 // Alpha string associated with additional number 
       
    59 		RMobilePhone::TMobileTON  iTON;  // TON associated with additional number
       
    60 		};
       
    61 
       
    62 public:
       
    63 	static CSyncContactICCEntry* NewL();
       
    64 	~CSyncContactICCEntry();
       
    65 
       
    66 	CBufBase* StoreL();
       
    67 	void StoreL(TDes8& aDes);
       
    68 	void RestoreL(const TDesC8& aBuf);
       
    69 
       
    70 	void InternalizeL(RReadStream& aStream);
       
    71 	void ExternalizeL(RWriteStream& aStream) const;
       
    72 
       
    73 	void InitialiseFromContactICCEntryL(const CContactICCEntry& aContactItem);
       
    74 	void Reset();
       
    75 
       
    76 #ifdef _DEBUG
       
    77 	void LogSyncContactICCEntry() const;
       
    78 #endif
       
    79 
       
    80 private:
       
    81 	CSyncContactICCEntry();
       
    82 	void ConstructL();
       
    83 
       
    84 public:
       
    85 	TSyncEntryName  iName;        // First representation of name
       
    86 	TSyncEntryName  iSecondName;  // Second representation of name
       
    87 	TSyncEntryNumber iNumber;
       
    88 	CArrayFixFlat<TSyncAdditionalNumber>*  iNumberList;
       
    89 	CArrayFixFlat<TSyncEntryName>*  iGroupList;
       
    90 	CArrayFixFlat<TSyncEntryName>*  iEmailList;
       
    91 	TInt  iSlotNum;
       
    92 	
       
    93 	//
       
    94 	// Type-Of-Number associated with iNumber...
       
    95 	//
       
    96 	RMobilePhone::TMobileTON  iTON;
       
    97 
       
    98 	TContactItemId  iContactId;
       
    99 	TUid  iPhonebookUid;
       
   100 	TBool  iIsHidden;
       
   101 	
       
   102 	//
       
   103 	// This is needed for new entries only, so that server can map this group
       
   104 	// ID to phonebook UID. This phonebook UID will be returned back to client.
       
   105 	//
       
   106 	TContactItemId  iTemplateId;
       
   107 	};
       
   108 
       
   109 #endif // __SYNCCONTACTICCENTRY_H__