pimprotocols/phonebooksync/inc/PhonebookIniFile.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 INI File class.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef __PHONEBOOKINIFILE_H__
       
    24 #define __PHONEBOOKINIFILE_H__
       
    25 
       
    26 #include "phbksync.h"
       
    27 #include "phbksynclog.h"
       
    28 
       
    29 
       
    30 /**
       
    31  *  Maximmum number of phonebooks supported by a Phonebook Sync.
       
    32  *
       
    33  *  @internalComponent
       
    34  */
       
    35 const TInt KMaxPhonebooks = 5;
       
    36 
       
    37 
       
    38 class CPhoneBookManager;
       
    39 
       
    40 /**
       
    41  *  This class represents the Phonebook Sync INI file and contains
       
    42  *  functions to read and write to the file.
       
    43  *
       
    44  *  The class uses a caching system to avoid writing the file when
       
    45  *  no changes have take place.
       
    46  *
       
    47  *  @internalComponent
       
    48  */
       
    49 class CPhoneBookIniFile : public CBase
       
    50 	{
       
    51 public:
       
    52 	static CPhoneBookIniFile* NewL(RPointerArray<CPhoneBook>& aPhonebookList);
       
    53 	~CPhoneBookIniFile();
       
    54 
       
    55 	TInt WriteIniFileSettingsIfNeeded();
       
    56 
       
    57 private:
       
    58 	CPhoneBookIniFile(RPointerArray<CPhoneBook>& aPhonebookList);
       
    59 
       
    60 	void ConstructL();
       
    61 	TBool CheckPhonebookParamsForChanges() const;
       
    62 	void GetIniFileName(RFs& aFs, TDes& aIniFileName) const;
       
    63 	void WriteIniFileL() const;
       
    64 	void ReadIniFileL() const;
       
    65 	void UpdatePhonebookParamsCache();
       
    66 
       
    67 private:
       
    68 	RPointerArray<CPhoneBook>&  iPhonebookList;
       
    69 	TBool  iIsIniFileCacheValid;
       
    70 	RPhoneBookSession::TPhonebookSyncMode  iIniFileSyncModeCache[KMaxPhonebooks];
       
    71 	TContactItemId  iIniFileTemplateIdCache[KMaxPhonebooks];
       
    72 	TContactItemId  iIniFileGroupIdCache[KMaxPhonebooks];
       
    73 	RMobilePhoneBookStore::TMobilePhoneBookIdentity  iIniFileIdentityCache[KMaxPhonebooks];
       
    74 	};
       
    75 
       
    76 
       
    77 #endif // __PHONEBOOKINIFILE_H__