email/imum/DomainApi/inc/ImumDaSettingsDataCollectionImpl.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  ImumDaSettingsDataCollectionImpl.h
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_IMUMDASETTINGSDATACOLLECTIONIMPL_H
       
    20 #define C_IMUMDASETTINGSDATACOLLECTIONIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <msvstd.h>
       
    24 #include "ImumDaSettingsDataCollection.h"
       
    25 
       
    26 class CImumInternalApi;
       
    27 class MImumInSettingsDataCollection;
       
    28 
       
    29 NONSHARABLE_CLASS( CImumDaSettingsDataCollectionImpl ) :
       
    30     public MImumDaSettingsDataCollection
       
    31     {
       
    32     public: // Constructors and destructor
       
    33 
       
    34         /**
       
    35          * Create object from CImumDaSettingsDataCollectionImpl
       
    36          *
       
    37          * @since S60 3.2
       
    38          * @param aInDataCollection, Reference to internal api data collection.
       
    39          * @return, Constructed object
       
    40          */
       
    41         static CImumDaSettingsDataCollectionImpl* NewL(
       
    42             MImumInSettingsDataCollection& aInDataCollection );
       
    43 
       
    44         /**
       
    45          * Creates object from CImumDaSettingsDataCollectionImpl and
       
    46          * leaves it to cleanup stack
       
    47          *
       
    48          * @since S60 3.2
       
    49          * @param aInDataCollection, Reference to internal api data collection.
       
    50          * @return, Constructed object
       
    51          */
       
    52         static CImumDaSettingsDataCollectionImpl* NewLC(
       
    53             MImumInSettingsDataCollection& aInDataCollection );
       
    54 
       
    55         /**
       
    56          * Destructor
       
    57          * @since S60 3.2
       
    58          */
       
    59         virtual ~CImumDaSettingsDataCollectionImpl();
       
    60 
       
    61     private: // Constructors
       
    62 
       
    63         /**
       
    64          * Default constructor for CImumDaSettingsDataCollectionImpl
       
    65          *
       
    66          * @since S60 3.2
       
    67          * @param aInDataCollection, Reference to internal api data collection.
       
    68          * @return, Constructed object
       
    69          */
       
    70         CImumDaSettingsDataCollectionImpl(
       
    71             MImumInSettingsDataCollection& aInDataCollection );
       
    72 
       
    73         /**
       
    74          * Symbian 2-phase constructor
       
    75          * @since S60 3.2
       
    76          */
       
    77         void ConstructL();
       
    78 
       
    79     public:  //From class MImumDaSettingsDataCollection
       
    80 
       
    81         /**
       
    82          * Sets the given value/text to the key
       
    83          *
       
    84          * @since S60 v3.2
       
    85          * @param aAttributeKey, Id of the setting key
       
    86          * @param aValue/aText, Data to be stored
       
    87          * @return EImumDaNoError, when successful
       
    88          */
       
    89         TInt SetAttr( const TUint aAttributeKey, const TInt aValue );
       
    90         TInt SetAttr( const TUint aAttributeKey, const TInt64 aValue );
       
    91         TInt SetAttr( const TUint aAttributeKey, const TMsvId aValue );
       
    92         TInt SetAttr( const TUint aAttributeKey, const TDesC& aText );
       
    93         TInt SetAttr( const TUint aAttributeKey, const TDesC8& aText );
       
    94 
       
    95         /**
       
    96          * Gets the required value/text from the key
       
    97          *
       
    98          * @since S60 v3.2
       
    99          * @param aAttributeKey, Value of the setting key
       
   100          * @param aValue/aText, Data to be stored
       
   101          * @return EImumDaNoError, when successful
       
   102          */
       
   103         TInt GetAttr( const TUint aAttributeKey, TInt& aValue ) const;
       
   104         TInt GetAttr( const TUint aAttributeKey, TInt64& aValue ) const;
       
   105         TInt GetAttr( const TUint aAttributeKey, TMsvId& aId ) const;
       
   106         TInt GetAttr( const TUint aAttributeKey, TDes& aText ) const;
       
   107         TInt GetAttr( const TUint aAttributeKey, TDes8& aText ) const;
       
   108 
       
   109         /**
       
   110          * Compares the content of the datas
       
   111          *
       
   112          * @since S60 v3.2
       
   113          * @param aSettingsData
       
   114          * @return Result of the comparasion
       
   115          */
       
   116         TBool operator!=(
       
   117             const MImumDaSettingsDataCollection& aSettingsDataCollection )
       
   118                 const;
       
   119 
       
   120         TBool operator==(
       
   121             const MImumDaSettingsDataCollection& aSettingsDataCollection )
       
   122                 const;
       
   123 
       
   124         /**
       
   125          * Resets the default value of the single key
       
   126          *
       
   127          * @since S60 v3.2
       
   128          * @param aAttributeKey, Id of the setting key
       
   129          * @return EImumDaNoError, when successful
       
   130          */
       
   131         void Reset( const TUint aAttributeKey );
       
   132 
       
   133         /**
       
   134          * Copies the content of the setting data
       
   135          *
       
   136          * @since S60 v3.2
       
   137          * @param aSettingsData Collection data object to be copied
       
   138          * @return EImumDaNoError, when successful
       
   139          */
       
   140         TInt Copy(
       
   141             const MImumDaSettingsDataCollection& aSettingsDataCollection );
       
   142 
       
   143     public:
       
   144         /**
       
   145          *
       
   146          * @since S60 3.2
       
   147          * @param aAttributeKey, Attribute key to be tested.
       
   148          * @param aReadOperation, Chooses how attribute is tested. read(1) or write(0).
       
   149          * @return
       
   150          */
       
   151         static TInt IsLegalKey(
       
   152             const TUint aAttributeKey,
       
   153             TBool aReadOperation );
       
   154 
       
   155     private:
       
   156 
       
   157         //Reference to internal api data collection
       
   158         MImumInSettingsDataCollection& iInDataCollection;
       
   159     };
       
   160 
       
   161 
       
   162 
       
   163 #endif /* C_IMUMDASETTINGSDATACOLLECTIONIMPL_H */