omaprovisioning/provisioning/accesspointadapter/Inc/CWPAPAccesspointItem.h
branchRCL_3
changeset 25 b183ec05bd8c
parent 24 13d7c31c74e0
child 26 19bba8228ff0
equal deleted inserted replaced
24:13d7c31c74e0 25:b183ec05bd8c
     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:    Class stores data for one accesspoint
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWPAPACCESSPOINTITEM_H
       
    21 #define CWPAPACCESSPOINTITEM_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32def.h>
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <cmmanagerext.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CWPEngine;
       
    31 class CWPAPItemBase;
       
    32 class CWPParameter;
       
    33 class CWPCharacteristic;
       
    34 class CCommsDatabase;
       
    35 class CWPAPNapdef;
       
    36 class RCmManagerExt;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41  * CWPAPAccesspointItem handles accesspoint settings. It links data from
       
    42  * logical proxy, physical proxy and napdef into one item.
       
    43  */ 
       
    44 class CWPAPAccesspointItem : public CBase
       
    45 	{
       
    46 	public:  // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @param aDefaultName The default name if none is found
       
    51         * @param aLogicalProxy The logical proxy 
       
    52         * @param aPhysicalProxy The physical proxy 
       
    53         * @param aNapdef The napdef
       
    54         * @param aCharacteristic The characteristic 
       
    55         */
       
    56 		static CWPAPAccesspointItem* NewLC(
       
    57 		                            const TDesC& aDefaultName,
       
    58                                     CWPAPItemBase* iLogicalProxy,
       
    59                                     CWPAPItemBase* iPhysicalProxy,
       
    60                                     CWPAPItemBase* aNapdef,
       
    61                                     CWPCharacteristic& aCharacteristic );
       
    62 
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66 		virtual ~CWPAPAccesspointItem();
       
    67 
       
    68 	public: // New methods
       
    69 
       
    70 		/**
       
    71 		* Get the accesspoint name.
       
    72 		* @return reference to name.
       
    73 		*/
       
    74 		const TDesC& Name() const;
       
    75 		
       
    76 		/**
       
    77 		* Get the NAPdef pointer
       
    78 		* @return pointer to napdef.
       
    79 		*/
       
    80 	  	CWPAPItemBase* NapDef();
       
    81 	  	
       
    82 	  	/**
       
    83 		* Set the pointer to the CM manager
       
    84 		* @return void
       
    85 		*/
       
    86 	  	void SetCMManager( RCmManagerExt* aCm );
       
    87 	  	
       
    88 	  	/**
       
    89 		* Get the characteristic value
       
    90 		* @return iCharacteristic.
       
    91 		*/
       
    92 	  	TInt Characteristic();
       
    93 		
       
    94 		/**
       
    95 		* Save this accesspoint to comms database.
       
    96 		* @param aCommsDb reference to CCommsdatabase
       
    97 		*/
       
    98 		TUint32 SaveL( CCommsDatabase& aCommsDb );
       
    99 
       
   100         /**
       
   101         * Return the UID of the saved access point.
       
   102         * @return UID
       
   103         */
       
   104         const TDesC8& Uid() const;
       
   105 
       
   106         /**
       
   107         * Delete old data from engine model.
       
   108         */
       
   109         void DeleteUidData() const;
       
   110 
       
   111 	private:  // New functions
       
   112 
       
   113 		/**
       
   114 		* Store the accesspoint data to comms database.
       
   115 		* @param aCommsDb reference to CCommsdatabase
       
   116 		*/ 
       
   117 		TUint32 StoreL( CCommsDatabase& aCommsDb );
       
   118 
       
   119 		/**
       
   120         * C++ default constructor.
       
   121         * @param aDefaultName The default name if none is found
       
   122         * @param aLogicalProxy The logical proxy 
       
   123         * @param aPhysicalProxy The physical proxy 
       
   124         * @param aNapdef The napdef
       
   125         * @param aCharacteristic The characteristic 
       
   126         */
       
   127 		CWPAPAccesspointItem( const TDesC& aDefaultName,
       
   128                               CWPAPItemBase* iLogicalProxy,
       
   129                               CWPAPItemBase* iPhysicalProxy,
       
   130                               CWPAPItemBase* aNapdef,
       
   131                               CWPCharacteristic& aCharacteristic );
       
   132 
       
   133         /**
       
   134         * By default Symbian 2nd phase constructor is private.
       
   135         */
       
   136 		void ConstructL();
       
   137 
       
   138 	private: // Data (Total ownership is assumed unless otherwise stated)
       
   139 
       
   140         /// The default name if no other is found
       
   141         const TDesC& iDefaultName;
       
   142 
       
   143         /// The napdef
       
   144         CWPAPItemBase* iNapdef;
       
   145 
       
   146         /// The physical proxy
       
   147         CWPAPItemBase* iPhysicalProxy;
       
   148 
       
   149         /// The logical proxy
       
   150         CWPAPItemBase* iLogicalProxy;
       
   151 
       
   152         /// The uid created when saving
       
   153         TPckgBuf<TUint32> iUid;
       
   154 
       
   155         /// The characteristic the caused the creation of an access point
       
   156         CWPCharacteristic& iCharacteristic;
       
   157         RCmManagerExt* iCmManager;
       
   158 
       
   159 	private: // For testing usage.
       
   160 		friend class T_CWPAPAccesspointItem;
       
   161 		friend class T_CWPAPAdapter;
       
   162 		friend class T_WPAPTestUtils;
       
   163 	};
       
   164 
       
   165 #endif	// CWPAPACCESSPOINTITEM_H
       
   166             
       
   167 // End of File