omaprovisioning/provisioning/IMAdapter/Inc/CWPIMSAPItem.h
changeset 73 ae69c2e8bc34
parent 71 d2517372cc44
child 77 9f85c58c0592
equal deleted inserted replaced
71:d2517372cc44 73:ae69c2e8bc34
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *     Settings item for wireless village settings, handles also the saving of
       
    16 *     Settings item. 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef CWPIMSAPITEM_H
       
    22 #define CWPIMSAPITEM_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <impssapsettings.h>
       
    27 #include "ProvisioningDebug.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CCommsDatabase;
       
    31 class CIMPSSAPSettings;
       
    32 class CIMPSSAPSettingsStore;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * CWPIMSAPItem handles saving of wireless village settings item
       
    38  *
       
    39  * @lib WPIMAdapter
       
    40  * @since 2.0
       
    41  */ 
       
    42 class CWPIMSAPItem : public CBase
       
    43     {
       
    44     public: // construction / destruction
       
    45         
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         */
       
    49         static CWPIMSAPItem* NewLC( TIMPSAccessGroup aAccessGroup );
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CWPIMSAPItem();
       
    55 
       
    56     private:
       
    57         /**
       
    58         * By default Symbian 2nd phase constructor is private.
       
    59         */
       
    60         void ConstructL();
       
    61 
       
    62         /**
       
    63         * C++ default constructor.
       
    64         */
       
    65         CWPIMSAPItem( TIMPSAccessGroup aAccessGroup );
       
    66         /**
       
    67         * 
       
    68         * @param aText
       
    69         * @return None
       
    70         */
       
    71         static void IncrementNameL(TDes& aText);
       
    72         
       
    73         
       
    74         /**
       
    75         * 
       
    76         * @param aText
       
    77         * @param aMaxLength
       
    78         * @return None
       
    79         */
       
    80         static void IncrementNameL(TDes& aText, TInt aMaxLength);
       
    81         
       
    82     public: // new methods:
       
    83 
       
    84         /**
       
    85         * Sets the settings name to save item.
       
    86         * @param aName Settings name
       
    87         */
       
    88         void SetSettingsNameL(const TDesC& aName);
       
    89 
       
    90         /**
       
    91         * Sets the User id to save item.
       
    92         * @param aUserId User Id
       
    93         */
       
    94         void SetUserIDL(const TDesC& aUserId);
       
    95 
       
    96         /**
       
    97         * Sets the password to save item.
       
    98         * @param aPassword Password
       
    99         */
       
   100         void SetPasswordL(const TDesC& aPassword);
       
   101 
       
   102         /**
       
   103         * Sets the URI of SAP to save item.
       
   104         * @param aURI URI of SAP
       
   105         */
       
   106         void SetSAPURIL(const TDesC& aURI);
       
   107 
       
   108         /**
       
   109         * Sets the id of IAP to save item.
       
   110         * @param aUid the uid of IAP.
       
   111         */
       
   112         void SetIAPIdL(TUint32 aUid);
       
   113 
       
   114         /**
       
   115         * Saves the service access point to SAPSettings db.
       
   116         * @return Id of saved service access point.
       
   117         */
       
   118         TUint32 StoreL();
       
   119 
       
   120 		/**
       
   121 		* Deletes the service access point from SAPSettings db with given id.
       
   122 		* @param aUid Id of the service access point to be deleted.
       
   123 		*/
       
   124 		void DeleteL( TUint32 aUid );
       
   125 
       
   126         /**
       
   127         * Checks does a server with given name already exists. 
       
   128         * @param aServerName The name of the server. 
       
   129         * @return TBool Was there already server with same name. 
       
   130         */
       
   131         TBool IsServerNameUniqueL( const TDesC& aServerName );
       
   132         
       
   133         /**
       
   134         * Sets the Service access point with given id as default.
       
   135         * @param aUid The id of service access point
       
   136         */
       
   137         static void SetAsDefaultL(TUint32 aUid, TIMPSAccessGroup aAccessGroup );
       
   138         
       
   139     private: // data
       
   140                         
       
   141         /// Owns: Sap item containing data.
       
   142         CIMPSSAPSettings*       iWVSAPSettings;
       
   143         /// Owns: Sap settings store used for saving SAP.
       
   144         CIMPSSAPSettingsStore*  iSAPStore;
       
   145         TIMPSAccessGroup        iAccessGroup;
       
   146 
       
   147 	private: // for testing purpose
       
   148         friend class T_CWPIMSAPItem;
       
   149     };
       
   150 
       
   151 #endif // CWPIMSAPItem_H
       
   152 
       
   153 // end of file