|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * Active object to load widgets into list |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef WMWIDGETLOADERAO_H_ |
|
20 #define WMWIDGETLOADERAO_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CWmPlugin; |
|
27 class CWmListBox; |
|
28 class CHsContentInfo; |
|
29 class CWmWidgetData; |
|
30 class CWmPersistentWidgetOrder; |
|
31 class RWidgetRegistryClientSession; |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 |
|
35 /** |
|
36 * Active object to load widgets into list |
|
37 */ |
|
38 NONSHARABLE_CLASS( CWmWidgetLoaderAo ) : public CAsyncOneShot |
|
39 { |
|
40 |
|
41 public: |
|
42 /** |
|
43 * Static constructor |
|
44 */ |
|
45 static CWmWidgetLoaderAo* NewL( |
|
46 CWmPlugin& aWmPlugin, |
|
47 CWmListBox& aTargetList ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CWmWidgetLoaderAo(); |
|
53 |
|
54 /** |
|
55 * Starts the load process by activating the AO |
|
56 */ |
|
57 void StartLoading(); |
|
58 |
|
59 private: |
|
60 |
|
61 /** |
|
62 * Constructor |
|
63 */ |
|
64 CWmWidgetLoaderAo( |
|
65 CWmPlugin& aWmPlugin, |
|
66 CWmListBox& aTargetList ); |
|
67 |
|
68 /** |
|
69 * 2nd phase constructor |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 protected: // from CActive |
|
74 |
|
75 /** |
|
76 * AO body |
|
77 */ |
|
78 void RunL(); |
|
79 |
|
80 /** |
|
81 * AO error handler |
|
82 */ |
|
83 TInt RunError( TInt aError ); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * loads widgets into the listbox |
|
89 */ |
|
90 void DoLoadWidgetsL(); |
|
91 |
|
92 /** |
|
93 * finds a widget data entry from iWidgetsList that matches |
|
94 * given content info. returns a pointer to the data found, |
|
95 * or NULL if not found |
|
96 */ |
|
97 CWmWidgetData* FindWidgetData( CHsContentInfo& aContentInfo ); |
|
98 |
|
99 /** |
|
100 * adds a widget data entry to iWidgetsList |
|
101 * takes ownership of aContentInfo |
|
102 */ |
|
103 void AddWidgetDataL( CHsContentInfo* aContentInfo ); |
|
104 |
|
105 /** |
|
106 * cleanup resources allocated runing one single run |
|
107 */ |
|
108 void Cleanup(); |
|
109 |
|
110 private: // data |
|
111 |
|
112 /** reference to the widget manager root */ |
|
113 CWmPlugin& iWmPlugin; |
|
114 |
|
115 /** target where widgets are to be loaded */ |
|
116 CWmListBox& iWidgetsList; |
|
117 |
|
118 /** widget registry */ |
|
119 RWidgetRegistryClientSession* iWidgetRegistry; |
|
120 |
|
121 /** persistent widget order */ |
|
122 CWmPersistentWidgetOrder* iWidgetOrder; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // WMWIDGETLOADERAO_H_ |