email/imum/Utils/Inc/ComDbUtl.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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:  ComDbUtl.h
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __COMDBUTL_H__
       
    23 #define __COMDBUTL_H__
       
    24 
       
    25 // INCLUDE FILES
       
    26 #include "ImumMboxDefaultData.h"			// CImumMboxDefaultData
       
    27 #include "IMSSettingsItemAccessPoint.h"     // CIMSSettingsAccessPointItem
       
    28 
       
    29 
       
    30 #include <badesca.h>
       
    31 #include <coemain.h>
       
    32 #include <muiuflagger.h>                    // CMuiuFlags
       
    33 #include <cmmanager.h>
       
    34 #include <cmapplicationsettingsui.h>
       
    35 
       
    36 
       
    37 const TUint32 KServiceIdNoServiceSpecified = 0U;
       
    38 
       
    39 // CONSTANTS
       
    40 enum TIMASCommsDbUtilsIapArray
       
    41 	{
       
    42     EIMASCommsDbIapAlwaysAsk = 0
       
    43 	};
       
    44 
       
    45 
       
    46 /**
       
    47 *  CommsDb related utility functions
       
    48 *
       
    49 *  @lib imumutils.lib
       
    50 *  @since S60 3.0
       
    51 */
       
    52 class CMsvCommDbUtilities : public CBase
       
    53     {
       
    54     public: // Constructors & destructor
       
    55 
       
    56         /**
       
    57         * NewLC
       
    58         * @return CMsvCommDbUtilities*, self pointer
       
    59         */
       
    60         static CMsvCommDbUtilities* NewLC();
       
    61 
       
    62         /**
       
    63         * NewL
       
    64         * @return CMsvCommDbUtilities*, self pointer
       
    65         */
       
    66         static CMsvCommDbUtilities* NewL();
       
    67 
       
    68         /**
       
    69         * ~CMsvCommDbUtilities
       
    70         * Destructor
       
    71         */
       
    72         ~CMsvCommDbUtilities();
       
    73 
       
    74     public: // New Functions
       
    75 
       
    76         /**
       
    77         * IsApBearerCircuitSwitchedL
       
    78         * Checks if AP bearer is circuit switched
       
    79         * @param TUint32, AP id
       
    80         * @return TBool, ETrue if AP bearer is circuit switched
       
    81         */
       
    82         TBool IsApBearerCircuitSwitchedL( TUint32 aApId );
       
    83 
       
    84         /**
       
    85          * Fills IAP Array using the given bearer filter
       
    86          *
       
    87          * @param aFillArray Array where IAPs are filled into
       
    88          * @since S60 3.0
       
    89          */
       
    90         void FillCustomIapArrayL( CDesCArrayFlat& aFillArray );
       
    91 
       
    92 
       
    93         /**
       
    94         * Gets the radiobutton value
       
    95         *
       
    96         * @param aIapItem IAP item of which radio button
       
    97         * 				  index is wanted
       
    98         * @return TInt The index of the IAP in IAP list
       
    99         * @since S60 3.0
       
   100         */
       
   101         TInt GetWizardRadioButton( CIMSSettingsAccessPointItem& aIapItem );
       
   102 
       
   103         /**
       
   104         * Returns the name string of the given IAP
       
   105         *
       
   106         * @param aIapItem IAP item of which name string is wanted
       
   107         * @return TDesC* A pointer to the name
       
   108         * @since S60 3.0
       
   109         */
       
   110         const TDesC* SettingsItemIapStringL( CIMSSettingsAccessPointItem& aIapItem );
       
   111 
       
   112         /**
       
   113          * Gets an access points index in IAP array
       
   114          *
       
   115          * @param aId IAP item of which radio button
       
   116          * 			  index is wanted
       
   117          * @return TInt The index of IAP
       
   118          * @since S60 5.0
       
   119          */
       
   120         TInt GetIapIndexL( const TUint32 aId );
       
   121 
       
   122 
       
   123         /**
       
   124         * Launches the IAP selection page using Connection
       
   125         * Method Manager.
       
   126         *
       
   127         * @param aIapItem On success the selected iap information
       
   128         * 				  is set in this
       
   129         * @return TInt Return value of IAP selection, KErrNone or
       
   130         * 			   KErrCancel if selection was cancelled.
       
   131         * @since S60 3.0
       
   132         */
       
   133         TInt LaunchIapPageL( CIMSSettingsAccessPointItem& aIapItem );
       
   134 
       
   135         /**
       
   136         * Initializes the IAP array
       
   137         *
       
   138         * @since S60 3.0
       
   139         */
       
   140         void InitializeSelectionL();
       
   141 
       
   142         /**
       
   143         * Initializes access point item
       
   144         *
       
   145         * @param aIapItem Reference to where iap information is filled
       
   146         * @param aIapId
       
   147         * @since S60 3.0
       
   148         */
       
   149         void InitItemAccessPointL( CIMSSettingsAccessPointItem& aIapItem,
       
   150         						   const TBool aIsWizard );
       
   151 
       
   152 
       
   153         /**
       
   154          * Loads resource string for IAP item
       
   155          *
       
   156          * @param aIapItem IAP item for which resource is to be loaded
       
   157          * @param aResource Id of the resouce to be loaded
       
   158          * @since S60 3.0
       
   159          */
       
   160         void ItemLoadBufferForItemL( CIMSSettingsAccessPointItem& aIapItem,
       
   161         							 const TInt aResource );
       
   162 
       
   163         /**
       
   164         * Checks if the given IAP is an WLAN access point
       
   165         *
       
   166         * @param aIap An IAP id
       
   167         * @return TBool ETrue if given IAP is of WLAN type
       
   168         * @since S60 3.0
       
   169         */
       
   170         TBool IsWlanAccessPointL( TUint32 aIap ) const;
       
   171 
       
   172         /**
       
   173         * Determines IMAP4 buffer size for given IAP
       
   174         *
       
   175         * @param aIap An IAP id
       
   176         * @param aDefaultData Data from where buffer size
       
   177         * 					  is gotten
       
   178         * @return TInt The buffer size
       
   179         * @since S60 3.0
       
   180         */
       
   181         TInt DetermineImap4BufferSize( const TUint32 aIap,
       
   182         							   const CImumMboxDefaultData& aDefaultData ) const;
       
   183 
       
   184         /**
       
   185         * Gets the bearer type of a given access point
       
   186         * @param aUid The UID of the access point.
       
   187         * @return The type of the bearer.
       
   188         * @since S60 3.2
       
   189         */
       
   190         TUint32 BearerTypeL( TUint32 aUid ) const;
       
   191 
       
   192 
       
   193     	/*
       
   194     	 * Returns the amount of static IAPs, such as
       
   195     	 * Default Connection and WLAN access point
       
   196     	 */
       
   197     	TInt StaticIAPCount();
       
   198 
       
   199         /**
       
   200          * Gets an access point id from IAP array
       
   201          *
       
   202          * @param aSelectionIndex a radiobutton of the IAP that is selected
       
   203          * @return TInt The ID of IAP
       
   204          * @since S60 5.0
       
   205          */
       
   206         TInt GetIapIdL( const TInt32 aSelectionIndex );
       
   207 
       
   208 
       
   209 
       
   210     private:
       
   211 
       
   212         /**
       
   213         * ConstructL
       
   214         * Second phase constructor
       
   215         */
       
   216         void ConstructL();
       
   217 
       
   218         /**
       
   219         * Constructor
       
   220         * @since S60 3.0
       
   221         */
       
   222         CMsvCommDbUtilities();
       
   223 
       
   224 
       
   225     private:
       
   226 
       
   227         RCmManager      iCmManager;
       
   228         TBool           iFeatureAllowVPN;
       
   229         CMuiuFlags*     iFlags;
       
   230         RArray<TUint32> iIapList;
       
   231         TBearerFilterArray iFilters;
       
   232         TBool           iInitialized;
       
   233     };
       
   234 
       
   235 
       
   236 #endif