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 for WAP adapters. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CWPWAPADAPTERBASE_H |
|
21 #define CWPWAPADAPTERBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <CWPAdapter.h> |
|
25 #include <MWPContextExtension.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CWPCharacteristic; |
|
29 class MWPWAPItemBase; |
|
30 class CCommsDatabase; |
|
31 class CApDataHandler; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CWPWAPAdapterBase is a base for WAP adapters. |
|
37 * |
|
38 * @lib WPWAPAdapter |
|
39 * @since 2.0 |
|
40 */ |
|
41 class CWPWAPAdapterBase : public CWPAdapter, private MWPContextExtension |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~CWPWAPAdapterBase(); |
|
49 |
|
50 public: // from CWPAdapter |
|
51 |
|
52 TInt ItemCount() const; |
|
53 const TDesC16& SummaryTitle(TInt aIndex) const; |
|
54 const TDesC16& SummaryText(TInt aIndex) const; |
|
55 void SaveL( TInt aItem ); |
|
56 TBool CanSetAsDefault( TInt aItem ) const; |
|
57 void SetAsDefaultL( TInt aItem ); |
|
58 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
59 void VisitL(CWPCharacteristic& aElement); |
|
60 void VisitL(CWPParameter& aElement); |
|
61 void VisitLinkL(CWPCharacteristic& aCharacteristic ); |
|
62 TInt ContextExtension( MWPContextExtension*& aExtension ); |
|
63 |
|
64 public: // from MWPContextExtension |
|
65 virtual const TDesC8& SaveDataL( TInt aIndex ) const; |
|
66 virtual void DeleteL( const TDesC8& aSaveData ); |
|
67 TUint32 Uid() const; |
|
68 |
|
69 public: // New methods |
|
70 /** |
|
71 * Handles one application characteristic. |
|
72 * @param aCharacteristic The application characteristic |
|
73 */ |
|
74 virtual void ApplicationL( CWPCharacteristic& aCharacteristic ) = 0; |
|
75 |
|
76 protected: // New functions |
|
77 /** |
|
78 * C++ default constructor. |
|
79 */ |
|
80 CWPWAPAdapterBase(); |
|
81 |
|
82 /** |
|
83 * 2nd phase base constructor. Derived classes must call this. |
|
84 */ |
|
85 void BaseConstructL(); |
|
86 |
|
87 /** |
|
88 * Create CCommsDatabase and APEngine if NULL. |
|
89 */ |
|
90 void CreateDbL(); |
|
91 |
|
92 protected: // Data |
|
93 // The application if of the current characteristic |
|
94 TPtrC iAppID; |
|
95 |
|
96 // The visible setting items. Owns. |
|
97 RPointerArray<MWPWAPItemBase> iItems; |
|
98 |
|
99 // The hidden setting items. Owns. |
|
100 RPointerArray<MWPWAPItemBase> iHiddenItems; |
|
101 |
|
102 // Comms database for saving. Owns. |
|
103 CCommsDatabase* iCommsDb; |
|
104 |
|
105 // APEngine for saving. Owns. |
|
106 CApDataHandler* iAPHandler; |
|
107 }; |
|
108 |
|
109 #endif // CWPWAPADAPTERBASE_H |
|
110 |
|
111 // End of File |
|