imservices/xmppsettingsapi/inc/xmppsettingsrecord.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2007 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:  This class is used for data table manipulations.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_XMPPSETTINGSRECORD_H
       
    22 #define C_XMPPSETTINGSRECORD_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class CRepository;
       
    27 
       
    28 /**
       
    29  *  This class is used for data table manipulations.
       
    30  *
       
    31  *  This class contains all methods needed to read and write to settings id
       
    32  *  table.
       
    33  *
       
    34  *
       
    35  *  @lib jabbersettings.lib
       
    36  *  @since S60 5.0
       
    37  */
       
    38 class CXmppSettingsRecord: public CBase
       
    39     {
       
    40 
       
    41 public:
       
    42 		
       
    43 		/**
       
    44      * Two-phased constructor.         
       
    45      * @return Instance of this class
       
    46      */
       
    47     static CXmppSettingsRecord* NewL( CRepository& aRepository );
       
    48 
       
    49     static CXmppSettingsRecord* NewLC( CRepository& aRepository );
       
    50 		
       
    51 		/**
       
    52 	   * Destructor
       
    53 	   */
       
    54     virtual ~CXmppSettingsRecord();
       
    55 
       
    56     /**
       
    57      * This method checks does this setting id exist. Leaves with
       
    58      * KErrNotFound if it does not.
       
    59      *
       
    60      * @since S60 5.0
       
    61      * @param aSettingsRecordId Setting id.
       
    62      * @param aSettingsRecordKey If setting id is found, this contains the setting
       
    63      *                    key on return.
       
    64      */
       
    65     void FindSettingsRecordKeyL( TUint32 aSettingsRecordId,
       
    66                                  TUint32& aSettingsRecordKey );
       
    67 
       
    68     /**
       
    69      * This method fids all setting keys.
       
    70      *
       
    71      * @since S60 5.0
       
    72      * @@param aSettingsRecordKeys On return contains all setting keys.
       
    73      */
       
    74     void GetSettingsRecordkeysL( RArray<TUint32>& aResults );
       
    75 
       
    76     /**
       
    77      * This method creates unique setting id.
       
    78      *
       
    79      * @since S60 5.0
       
    80      * @param aNewSettingId On return contains new setting id.
       
    81      */
       
    82     void CreateSettingsRecordIdL( TUint32& aNewSettingId );
       
    83 
       
    84 private:
       
    85 
       
    86 		/**
       
    87 		 * Default Contructor
       
    88 		 */
       
    89     CXmppSettingsRecord( CRepository& aRepository );
       
    90 
       
    91     void ConstructL();
       
    92 
       
    93     /**
       
    94      * This method returns next available slot for settings record. It can
       
    95      * be new index or it can use deleted slot.
       
    96      *
       
    97      * @since S60 5.0
       
    98      * @param aFreeKey On return contains the next free key.
       
    99      */
       
   100     void NextFreeSlotL( TUint32& aFreeKey );
       
   101 
       
   102     /**
       
   103      * This method fids all setting keys. It fills the internal array with
       
   104      * unique ids.
       
   105      *
       
   106      * @since S60 5.0
       
   107      */
       
   108     void GetSettingsRecordkeysL();
       
   109 
       
   110 private: // Data
       
   111 
       
   112     /**
       
   113      * Handle to the Central Repository.
       
   114      */
       
   115     CRepository& iRepository;
       
   116 
       
   117     /**
       
   118      * Contains setting id keys.
       
   119      */
       
   120     RArray<TUint32> iSettingsRecordKeyArray;
       
   121 
       
   122     };
       
   123 
       
   124 
       
   125 #endif // C_XMPPSETTINGSRECORD_H