email/imum/Utils/Inc/IMASCenRepControl.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:  IMASCenRepControl.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMASCENREPCONTROL_H
       
    20 #define CIMASCENREPCONTROL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "IMASAccountControl.h"
       
    26 
       
    27 // CONSTANTS
       
    28 // MACROS
       
    29 // DATA TYPES
       
    30 // FUNCTION PROTOTYPES
       
    31 // FORWARD DECLARATIONS
       
    32 class CRepository;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *
       
    38 *  @lib
       
    39 *  @since S60 3.0
       
    40 */
       
    41 class CIMASCenRepControl : public CBase
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44 
       
    45         /**
       
    46         * Creates object from CIMASCenRepControl and leaves it to cleanup stack
       
    47         * @since S60 3.0
       
    48         * @return, Constructed object
       
    49         */
       
    50         static CIMASCenRepControl* NewLC();
       
    51 
       
    52         /**
       
    53         * Create object from CIMASCenRepControl
       
    54         * @since S60 3.0
       
    55         * @return, Constructed object
       
    56         */
       
    57         static CIMASCenRepControl* NewL();
       
    58 
       
    59         /**
       
    60         * Destructor
       
    61         * @since S60 3.0
       
    62         */
       
    63         virtual ~CIMASCenRepControl();
       
    64 
       
    65     public: // New functions
       
    66 
       
    67         /**
       
    68         *
       
    69         * @since S60 3.0
       
    70         */
       
    71         void SetActiveCentralRepository(
       
    72             CRepository& aRepository );
       
    73 
       
    74         /**
       
    75         *
       
    76         * @since S60 3.0
       
    77         */
       
    78         void SetActiveBaseKey(
       
    79             const TUint32 aAccountId,
       
    80             const TUid& aProtocol );
       
    81 
       
    82         /**
       
    83         *
       
    84         * @since S60 3.0
       
    85         */
       
    86         void SetActiveBaseKey(
       
    87             const TUint32 aExtendedAccountId );
       
    88 
       
    89         /**
       
    90         *
       
    91         * @since S60 3.0
       
    92         */
       
    93         void SetActiveDefaultDataKey();
       
    94 
       
    95         /**
       
    96         *
       
    97         * @since S60 3.0
       
    98         */
       
    99         void CreateToAccountL(
       
   100             const TUint32 aSetting,
       
   101             const TDesC& aString );
       
   102 
       
   103         /**
       
   104         *
       
   105         * @since S60 3.0
       
   106         */
       
   107         void CreateToAccountL(
       
   108             const TUint32 aSetting,
       
   109             const TInt aValue );
       
   110 
       
   111         /**
       
   112         *
       
   113         * @since S60 3.0
       
   114         */
       
   115         void CreateToAccountL(
       
   116             const TInt aSettingHigh,
       
   117             const TInt aSettingLow,
       
   118             const TInt64 aValue );
       
   119 
       
   120         /**
       
   121         *
       
   122         * @since S60 3.0
       
   123         */
       
   124         void DeleteFromAccountL(
       
   125             const TInt aSetting ) const;
       
   126 
       
   127         /**
       
   128         *
       
   129         * @since S60 3.0
       
   130         */
       
   131         void DeleteFromAccountL(
       
   132             const TInt aSettingHigh,
       
   133             const TInt aSettingLow ) const;
       
   134 
       
   135         /**
       
   136         *
       
   137         * @since S60 3.0
       
   138         */
       
   139         void SetToAccountL(
       
   140             const TUint32 aSetting,
       
   141             const TDesC& aString );
       
   142         /**
       
   143         *
       
   144         * @since S60 3.0
       
   145         */
       
   146         void SetToAccountL(
       
   147             const TUint32 aSetting,
       
   148             const TInt aValue );
       
   149 
       
   150         /**
       
   151         *
       
   152         * @since S60 3.0
       
   153         */
       
   154         void SetToAccountL(
       
   155             const TInt aSettingHigh,
       
   156             const TInt aSettingLow,
       
   157             const TInt64 aSetting );
       
   158 
       
   159         /**
       
   160         *
       
   161         * @since S60 3.0
       
   162         */
       
   163         TInt64 GetFromAccountL(
       
   164             const TInt aSettingHigh,
       
   165             const TInt aSettingLow ) const;
       
   166 
       
   167         /**
       
   168         *
       
   169         * @since S60 3.0
       
   170         */
       
   171         TInt GetFromAccountL(
       
   172             const TInt aSetting ) const;
       
   173 
       
   174         /**
       
   175         *
       
   176         * @since S60 3.0
       
   177         */
       
   178         void GetTextFromAccountL(
       
   179             TDes& aText,
       
   180             const TInt aSetting ) const;
       
   181 
       
   182         /**
       
   183         * Get 8-bit text from central repository
       
   184         * @since S60 3.2
       
   185         * @param cent-rep key for value, reference for modifiable descriptor
       
   186         * @return system wide error code
       
   187         */
       
   188 
       
   189         void GetTextFromAccountL(
       
   190             TDes8& aText,
       
   191             const TInt aSetting ) const;
       
   192 
       
   193         // non-leaving versions of GetFromAccounts
       
   194 
       
   195         /**
       
   196         * Get one 64-bit value from central repository
       
   197         * @since S60 3.2
       
   198         * @param lower and higher part keys of 64-bit values,
       
   199         *        reference to TInt64 value
       
   200         * @return system wide error code
       
   201         */
       
   202 
       
   203         TInt GetFromAccount(
       
   204             const TInt aSettingHigh,
       
   205             const TInt aSettingLow,
       
   206             TInt64& aSettingValue ) const;
       
   207 
       
   208         /**
       
   209         * Get one 32-bit value from central repository
       
   210         * @since S60 3.2
       
   211         * @param cent-rep key for value, reference to value
       
   212         * @return system wide error code
       
   213         */
       
   214         TInt GetFromAccount(
       
   215             const TInt aSetting, TInt& aSettingValue ) const;
       
   216 
       
   217         /**
       
   218         * Get text from central repository
       
   219         * @since S60 3.2
       
   220         * @param cent-rep key for value, reference for modifiable descriptor
       
   221         * @return system wide error code
       
   222         */
       
   223         TInt GetTextFromAccount(
       
   224             TDes& aText,
       
   225             const TInt aSetting ) const;
       
   226 
       
   227         /**
       
   228         * Get 8-bit text from central repository
       
   229         * @since S60 3.2
       
   230         * @param cent-rep key for value, reference for modifiable descriptor
       
   231         * @return system wide error code
       
   232         */
       
   233         TInt GetTextFromAccount(
       
   234             TDes8& aText,
       
   235             const TInt aSetting ) const;
       
   236 
       
   237         /**
       
   238         * Get one 32-bit value from central repository. Creates the settings
       
   239         * with default value if it does not exist. Will leave with generic 
       
   240         * Symbian error code if creation fails or unexpected error is 
       
   241         * encountered when reading setting.
       
   242         * 
       
   243         * @param aSetting CenRep key for value.
       
   244         * @param aDefaultValue Default value for settings.
       
   245         * @return Value from CenRep.
       
   246         */
       
   247         TInt GetFromAccountOrCreateL(
       
   248             const TUint32 aSetting, 
       
   249             TInt aDefaultValue );
       
   250 
       
   251         /**
       
   252         * Get one 64-bit value from central repository. Creates the settings
       
   253         * with default value if it does not exist. Will leave with generic 
       
   254         * Symbian error code if creation fails or unexpected error is 
       
   255         * encountered when reading setting.
       
   256         * 
       
   257         * @param aSettingHigh CenRep key for high 32bit value.
       
   258         * @param aSettingLow  CenRep key for low 32bit value.
       
   259         * @param aDefaultValue Default value for settings.
       
   260         * @return Value from CenRep.
       
   261         */
       
   262         TInt64 GetFromAccountOrCreateL(
       
   263             const TUint32 aSettingHigh,
       
   264             const TUint32 aSettingLow,
       
   265             TInt64 aDefaultValue );
       
   266         
       
   267     public: // Functions from base classes
       
   268 
       
   269     protected:  // Constructors
       
   270 
       
   271         /**
       
   272         * Default constructor for classCIMASCenRepControl
       
   273         * @since S60 3.0
       
   274         * @return, Constructed object
       
   275         */
       
   276         CIMASCenRepControl();
       
   277 
       
   278         /**
       
   279         * Symbian 2-phase constructor
       
   280         * @since S60 3.0
       
   281         */
       
   282         void ConstructL();
       
   283 
       
   284     protected:  // New virtual functions
       
   285     protected:  // New functions
       
   286     protected:  // Functions from base classes
       
   287 
       
   288     private:  // New virtual functions
       
   289     private:  // New functions
       
   290     private:  // Functions from base classes
       
   291 
       
   292     public:     // Data
       
   293     protected:  // Data
       
   294     private:    // Data
       
   295 
       
   296         // Pointer to active Central Repository
       
   297         CRepository* iCenRep;
       
   298         // Currently active account
       
   299         TUint32 iBaseKey;
       
   300     };
       
   301 
       
   302 #endif //  CIMASCENREPCONTROL_H
       
   303 
       
   304 // End of File