|
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: Device status plugin interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AIDEVICESTATUSPLUGIN_H |
|
20 #define C_AIDEVICESTATUSPLUGIN_H |
|
21 |
|
22 // System includes |
|
23 |
|
24 // User includes |
|
25 #include <hscontentpublisher.h> |
|
26 #include <aicontentrequest.h> |
|
27 |
|
28 // Forward declarations |
|
29 class MAiDeviceStatusPublisher; |
|
30 class CAiContentItemArrayIterator; |
|
31 class CAiDeviceStatusPluginEngine; |
|
32 class CAiMultiContentObserver; |
|
33 class CAiPublishPrioritizer; |
|
34 class CAiNetworkInfoListener; |
|
35 |
|
36 /** |
|
37 * @ingroup group_devicestatusplugin |
|
38 * |
|
39 * Device status plugin interface. |
|
40 * |
|
41 * This class implements required active idle plugin API. |
|
42 * |
|
43 * @since S60 3.2 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CAiDeviceStatusPlugin ) : public CHsContentPublisher, |
|
46 public MAiContentRequest |
|
47 { |
|
48 public: |
|
49 // constructors and destructor |
|
50 static CAiDeviceStatusPlugin* NewL(); |
|
51 static CAiDeviceStatusPlugin* NewLC(); |
|
52 |
|
53 virtual ~CAiDeviceStatusPlugin(); |
|
54 |
|
55 protected: |
|
56 // from CHsContentPublisher |
|
57 |
|
58 /** |
|
59 * @see CHsContentPublisher |
|
60 */ |
|
61 void Start( CHsContentPublisher::TStartReason aReason ); |
|
62 |
|
63 /** |
|
64 * @see CHsContentPublisher |
|
65 */ |
|
66 void Stop( CHsContentPublisher::TStopReason aReason ); |
|
67 |
|
68 /** |
|
69 * @see CHsContentPublisher |
|
70 */ |
|
71 void Resume( CHsContentPublisher::TResumeReason aReason ); |
|
72 |
|
73 /** |
|
74 * @see CHsContentPublisher |
|
75 */ |
|
76 void Suspend( CHsContentPublisher::TSuspendReason aReason ); |
|
77 |
|
78 /** |
|
79 * @see CHsContentPublisher |
|
80 */ |
|
81 void SubscribeL( MAiContentObserver& aObserver ); |
|
82 |
|
83 /** |
|
84 * @see CHsContentPublisher |
|
85 */ |
|
86 void ConfigureL( RAiSettingsItemArray& aSettings ); |
|
87 |
|
88 /** |
|
89 * @see CHsContentPublisher |
|
90 */ |
|
91 TAny* GetProperty( CHsContentPublisher::TProperty aProperty ); |
|
92 |
|
93 protected: |
|
94 // from MAiContentRequest |
|
95 |
|
96 /** |
|
97 * @see MAiContentRequest |
|
98 */ |
|
99 TBool RefreshContent( TInt aContentId ); |
|
100 |
|
101 /** |
|
102 * @see MAiContentRequest |
|
103 */ |
|
104 TBool SuspendContent( TInt aContentId ); |
|
105 |
|
106 private: |
|
107 // constructors |
|
108 |
|
109 /** |
|
110 * C++ default constructor |
|
111 */ |
|
112 CAiDeviceStatusPlugin(); |
|
113 |
|
114 /** |
|
115 * 2nd phase constructor |
|
116 */ |
|
117 void ConstructL(); |
|
118 |
|
119 private: |
|
120 // new functions |
|
121 |
|
122 void AllocateResourcesL(); |
|
123 void FreeResources(); |
|
124 void DoResumeL(); |
|
125 |
|
126 void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); |
|
127 |
|
128 private: |
|
129 // data |
|
130 |
|
131 /** Device Status Plug-in Engine, owned */ |
|
132 CAiDeviceStatusPluginEngine* iEngine; |
|
133 /** Content observers, owned */ |
|
134 CAiMultiContentObserver* iContentObservers; |
|
135 /** Device Status Plug-in content prioritizer, owned */ |
|
136 CAiPublishPrioritizer* iPrioritizer; |
|
137 /** Content item array iterator, owned */ |
|
138 MAiContentItemIterator* iContent; |
|
139 /** Content item array iterator for resources, owned */ |
|
140 MAiContentItemIterator* iResources; |
|
141 /** Offset of the loaded resource file */ |
|
142 TInt iResourceOffset; |
|
143 /** Network info listener, owned */ |
|
144 CAiNetworkInfoListener* iListener; |
|
145 /** Flag to indicate republish need */ |
|
146 TBool iRequirePublish; |
|
147 }; |
|
148 |
|
149 #endif // C_AIDEVICESTATUSPLUGIN_H |
|
150 |
|
151 // End of file |