|
1 /* |
|
2 * Copyright (c) 2007 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: Declaration of HsBrowserModel class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef HSBROWSERMODEL_H |
|
21 #define HSBROWSERMODEL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <es_sock.h> |
|
26 #include "hssinterface.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class RConnection; |
|
30 class RSocketServ; |
|
31 class RHssInterface; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * Manages the HsBrowser data. |
|
36 */ |
|
37 class CHsBrowserModel : public CBase |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Static constructor. |
|
44 */ |
|
45 static CHsBrowserModel* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CHsBrowserModel(); |
|
51 |
|
52 public: // new methods |
|
53 |
|
54 /** |
|
55 * Set model state. |
|
56 * |
|
57 * @param aState State of the model. |
|
58 * @param aSendToHss Flag for sending status to hotspot server. |
|
59 */ |
|
60 void SetState( TUint aState, TBool aSendToHss ); |
|
61 |
|
62 /** |
|
63 * Attach to connection using known iIapId and iNetId. |
|
64 */ |
|
65 TInt Attach(); |
|
66 |
|
67 public: // access |
|
68 |
|
69 inline TInt IapId() const; |
|
70 inline TInt NetId() const; |
|
71 inline HBufC* Url(); |
|
72 inline RConnection& Connection(); |
|
73 inline RSocketServ& SocketServ(); |
|
74 inline RHssInterface& HsServer(); |
|
75 inline TBool Foreground(); |
|
76 inline TUint State(); |
|
77 inline TBool LoginCompleteNoteShown(); |
|
78 inline TInt Position(); |
|
79 inline TInt Priority(); |
|
80 inline HBufC* StaticTitle(); |
|
81 inline HBufC* PageTitle(); |
|
82 |
|
83 inline void SetNetId( TInt aNetId ); |
|
84 inline void SetIapId( TInt aIapId ); |
|
85 inline void SetUrl( const TPtrC& aUrl ); |
|
86 inline void SetState( TUint aState ); |
|
87 inline void SetForeground( TBool aForeground ); |
|
88 inline void SetLoginCompleteNoteShown( TBool aLoginCompleteNoteShown ); |
|
89 inline void SetStaticTitle( const TDesC& aStaticTitle ); |
|
90 inline void SetPageTitle( const TDesC& aPageTitle ); |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * C++ default constructor. |
|
96 */ |
|
97 CHsBrowserModel(); |
|
98 |
|
99 /** |
|
100 * By default Symbian 2nd phase constructor is private. |
|
101 */ |
|
102 void ConstructL(); |
|
103 |
|
104 private: // data |
|
105 |
|
106 /** |
|
107 * IAP ID. |
|
108 */ |
|
109 TInt iIapId; |
|
110 |
|
111 /** |
|
112 * Network ID. |
|
113 */ |
|
114 TInt iNetId; |
|
115 |
|
116 /** |
|
117 * URL of web page for user authentication. |
|
118 * Owned. |
|
119 */ |
|
120 HBufC* iUrl; |
|
121 |
|
122 /** |
|
123 * The management interface for a network connection. |
|
124 */ |
|
125 RConnection iConnection; |
|
126 |
|
127 /** |
|
128 * Provides the Connect() function to create an IPC communication |
|
129 * channel to the socket server. |
|
130 */ |
|
131 RSocketServ iSocketServ; |
|
132 |
|
133 /** |
|
134 * Handle to a session with a hotspot server. |
|
135 */ |
|
136 RHssInterface iHsServer; |
|
137 |
|
138 /** |
|
139 * Application state. Possible values are EHsBrowserUiUndefined, EHsBrowserUiRunning, |
|
140 * EHsBrowserUiAuthenticatedOk, EHsBrowserUiAuthenticatedNok, EHsBrowserUiClosed, defined |
|
141 * in hotspotclientserver.h |
|
142 */ |
|
143 TUint iState; |
|
144 |
|
145 /** |
|
146 * Boolean flag for foreground state. |
|
147 */ |
|
148 TBool iForeground; |
|
149 |
|
150 /** |
|
151 * Boolean flag for showing login complete note. |
|
152 */ |
|
153 TBool iLoginCompleteNoteShown; |
|
154 |
|
155 /** |
|
156 * The window's original ordinal position. |
|
157 */ |
|
158 TInt iPosition; |
|
159 |
|
160 /** |
|
161 * The window's original ordinal priority. |
|
162 */ |
|
163 TInt iPriority; |
|
164 |
|
165 /** |
|
166 * Default page title, "WLAN login" |
|
167 * Owned. |
|
168 */ |
|
169 HBufC* iStaticTitle; |
|
170 |
|
171 /** |
|
172 * Web page title, used instead of default if available. |
|
173 * Owned. |
|
174 */ |
|
175 HBufC* iPageTitle; |
|
176 |
|
177 }; |
|
178 |
|
179 #include "hsbrowsermodel.inl" |
|
180 |
|
181 #endif // HSBROWSERMODEL_H |
|
182 |
|
183 // end of file |
|
184 |