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: Handles streaming app settings in OMA provisioning. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef STREAMINGADAPTER_H |
|
20 #define STREAMINGADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <CWPAdapter.h> |
|
25 #include <MWPContextExtension.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CMPSettingsModel; |
|
29 struct TStreamingAdapterData; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CStreamingAdapter handles accesspoint settings. |
|
35 */ |
|
36 class CStreamingAdapter : public CWPAdapter, |
|
37 public MWPContextExtension |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * @return a instance of class. |
|
44 */ |
|
45 static CStreamingAdapter* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~CStreamingAdapter(); |
|
51 |
|
52 public: // Functions from base classes |
|
53 |
|
54 /** |
|
55 * From CWPAdapter |
|
56 */ |
|
57 TInt ItemCount() const; |
|
58 |
|
59 /** |
|
60 * From CWPAdapter |
|
61 */ |
|
62 const TDesC16& SummaryTitle(TInt aIndex) const; |
|
63 |
|
64 /** |
|
65 * From CWPAdapter |
|
66 */ |
|
67 const TDesC16& SummaryText(TInt aIndex) const; |
|
68 |
|
69 /** |
|
70 * From CWPAdapter |
|
71 */ |
|
72 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
73 |
|
74 /** |
|
75 * From CWPAdapter |
|
76 */ |
|
77 void SaveL(TInt aItem); |
|
78 |
|
79 /** |
|
80 * From CWPAdapter |
|
81 */ |
|
82 TBool CanSetAsDefault(TInt aItem) const; |
|
83 |
|
84 /** |
|
85 * From CWPAdapter |
|
86 */ |
|
87 void SetAsDefaultL(TInt aItem); |
|
88 |
|
89 /** |
|
90 * From CWPAdapter |
|
91 */ |
|
92 void VisitL(CWPCharacteristic& aElement); |
|
93 |
|
94 /** |
|
95 * From CWPAdapter |
|
96 */ |
|
97 void VisitL(CWPParameter& aElement); |
|
98 |
|
99 /** |
|
100 * From CWPAdapter |
|
101 */ |
|
102 void VisitLinkL(CWPCharacteristic& aCharacteristic); |
|
103 |
|
104 /** |
|
105 * From CWPAdapter |
|
106 */ |
|
107 TInt ContextExtension(MWPContextExtension*& aExtension); |
|
108 |
|
109 /** |
|
110 * From MWPContextExtension |
|
111 */ |
|
112 const TDesC8& SaveDataL(TInt aIndex) const; |
|
113 |
|
114 /** |
|
115 * From MWPContextExtension |
|
116 */ |
|
117 void DeleteL(const TDesC8& aSaveData); |
|
118 |
|
119 /** |
|
120 * From MWPContextExtension |
|
121 */ |
|
122 TUint32 Uid() const; |
|
123 |
|
124 |
|
125 private: // Default constructors |
|
126 |
|
127 /** |
|
128 * C++ default constructor. |
|
129 */ |
|
130 CStreamingAdapter(); |
|
131 |
|
132 /** |
|
133 * By default Symbian 2nd phase constructor is private. |
|
134 */ |
|
135 void ConstructL(); |
|
136 |
|
137 private: // New functions |
|
138 |
|
139 /** |
|
140 * Validates the data in iTempData. |
|
141 */ |
|
142 TBool IsValid(); |
|
143 |
|
144 /** |
|
145 * Parses an integer from a descriptor. |
|
146 * Returns error code. |
|
147 */ |
|
148 TInt ParseIntegerL(const TDesC& aPtr, TInt& aInt); |
|
149 |
|
150 /** |
|
151 * ResetAndDestroy() cleanup for ecom implementation array. |
|
152 * @param aAny the implementation array |
|
153 */ |
|
154 static void Cleanup( TAny* aAny ); |
|
155 |
|
156 /** |
|
157 * Initialise CMPSettingsModel |
|
158 * @param None |
|
159 * @return None |
|
160 */ |
|
161 void InitSettingsModelL(); |
|
162 |
|
163 private: // Data |
|
164 |
|
165 HBufC* iTitle; |
|
166 CMPSettingsModel* iModel; |
|
167 |
|
168 TPtrC iAppId; |
|
169 TStreamingAdapterData* iCurrentData; |
|
170 TStreamingAdapterData* iTempData; |
|
171 |
|
172 TPckgBuf<TUint32> iSavedID; |
|
173 |
|
174 private: |
|
175 friend class TM_CWPStreamingAdapterTestCase; |
|
176 |
|
177 |
|
178 }; |
|
179 |
|
180 #endif // STREAMINGADAPTER_H |
|
181 |
|
182 // End of File |
|