|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Network status publisher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AINWSPUBLISHER_H |
|
20 #define C_AINWSPUBLISHER_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <aidevicestatuscontentmodel.h> |
|
25 |
|
26 // User includes |
|
27 #include "aidevicestatuspublisher.h" |
|
28 #include "ainetworkinfoobserver.h" |
|
29 |
|
30 // Forward declarations |
|
31 class MAiDeviceStatusContentObserver; |
|
32 class CHsContentPublisher; |
|
33 class CAiNetworkInfoListener; |
|
34 class CRepository; |
|
35 |
|
36 /** |
|
37 * @ingroup group_devicestatusplugin |
|
38 * |
|
39 * Listens Network status and publishes data if network selection dialog is needed. |
|
40 * |
|
41 * @since S60 3.2 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CAiNwsPublisher ) : public CBase, |
|
44 public MAiDeviceStatusPublisher, |
|
45 public MAiNetworkInfoObserver |
|
46 { |
|
47 public: |
|
48 |
|
49 static CAiNwsPublisher* NewL(); |
|
50 |
|
51 virtual ~CAiNwsPublisher(); |
|
52 |
|
53 // from base class MAiDeviceStatusPublisher |
|
54 |
|
55 void ResumeL(); |
|
56 |
|
57 void Subscribe( MAiContentObserver& aObserver, |
|
58 CHsContentPublisher& aExtension, |
|
59 MAiPublishPrioritizer& aPrioritizer, |
|
60 MAiPublisherBroadcaster& aBroadcaster ); |
|
61 |
|
62 void RefreshL( TBool aClean ); |
|
63 |
|
64 TBool RefreshL( TInt aContentId, TBool aClean ); |
|
65 |
|
66 protected: |
|
67 |
|
68 //from base class MAiNetworkInfoObserver |
|
69 |
|
70 void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, |
|
71 const TNWInfo& aInfo, |
|
72 const TBool aShowOpInd ); |
|
73 |
|
74 private: |
|
75 |
|
76 |
|
77 CAiNwsPublisher(); |
|
78 |
|
79 void ConstructL(); |
|
80 |
|
81 void HandleStateChange( const TNWInfo& aInfo ); |
|
82 |
|
83 void HandleNetworkFound(); |
|
84 |
|
85 void HandleNetworkLost( const TNWNetworkSelectionSetting &aSelectionSetting ); |
|
86 |
|
87 |
|
88 /** |
|
89 * Tests if offline mode is engaged. |
|
90 * |
|
91 * @return ETrue if offline mode is currently active |
|
92 */ |
|
93 TBool IsOffLineMode() const; |
|
94 |
|
95 /** |
|
96 * Tests if Bluetooth SAP is in connected mode. |
|
97 * |
|
98 * @return ETrue if Bluetooth SAP is active. |
|
99 */ |
|
100 TBool IsBluetoothSAPConnected() const; |
|
101 |
|
102 private: // data |
|
103 |
|
104 /** |
|
105 * Content observer. |
|
106 * Not own. |
|
107 */ |
|
108 MAiContentObserver* iContentObserver; |
|
109 |
|
110 /** |
|
111 * Property extension. |
|
112 * Not own. |
|
113 */ |
|
114 CHsContentPublisher* iExtension; |
|
115 |
|
116 /** |
|
117 * Network info listener. |
|
118 * Own. |
|
119 */ |
|
120 CAiNetworkInfoListener* iListener; |
|
121 |
|
122 /** |
|
123 * Profile API. |
|
124 */ |
|
125 CRepository* iProfileApi; |
|
126 |
|
127 |
|
128 /** |
|
129 * A true value if registered to network. |
|
130 */ |
|
131 TBool iRegistered; |
|
132 |
|
133 }; |
|
134 |
|
135 |
|
136 #endif // C_AINWSPUBLISHER_H |