|
1 /* |
|
2 * Copyright (c) 2006-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: Engine class for Device Status Plug-in |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AIDEVICESTATUSPLUGINENGINE_H |
|
20 #define AIDEVICESTATUSPLUGINENGINE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <aisystemuids.hrh> |
|
24 |
|
25 #include "aipublisherbroadcaster.h" |
|
26 #include "aidevicestatuspublisher.h" |
|
27 |
|
28 //device status plugin UI |
|
29 const TInt KImplUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; |
|
30 |
|
31 class MAiContentObserver; |
|
32 class MAiPropertyExtension; |
|
33 class MAiPublishPrioritizer; |
|
34 |
|
35 |
|
36 /** |
|
37 * @ingroup group_devicestatusplugin |
|
38 * |
|
39 * Engine class for Device Status Plug-in |
|
40 * |
|
41 * This class works as an engine for Device Status Plug-in. |
|
42 * It owns the publishers and communicates between them and |
|
43 * the subscribers. |
|
44 * |
|
45 * @since S60 v3.2 |
|
46 */ |
|
47 class CAiDeviceStatusPluginEngine : public CBase, public MAiPublisherBroadcaster |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 static CAiDeviceStatusPluginEngine* NewL( MAiContentObserver& aObserver, |
|
53 MAiPropertyExtension& aExtension, |
|
54 MAiPublishPrioritizer& aPrioritizer); |
|
55 |
|
56 virtual ~CAiDeviceStatusPluginEngine(); |
|
57 |
|
58 /** |
|
59 * Resumes all publishers. |
|
60 */ |
|
61 void ResumePublishersL(); |
|
62 |
|
63 /** |
|
64 * Refreshes all publishers. |
|
65 * @param aClean Indicates if publishers should clean their content before |
|
66 * re-publish. |
|
67 */ |
|
68 void RefreshPublishersL( TBool aClean ); |
|
69 |
|
70 /** |
|
71 * Refreshes specific publishers. |
|
72 * @param aContentId Indicates which publishers should publish their |
|
73 * content. |
|
74 * @param aClean Indicates if publishers should clean their content before |
|
75 * re-publish. |
|
76 * @return ETrue if publisher informed that publish was successful. |
|
77 */ |
|
78 TBool RefreshPublishersL( TInt aContentId, TBool aClean ); |
|
79 |
|
80 |
|
81 public: // from MAiPublisherBroadcaster |
|
82 |
|
83 TBool RefreshPriorizedPublishersL( TInt aContentId, TInt aPriority ); |
|
84 |
|
85 |
|
86 private: |
|
87 |
|
88 CAiDeviceStatusPluginEngine( MAiContentObserver& aObserver, |
|
89 MAiPropertyExtension& aExtension, |
|
90 MAiPublishPrioritizer& aPrioritizer); |
|
91 |
|
92 void ConstructL(); |
|
93 |
|
94 /** |
|
95 * Add Device Status publisher. |
|
96 */ |
|
97 void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); |
|
98 |
|
99 |
|
100 private: // data |
|
101 |
|
102 /** |
|
103 * Array of publishers. |
|
104 * Own. |
|
105 */ |
|
106 RPointerArray<MAiDeviceStatusPublisher> iPublishers; |
|
107 |
|
108 /** |
|
109 * Content observer. |
|
110 * Not own. |
|
111 */ |
|
112 MAiContentObserver* iContentObserver; |
|
113 |
|
114 /** |
|
115 * Property extension. |
|
116 * Not own. |
|
117 */ |
|
118 MAiPropertyExtension* iExtension; |
|
119 |
|
120 /** |
|
121 * Content prioritizer. |
|
122 * Not own. |
|
123 */ |
|
124 MAiPublishPrioritizer* iPrioritizer; |
|
125 }; |
|
126 |
|
127 #endif // AIDEVICESTATUSPLUGINENGINE_H |