|
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 * Base class for WAP setting items. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CWPWAPITEMBASE_H |
|
21 #define CWPWAPITEMBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MWPVisitor.h> |
|
26 #include "MWPWAPItemBase.h" |
|
27 #include <cmmanagerext.h> |
|
28 #include <cmconnectionmethodext.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CCommsDatabase; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CWPWAPItemBase is a base class for browser settings. |
|
38 * |
|
39 * @lib WPWAPAdapter |
|
40 * @since 2.0 |
|
41 */ |
|
42 class CWPWAPItemBase : public CBase, private MWPVisitor, public MWPWAPItemBase |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CWPWAPItemBase(); |
|
50 |
|
51 public: // From MWPVisitor |
|
52 |
|
53 void VisitL(CWPCharacteristic& aCharacteristic); |
|
54 void VisitL(CWPParameter& aParameter); |
|
55 void VisitLinkL(CWPCharacteristic& aCharacteristic ); |
|
56 |
|
57 public: // From MWPWAPItemBase |
|
58 |
|
59 const TDesC& Name() const; |
|
60 const TDesC& Title() const; |
|
61 const TDesC& Address() const; |
|
62 const TDesC8& SaveData() const; |
|
63 |
|
64 protected: // New methods |
|
65 /** |
|
66 * C++ default constructor. |
|
67 * @param aTitle Title for items |
|
68 * @param aDefaultName Default name for items |
|
69 * @param aCharacteristic The APPLICATION characteristic |
|
70 * @param aCommsDb The CommsDB to use. Created if NULL. |
|
71 * @param aAPHandler The APEngine data handler to use. Created if NULL. |
|
72 */ |
|
73 CWPWAPItemBase( const TDesC& aTitle, |
|
74 const TDesC& aDefaultName, |
|
75 CWPCharacteristic& aCharacteristic, |
|
76 CCommsDatabase*& aCommsDb, |
|
77 RCmManagerExt*& aCmManager); |
|
78 |
|
79 /** |
|
80 * 2nd phase base constructor. Derived classes must call this. |
|
81 */ |
|
82 void BaseConstructL(); |
|
83 |
|
84 /** |
|
85 * Handles one resource item. |
|
86 * @param aResource The RESOURCE item |
|
87 */ |
|
88 virtual void ResourceL( CWPCharacteristic& aResource ) = 0; |
|
89 |
|
90 /** |
|
91 * Create CCommsDatabase and APEngine if NULL. |
|
92 */ |
|
93 void CreateDbL(); |
|
94 |
|
95 /** |
|
96 * Writes a home page to an access point. If access point already |
|
97 * has a home page, create a new one. |
|
98 * @param aItem Access point to access |
|
99 */ |
|
100 void WriteHomePageL( RCmConnectionMethodExt& aCmItem ); |
|
101 |
|
102 /** |
|
103 * Create a valid name for the access point. |
|
104 * @param aName The base name for access point |
|
105 * @param aDb CommsDb instance |
|
106 */ |
|
107 void MakeValidNameL( TDes& aName, CCommsDatabase& aDb ) const; |
|
108 |
|
109 protected: |
|
110 // The parent characteristic. Refs. |
|
111 CWPCharacteristic& iCharacteristic; |
|
112 |
|
113 // The preferred access point name |
|
114 TPtrC iName; |
|
115 |
|
116 // The access point address, Owns. |
|
117 HBufC* iAddr; |
|
118 |
|
119 // The UID of the access point |
|
120 TUint32 iUID; |
|
121 |
|
122 // UID of the saved item |
|
123 TPckgBuf<TWPWAPSaveItem> iSaveItem; |
|
124 |
|
125 // Temporary current proxy while visiting. Refs. |
|
126 CWPCharacteristic* iLink; |
|
127 |
|
128 // Text to return in SummaryTitle(). |
|
129 const TDesC& iTitle; |
|
130 |
|
131 // Default name of access point. |
|
132 const TDesC& iDefaultName; |
|
133 |
|
134 // Comms db. Refs. |
|
135 CCommsDatabase*& iCommsDb; |
|
136 |
|
137 // @var Pointer to Connection Method Manager that is required to access |
|
138 // Access Point data |
|
139 RCmManagerExt*& iCmManager; |
|
140 }; |
|
141 |
|
142 #endif // CWPWAPITEMBASE_H |
|
143 |
|
144 // End of File |