23
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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: This is a plugin implementation
|
|
15 |
*
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef CSERVICEWIDGETPLUGIN_H
|
|
20 |
#define CSERVICEWIDGETPLUGIN_H
|
|
21 |
|
|
22 |
//content harvester
|
|
23 |
#include <contentharvesterplugin.h>
|
|
24 |
#include <contentharvesterpluginuids.hrh>
|
|
25 |
#include <mspnotifychangeobserver.h>
|
|
26 |
//#include <aipropertyextension.h>
|
|
27 |
#include "mservicewidgetobservers.h"
|
|
28 |
#include<badesca.h>
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
class CServiceWidgetServiceManager;
|
|
31 |
class CServiceWidgetContentPublisher;
|
|
32 |
class CCoeEnv;
|
|
33 |
class MVIMPSTSettingsStore;
|
|
34 |
class CSPNotifyChange;
|
|
35 |
|
|
36 |
/**
|
|
37 |
*
|
|
38 |
* Plugin implementation
|
|
39 |
*
|
|
40 |
* @servicewidgetdatapublisher.dll
|
|
41 |
* @since S60 5.0
|
|
42 |
*/
|
|
43 |
|
|
44 |
class CServiceWidgetPlugin : public CContentHarvesterPlugin,
|
|
45 |
public MSPNotifyChangeObserver,
|
|
46 |
public MServiceWidgetEventObserver//,
|
|
47 |
//public MAiPropertyExtension
|
|
48 |
{
|
|
49 |
friend class Cservicewidgetdatapublisher_ut;
|
|
50 |
public:
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Two-phased constructor.
|
|
54 |
* @return the instance of same class
|
|
55 |
*/
|
|
56 |
static CServiceWidgetPlugin* NewL();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Standard C++ destructor
|
|
60 |
*/
|
|
61 |
~CServiceWidgetPlugin();
|
|
62 |
|
|
63 |
|
|
64 |
private:
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Standard C++ constructor
|
|
68 |
*/
|
|
69 |
CServiceWidgetPlugin();
|
|
70 |
|
|
71 |
/**
|
|
72 |
* 2phase construction
|
|
73 |
*/
|
|
74 |
void ConstructL();
|
|
75 |
|
|
76 |
/**
|
|
77 |
* helper method for reading the service ids from cspsettings
|
|
78 |
*/
|
|
79 |
void ReadServiceIdsL();
|
|
80 |
/**
|
|
81 |
* helper method for reading resource file
|
|
82 |
*/
|
|
83 |
void LoadResourceFileL();
|
|
84 |
/**
|
|
85 |
* helper method for validating Service and creating/deleting service managers
|
|
86 |
* as per service
|
|
87 |
*/
|
|
88 |
void ValidateAllServicesL();
|
|
89 |
|
|
90 |
public : //CContentHarvesterPlugin
|
|
91 |
/**
|
|
92 |
* Triggers update process.
|
|
93 |
* all the operation must start here
|
|
94 |
*/
|
|
95 |
void UpdateL() ;
|
|
96 |
|
|
97 |
public : // from MSPNotifyChangeObserver
|
|
98 |
|
|
99 |
/**
|
|
100 |
* From MSPNotifyChangeObserver
|
|
101 |
* Callback when service has changed
|
|
102 |
*
|
|
103 |
* @since S60 5.0
|
|
104 |
* @param aServiceId changed service
|
|
105 |
* @return None
|
|
106 |
*/
|
|
107 |
void HandleNotifyChange( TServiceId aServiceId );
|
|
108 |
|
|
109 |
/**
|
|
110 |
* From MSPNotifyChangeObserver
|
|
111 |
* Callback when service error occures
|
|
112 |
*
|
|
113 |
* @since S60 5.0
|
|
114 |
* @param aError error code
|
|
115 |
* @return None
|
|
116 |
*/
|
|
117 |
void HandleError( TInt aError );
|
|
118 |
|
|
119 |
public: // from MServiceWidgetEventObserver
|
|
120 |
/**
|
|
121 |
* @param aPublisherId publisher id for Theme (it is service name).
|
|
122 |
* @param aEvent Event name (i.e. Active,Suspend,Resume,Deactivate,Selected)
|
|
123 |
*This function handles all homescreen callbacks (publisher received callback events
|
|
124 |
* from homescreen and direct them to plugin to take appropriate action.)
|
|
125 |
*/
|
|
126 |
void HandleServiceEventL(const TDesC& aPublisherId, const TDesC8& aEvent,TDesC& aInstId );
|
|
127 |
|
|
128 |
public: //From MAiPropertyExtension.
|
|
129 |
/**
|
|
130 |
* From MAiPropertyExtension.
|
|
131 |
* Read property of publisher plug-in.
|
|
132 |
*
|
|
133 |
* @param aProperty - identification of property.
|
|
134 |
* @return pointer to property value.
|
|
135 |
*/
|
|
136 |
//TAny* GetPropertyL( TInt aProperty );
|
|
137 |
|
|
138 |
/**
|
|
139 |
* From MAiPropertyExtension.
|
|
140 |
* Write property value.
|
|
141 |
*
|
|
142 |
* @param aProperty - identification of property.
|
|
143 |
* @param aValue - contains pointer to property value.
|
|
144 |
*/
|
|
145 |
//void SetPropertyL( TInt aProperty, TAny* aValue );
|
|
146 |
|
|
147 |
|
|
148 |
private: // Data members
|
|
149 |
// owns : content publishing client to hsps
|
|
150 |
CServiceWidgetContentPublisher* iContentPublisher;
|
|
151 |
// owns : list of all service ids interested in service tab
|
|
152 |
RArray<TInt> iServiceIds;
|
|
153 |
// owns : content prioritizer
|
|
154 |
RPointerArray<CServiceWidgetServiceManager> iServiceManagers;
|
|
155 |
// Not owns : A static CEikonEnv
|
|
156 |
CCoeEnv* iEnv;
|
|
157 |
// owns : a resource offset
|
|
158 |
TInt iResourceOffset;
|
|
159 |
// owns, retrive settings from cenrep store
|
|
160 |
MVIMPSTSettingsStore* iSettingsStore;
|
|
161 |
// Own: service observer
|
|
162 |
CSPNotifyChange* iSpNotifyChange;
|
|
163 |
// Information about the content publisher (this plug-in)
|
|
164 |
//TAiPublisherInfo iInfo;
|
|
165 |
};
|
|
166 |
|
|
167 |
#endif // CSERVICEWIDGETPLUGIN_H
|
|
168 |
// End of File
|