20
|
1 |
/*
|
|
2 |
* Copyright (c) 2009-2010 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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CCAEXTENSIONFACTORY_H
|
|
19 |
#define CCAEXTENSIONFACTORY_H
|
|
20 |
|
|
21 |
#include <e32base.h>
|
|
22 |
|
|
23 |
class MCCAViewLauncher;
|
|
24 |
class MCCAStatusProvider;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* ECom interface for CCA Extension factory.
|
|
28 |
* At the moment extension factory interface is used only for extend CCA
|
|
29 |
* Status button implementation:
|
|
30 |
* - CCA Status button implementation uses this interface to launch external
|
|
31 |
* views (MCCAViewLauncher) when user tap the Status button.
|
|
32 |
* - CCA Status button implementation uses MCCAStatusProvider interface to
|
|
33 |
* read status information from plug-in if status infromation doesn't found in
|
|
34 |
* Presence Cache.
|
|
35 |
* @lib n/a
|
|
36 |
* @since 9.2
|
|
37 |
*/
|
|
38 |
class CCCAExtensionFactory : public CBase
|
|
39 |
{
|
|
40 |
public: // constructor and destructor
|
|
41 |
inline static CCCAExtensionFactory* NewL(
|
|
42 |
const TUid& aImplementationUid );
|
|
43 |
|
|
44 |
inline virtual ~CCCAExtensionFactory();
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Creates a view launcher.
|
|
48 |
* Ownership is given.
|
|
49 |
* @return View Launcher instance @see MCCAViewLauncher
|
|
50 |
*/
|
|
51 |
virtual MCCAViewLauncher* CreateViewLauncherL()
|
|
52 |
{
|
|
53 |
return NULL;
|
|
54 |
}
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Returns Service ID of the plug-in.
|
|
58 |
*/
|
|
59 |
virtual const TDesC& ServiceID() const = 0;
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Extension point for the factory
|
|
63 |
*/
|
|
64 |
virtual TAny* FactoryExtension(
|
|
65 |
TUid /*aExtensionUid*/ )
|
|
66 |
{
|
|
67 |
return NULL;
|
|
68 |
}
|
|
69 |
|
|
70 |
private: // data
|
|
71 |
|
|
72 |
// Own: ID key
|
|
73 |
TUid iDtor_ID_Key;
|
|
74 |
|
|
75 |
};
|
|
76 |
|
|
77 |
// Use this UID to access CCCAExtensionFactory's status provider creator.
|
|
78 |
// Used as a parameter to CCCAExtensionFactory::FactoryExtension method.
|
|
79 |
const TUid KCCAExtensionFactoryStatusProviderCreatorUid = { 2 };
|
|
80 |
|
|
81 |
/**
|
|
82 |
* This class is an extension to CCCAExtensionFactory.
|
|
83 |
*
|
|
84 |
* @see CCCAExtensionFactory
|
|
85 |
* @see KCCAExtensionFactoryStatusProviderCreatorUid
|
|
86 |
*/
|
|
87 |
class MCCAExtensionFactoryStatusProviderCreator
|
|
88 |
{
|
|
89 |
protected: // Destructor
|
|
90 |
virtual ~MCCAExtensionFactoryStatusProviderCreator() { }
|
|
91 |
|
|
92 |
public:
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Creates a status provider.
|
|
96 |
* Ownership is given.
|
|
97 |
* @return Status provider instance @see MCCAStatusProvider
|
|
98 |
*/
|
|
99 |
virtual MCCAStatusProvider* CreateStatusProviderL() = 0;
|
|
100 |
|
|
101 |
};
|
|
102 |
|
|
103 |
/**
|
|
104 |
* View launcher extension for the CCA.
|
|
105 |
*/
|
|
106 |
class MCCAViewLauncher
|
|
107 |
{
|
|
108 |
public:
|
|
109 |
/// virtual destructor
|
|
110 |
virtual ~MCCAViewLauncher() {};
|
|
111 |
|
|
112 |
enum TCCAView
|
|
113 |
{
|
|
114 |
/// External view for MyCard
|
|
115 |
EMyCardView = 0x0,
|
|
116 |
/// External view for contact
|
|
117 |
ECCAView = 0x1
|
|
118 |
};
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Returns a true if view launcher supports current view.
|
|
122 |
*/
|
|
123 |
virtual TBool IsViewSupported( MCCAViewLauncher::TCCAView aView ) = 0;
|
|
124 |
|
|
125 |
/**
|
|
126 |
* CCA and MyCard uses this function to launch external views.
|
|
127 |
* @param aView @see TCCAView
|
|
128 |
* @param aPackedContactLink packed link to the
|
|
129 |
* contact @see MVPbkContactLink
|
|
130 |
*/
|
|
131 |
virtual void LaunchViewL( MCCAViewLauncher::TCCAView aView,
|
|
132 |
const TDesC8* aPackedContactLink = NULL ) = 0;
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Extension point for the View Launcher
|
|
136 |
*/
|
|
137 |
virtual TAny* ViewLauncherExtension(
|
|
138 |
TUid /*aExtensionUid*/ )
|
|
139 |
{
|
|
140 |
return NULL;
|
|
141 |
}
|
|
142 |
|
|
143 |
protected:
|
|
144 |
MCCAViewLauncher() {};
|
|
145 |
|
|
146 |
};
|
|
147 |
|
|
148 |
class MCCAStatusProviderObserver;
|
|
149 |
class MVPbkContactLink;
|
|
150 |
class CGulIcon;
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Status provider extension for the CCA
|
|
154 |
*/
|
|
155 |
class MCCAStatusProvider
|
|
156 |
{
|
|
157 |
public:
|
|
158 |
/// virtual destructor
|
|
159 |
virtual ~MCCAStatusProvider() {};
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Add observer
|
|
163 |
* @param aObserver instance @see MCCAStatusProviderObserver
|
|
164 |
*/
|
|
165 |
virtual void AddObserverL(
|
|
166 |
MCCAStatusProviderObserver& aObserver ) = 0;
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Removes observer
|
|
170 |
* @param aObserver instance @see MCCAStatusProviderObserver
|
|
171 |
*/
|
|
172 |
virtual void RemoveObserver(
|
|
173 |
MCCAStatusProviderObserver& aObserver ) = 0;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* CCA fetch status information for the Status button with this method
|
|
177 |
* if status information is not found from Presence Cache
|
|
178 |
* @param aLink
|
|
179 |
* @param aText Status Text, ownership is transfered
|
|
180 |
* @param aIcon Status Icon, ownership is transfered
|
|
181 |
*/
|
|
182 |
virtual void GetStatusInformationL(
|
|
183 |
const MVPbkContactLink& aLink,
|
|
184 |
HBufC*& aText,
|
|
185 |
CGulIcon*& aIcon ) = 0;
|
|
186 |
|
|
187 |
/**
|
|
188 |
* CCA fetch status information for the Status button with this method
|
|
189 |
* if status information is not found from Presence Cache
|
|
190 |
* This function is used only for fetching My card status information
|
|
191 |
* @param aLink
|
|
192 |
* @param aText Status Text, ownership is transfered
|
|
193 |
* @param aIcon Status Icon, ownership is transfered
|
|
194 |
*/
|
|
195 |
virtual void GetMyCardStatusInformationL(
|
|
196 |
const MVPbkContactLink& aLink,
|
|
197 |
HBufC*& aText,
|
|
198 |
CGulIcon*& aIcon ) = 0;
|
|
199 |
|
|
200 |
/**
|
|
201 |
* Extension point for the status provider
|
|
202 |
*/
|
|
203 |
virtual TAny* StatusProviderExtension(
|
|
204 |
TUid /*aExtensionUid*/ )
|
|
205 |
{
|
|
206 |
return NULL;
|
|
207 |
}
|
|
208 |
|
|
209 |
protected:
|
|
210 |
MCCAStatusProvider() {};
|
|
211 |
|
|
212 |
};
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Interface to observe content changes
|
|
216 |
*/
|
|
217 |
class MCCAStatusProviderObserver
|
|
218 |
{
|
|
219 |
public:
|
|
220 |
/**
|
|
221 |
* Event types
|
|
222 |
*/
|
|
223 |
enum TCCAStatusProviderObserverEvent
|
|
224 |
{
|
|
225 |
/// Status is changed and CCA should fetch status information again
|
|
226 |
EStatusChanged = 0x0
|
|
227 |
};
|
|
228 |
|
|
229 |
/**
|
|
230 |
* Plug-in can notify CCA about status events
|
|
231 |
* @param aEvent Type of the event
|
|
232 |
* @param aLink Contact which the event is about
|
|
233 |
*/
|
|
234 |
virtual void StatusEvent(
|
|
235 |
MCCAStatusProviderObserver::TCCAStatusProviderObserverEvent aEvent,
|
|
236 |
const MVPbkContactLink* aLink = NULL ) = 0;
|
|
237 |
|
|
238 |
/**
|
|
239 |
* Extension point for the MCCAStatusProviderObserver
|
|
240 |
*/
|
|
241 |
virtual TAny* StatusProviderObserverExtension(
|
|
242 |
TUid /*aExtensionUid*/ )
|
|
243 |
{
|
|
244 |
return NULL;
|
|
245 |
}
|
|
246 |
|
|
247 |
protected:
|
|
248 |
MCCAStatusProviderObserver(){};
|
|
249 |
virtual ~MCCAStatusProviderObserver() {};
|
|
250 |
|
|
251 |
};
|
|
252 |
|
|
253 |
|
|
254 |
#include "ccaextensionfactory.inl"
|
|
255 |
|
|
256 |
#endif // CCAEXTENSIONFACTORY_H
|