omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPItemBase.h
branchRCL_3
changeset 26 19bba8228ff0
parent 1 a9c0ce913924
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     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:     Defines a base class for all the items in WPAPAdapter
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CWPAPITEMBASE_H
       
    23 #define CWPAPITEMBASE_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <cmconnectionmethodext.h>
       
    29 #include <cmmanagerext.h>
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // Field types that can be marked received.
       
    34 // Values defined to the power of to to enable masking.
       
    35 enum TMarkedField
       
    36 	{
       
    37 	EWPParameterPxAddrType_id	= 2,
       
    38 	EWPParameterPxAddrFQDN_id	= 4,
       
    39 	EWPParameterNapID_id		= 8,
       
    40 	EWPParameterService_id		= 16,
       
    41 	EWPParameterPortNbr_id		= 32,
       
    42 	EWPParameterPxAddr_id		= 64,
       
    43 	EWPParameterAuthentication_id = 512,
       
    44     EWPParameterIfNetworks_id   = 1024,
       
    45     EWPParameterInternet_id     = 2048,
       
    46     EWPParameterWlan_id         = 4096
       
    47 	};
       
    48 
       
    49 // FORWARD DECLARATIONS
       
    50 
       
    51 class CApAccessPointItem;
       
    52 class CWPAPAccesspointItem;
       
    53 class CCommsDatabase;
       
    54 
       
    55 // CLASS DECLARATION
       
    56 
       
    57 /**
       
    58  * CWPAPItemBase is a base class for all the items in WPAPAdapter.
       
    59  */ 
       
    60 class CWPAPItemBase : public CBase
       
    61 	{
       
    62 	public:
       
    63 
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67 		~CWPAPItemBase();
       
    68 
       
    69 	public: // New methods
       
    70 
       
    71 		/**
       
    72 		* Store the item data to APEngine's accesspoint item.
       
    73 		* @param aAPItem item where data is stored.
       
    74 		*/
       
    75 		virtual void AddDataL( RCmConnectionMethodExt& ) = 0;
       
    76 
       
    77         /**
       
    78         * Add access point items to an array.
       
    79         * @param aItems The array to add to
       
    80         * @param aLogicalProxy The related logical proxy, if any
       
    81         * @param aPhysicalProxy The related physical proxy, if any
       
    82         */
       
    83         virtual TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems,
       
    84             CWPAPItemBase* aLogicalProxy,
       
    85             CWPAPItemBase* aPhysicalProxy ) = 0;
       
    86 
       
    87         /**
       
    88         * The name of the item to be displayed to the user.
       
    89         * @return The name
       
    90         */
       
    91         virtual const TDesC& Name() = 0;
       
    92         
       
    93         /**
       
    94         * SaveWlanDataL
       
    95         */    
       
    96         virtual void SaveWlanDataL( TUint32 aIapId, CCommsDatabase& aCommsDb ) = 0;
       
    97     
       
    98         virtual void UpdateLingerL(const TUint32 aIapId) = 0;
       
    99 
       
   100 	protected: // New methods. Only for subclasses use.
       
   101 
       
   102         /**
       
   103         * Base constructor.
       
   104         * @param aDefaultName The default name to use for an access point
       
   105         */
       
   106         CWPAPItemBase( const TDesC& aDefaultName );
       
   107 
       
   108 		/**
       
   109 		* Mark that this field has arrived and was correctly handled.
       
   110 		* @param aField received field enumeration
       
   111 		*/
       
   112 		void MarkReceived( TMarkedField aField );
       
   113 
       
   114 		/**
       
   115 		* Check has the given field been received.
       
   116 		* @param aField received field enumeration
       
   117 		* @return ETrue if the field has already been received and handled
       
   118 		*/
       
   119 		TBool IsReceived( TMarkedField aField );
       
   120 
       
   121 	protected:
       
   122 
       
   123         /// The default name for an access point
       
   124         const TDesC& iDefaultName;
       
   125 
       
   126 	private: // Data
       
   127 
       
   128 		/// Received fields marked here.
       
   129 		TUint32 iReceivedFieldsFlags;
       
   130 
       
   131 	private: // For testing.
       
   132 		friend class T_CWPAPItemBase;
       
   133 	};
       
   134 
       
   135 #endif	// CWPAPITEMBASE_H
       
   136             
       
   137 // End of File