|
1 /* |
|
2 * Copyright (c) 2005-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: Plug-in main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAIPROFILEPLUGIN_H |
|
20 #define CAIPROFILEPLUGIN_H |
|
21 |
|
22 // System includes |
|
23 |
|
24 // User includes |
|
25 #include <hscontentpublisher.h> |
|
26 #include <aicontentmodel.h> |
|
27 #include "maiprofilepluginnotifier.h" |
|
28 |
|
29 // Forward declarations |
|
30 class MAiContentObserver; |
|
31 class MAiContentItemIterator; |
|
32 class CAiProfileEngine; |
|
33 |
|
34 /** |
|
35 * @ingroup group_profileplugin |
|
36 * |
|
37 * Plug-in main class |
|
38 * |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CAiProfilePlugin ) : public CHsContentPublisher, |
|
42 public MAiProfilePluginNotifier |
|
43 { |
|
44 public: |
|
45 // constructors and destructor |
|
46 |
|
47 /** |
|
48 * Part of the two phased constuction |
|
49 * |
|
50 * @param none |
|
51 * @return none |
|
52 */ |
|
53 static CAiProfilePlugin* NewL(); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 * |
|
58 * @param none |
|
59 * @return none |
|
60 */ |
|
61 ~CAiProfilePlugin(); |
|
62 |
|
63 private: |
|
64 // constructors |
|
65 |
|
66 /** |
|
67 * Constructor |
|
68 * |
|
69 * @param none |
|
70 * @return none |
|
71 */ |
|
72 CAiProfilePlugin(); |
|
73 |
|
74 /** |
|
75 * 2nd phase constructor |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 public: |
|
80 // from CHsContentPublisher |
|
81 |
|
82 /** |
|
83 * @see CHsContentPublisher |
|
84 */ |
|
85 void Start( TStartReason aReason ); |
|
86 |
|
87 /** |
|
88 * @see CHsContentPublisher |
|
89 */ |
|
90 void Stop( TStopReason aReason ); |
|
91 |
|
92 /** |
|
93 * @see CHsContentPublisher |
|
94 */ |
|
95 void Resume( TResumeReason aReason ); |
|
96 |
|
97 /** |
|
98 * @see CHsContentPublisher |
|
99 */ |
|
100 void Suspend( TSuspendReason aReason ); |
|
101 |
|
102 /** |
|
103 * @see CHsContentPublisher |
|
104 */ |
|
105 void SubscribeL( MAiContentObserver& aObserver ); |
|
106 |
|
107 /** |
|
108 * @see CHsContentPublisher |
|
109 */ |
|
110 void ConfigureL( RAiSettingsItemArray& aSettings ); |
|
111 |
|
112 /** |
|
113 * @see CHsContentPublisher |
|
114 */ |
|
115 TAny* GetProperty( TProperty aProperty ); |
|
116 |
|
117 /** |
|
118 * @see CHsContentPublisher |
|
119 */ |
|
120 void HandleEvent( TInt aEvent, const TDesC& aParam ); |
|
121 |
|
122 private: |
|
123 // from MAiProfilePluginNotifier |
|
124 |
|
125 /** |
|
126 * @see MAiProfilePluginNotifier |
|
127 */ |
|
128 void NotifyContentUpdate(); |
|
129 |
|
130 public: |
|
131 // new functions |
|
132 |
|
133 /** |
|
134 * Publishes profile names |
|
135 * |
|
136 * @param void |
|
137 * @return void |
|
138 */ |
|
139 void PublishL(); |
|
140 |
|
141 private: |
|
142 // new functions |
|
143 |
|
144 /** |
|
145 * Resume the plug-in. |
|
146 * |
|
147 * @param void |
|
148 * @return void |
|
149 */ |
|
150 void DoResumeL(); |
|
151 |
|
152 /** |
|
153 * Clean profile names from published content |
|
154 * |
|
155 * @param void |
|
156 * @return void |
|
157 */ |
|
158 void CleanPublishedProfileNames(); |
|
159 |
|
160 private: |
|
161 // data |
|
162 |
|
163 /** Iterator for plugin content, owned */ |
|
164 MAiContentItemIterator* iContent; |
|
165 /** Iterator for plugin events, owned */ |
|
166 MAiContentItemIterator* iEvents; |
|
167 /** Iterator for plug-in resources, owned */ |
|
168 MAiContentItemIterator* iResources; |
|
169 /** Plugin engine, owned */ |
|
170 CAiProfileEngine* iEngine; |
|
171 /** Array of content observers */ |
|
172 RPointerArray<MAiContentObserver> iObservers; |
|
173 /** Current profile count */ |
|
174 TInt iCurrentCount; |
|
175 /** Profile count that is used as reference when profile list is updated */ |
|
176 TInt iPreviousCount; |
|
177 /** Active profile, owned */ |
|
178 HBufC* iActiveProfileAndChar; |
|
179 /** Previous profile, owned */ |
|
180 HBufC* iPreviousProfileNameAndChar; |
|
181 /** Flag to indicate whether publish is required */ |
|
182 TBool iPublishRequired; |
|
183 }; |
|
184 |
|
185 #endif // CAIPROFILEPLUGIN_H |
|
186 |
|
187 // End of file |
|
188 |
|
189 |