|
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 CWPAPAccesspointItem; |
|
52 class CCommsDatabase; |
|
53 |
|
54 // CLASS DECLARATION |
|
55 |
|
56 /** |
|
57 * CWPAPItemBase is a base class for all the items in WPAPAdapter. |
|
58 */ |
|
59 class CWPAPItemBase : public CBase |
|
60 { |
|
61 public: |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CWPAPItemBase(); |
|
67 |
|
68 public: // New methods |
|
69 |
|
70 /** |
|
71 * Store the item data to APEngine's accesspoint item. |
|
72 * @param aAPItem item where data is stored. |
|
73 */ |
|
74 virtual void AddDataL( RCmConnectionMethodExt& ) = 0; |
|
75 |
|
76 /** |
|
77 * Add access point items to an array. |
|
78 * @param aItems The array to add to |
|
79 * @param aLogicalProxy The related logical proxy, if any |
|
80 * @param aPhysicalProxy The related physical proxy, if any |
|
81 */ |
|
82 virtual TInt AddItemsL( RPointerArray<CWPAPAccesspointItem>& aItems, |
|
83 CWPAPItemBase* aLogicalProxy, |
|
84 CWPAPItemBase* aPhysicalProxy ) = 0; |
|
85 |
|
86 /** |
|
87 * The name of the item to be displayed to the user. |
|
88 * @return The name |
|
89 */ |
|
90 virtual const TDesC& Name() = 0; |
|
91 |
|
92 /** |
|
93 * SaveWlanDataL |
|
94 */ |
|
95 virtual void SaveWlanDataL( TUint32 aIapId, CCommsDatabase& aCommsDb ) = 0; |
|
96 |
|
97 virtual void UpdateLingerL(const TUint32 aIapId) = 0; |
|
98 |
|
99 protected: // New methods. Only for subclasses use. |
|
100 |
|
101 /** |
|
102 * Base constructor. |
|
103 * @param aDefaultName The default name to use for an access point |
|
104 */ |
|
105 CWPAPItemBase( const TDesC& aDefaultName ); |
|
106 |
|
107 /** |
|
108 * Mark that this field has arrived and was correctly handled. |
|
109 * @param aField received field enumeration |
|
110 */ |
|
111 void MarkReceived( TMarkedField aField ); |
|
112 |
|
113 /** |
|
114 * Check has the given field been received. |
|
115 * @param aField received field enumeration |
|
116 * @return ETrue if the field has already been received and handled |
|
117 */ |
|
118 TBool IsReceived( TMarkedField aField ); |
|
119 |
|
120 protected: |
|
121 |
|
122 /// The default name for an access point |
|
123 const TDesC& iDefaultName; |
|
124 |
|
125 private: // Data |
|
126 |
|
127 /// Received fields marked here. |
|
128 TUint32 iReceivedFieldsFlags; |
|
129 |
|
130 private: // For testing. |
|
131 friend class T_CWPAPItemBase; |
|
132 }; |
|
133 |
|
134 #endif // CWPAPITEMBASE_H |
|
135 |
|
136 // End of File |