114
|
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: The API supports item information that is not supported by
|
|
15 |
* the MCS server itself
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef __MENUSRVENGUTILS_H__
|
|
20 |
#define __MENUSRVENGUTILS_H__
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <apgcli.h>
|
|
24 |
#include <w32std.h>
|
|
25 |
#include <widgetregistryclient.h>
|
|
26 |
#include "menuengobject.h"
|
|
27 |
#include "menueng.h"
|
|
28 |
#include "menusrvtypefilters.h"
|
|
29 |
#include "menusrvappattributes.h"
|
|
30 |
|
|
31 |
|
|
32 |
/// Number of characters in UID and in MMC-id strings.
|
|
33 |
const TInt KUidChars = 10;
|
|
34 |
const TInt KUidLegacyChars = 8;
|
|
35 |
|
|
36 |
class TApaAppInfo;
|
|
37 |
class CMcsSatHandler;
|
|
38 |
|
|
39 |
NONSHARABLE_CLASS( CMenuSrvEngUtils ) : public CBase
|
|
40 |
{
|
|
41 |
public:
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Enum indicating application DRM protection.
|
|
45 |
*/
|
|
46 |
enum TDRMProtectionInfo
|
|
47 |
{
|
|
48 |
EDRMUnknownProtection,
|
|
49 |
EDRMNotProtected,
|
|
50 |
EDRMProtected,
|
|
51 |
EDRMRightsExpired
|
|
52 |
};
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Two-phased constructor.
|
|
56 |
* @param aEng menu engine.
|
|
57 |
*/
|
|
58 |
static CMenuSrvEngUtils* NewL( CMenuEng& aEng );
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Destructor.
|
|
62 |
*/
|
|
63 |
virtual ~CMenuSrvEngUtils();
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Gets app uid based on engine object.
|
|
67 |
* @param aEngObj engine object.
|
|
68 |
* @param aAppUid app uid.
|
|
69 |
* @return error code.
|
|
70 |
*/
|
|
71 |
static TInt GetAppUid( const CMenuEngObject& aEngObj, TUid& aAppUid );
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Gets app info based on engine object.
|
|
75 |
* @param aEngObj engine object.
|
|
76 |
* @param aAppInfo app uid.
|
|
77 |
* @return error code.
|
|
78 |
*/
|
|
79 |
TInt GetAppInfoL( const CMenuEngObject& aEngObj, TApaAppInfo& aAppInfo ) const;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Gets app DRM protection for given item id.
|
|
83 |
* @param aItemId item id.
|
|
84 |
* @param aProtectionInfo app DRM protection info.
|
|
85 |
* @return error code.
|
|
86 |
*/
|
|
87 |
TInt GetDrmProtectionL( TInt aItemId,
|
|
88 |
TDRMProtectionInfo& aProtectionInfo ) const;
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Gets Java app content id.
|
|
92 |
* @param aUid app uid.
|
|
93 |
* @param aContentId content id.
|
|
94 |
* @return error code.
|
|
95 |
*/
|
|
96 |
void GetJavaContentIdL( TUid aUid, TDes& aContentId ) const;
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Reloads app items.
|
|
100 |
*/
|
|
101 |
void ReloadApaItemsL();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Checks if application is midlet.
|
|
105 |
* @param aAppUid app uid.
|
|
106 |
* @return ETrue if app is a midlet.
|
|
107 |
*/
|
|
108 |
TBool IsMiddlet( const TUid aAppUid ) const;
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Checks wether application is native
|
|
112 |
* @param aAppUid applications uid
|
|
113 |
* @param aIsNative ETrue if apppication is native
|
|
114 |
* @return KErrNone if successful, otherwise one of the other system-wide error codes
|
|
115 |
*/
|
|
116 |
TInt IsNativeL( TUid aAppUid, TBool& aIsNative );
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Gets app items list.
|
|
120 |
* @return app items list.
|
|
121 |
*/
|
|
122 |
RPointerArray<CMenuSrvAppAttributes>& GetAppItemsL();
|
|
123 |
|
|
124 |
private:
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Get app info from array
|
|
128 |
* @param aAppInfo with application uid to fetch rest information
|
|
129 |
* @return KErrNone if successful,
|
|
130 |
* otherwise one of the other system-wide error codes
|
|
131 |
*/
|
|
132 |
TInt GetAppInfoFromArrayL( TApaAppInfo& aAppInfo ) const;
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Get app type from array
|
|
136 |
* @param aAppUid with application uid to fetch rest information
|
|
137 |
* @param aType app type
|
|
138 |
* @return KErrNone if successful,
|
|
139 |
* otherwise one of the other system-wide error codes
|
|
140 |
*/
|
|
141 |
TInt GetAppTypeFromArrayL( const TUid& aAppUid,
|
|
142 |
CMenuEngObject::TAppType& aType ) const;
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Gets app DRM protection for given app uid.
|
|
146 |
* @param aAppUid app uid.
|
|
147 |
* @param aProtectionInfo app DRM protection info.
|
|
148 |
* @return error code.
|
|
149 |
*/
|
|
150 |
TInt GetDrmProtectionL(
|
|
151 |
const TUid aAppUid,
|
|
152 |
TDRMProtectionInfo& aProtectionInfo ) const;
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Gets app DRM protection based on engine object.
|
|
156 |
* @param aEngObj engine object.
|
|
157 |
* @param aProtectionInfo app DRM protection info.
|
|
158 |
* @return error code.
|
|
159 |
*/
|
|
160 |
TInt GetDrmProtectionL( const CMenuEngObject& aEngObj,
|
|
161 |
TDRMProtectionInfo& aProtectionInfo ) const;
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Gets SAT app info.
|
|
165 |
* @param aAppInfo app info.
|
|
166 |
* @return error code.
|
|
167 |
*/
|
|
168 |
TInt GetSatAppInfo( TApaAppInfo& aAppInfo ) const;
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Constructor.
|
|
172 |
* @param aEng menu engine.
|
|
173 |
*/
|
|
174 |
CMenuSrvEngUtils( CMenuEng& aEng );
|
|
175 |
|
|
176 |
/**
|
|
177 |
* Second phased constructor.
|
|
178 |
*/
|
|
179 |
void ConstructL();
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Drm protection info.
|
|
183 |
* @param aConstenId content id.
|
|
184 |
* @param aProtectionInfo DRM protection info.
|
|
185 |
* @return error code.
|
|
186 |
*/
|
|
187 |
TInt GetDrmProtectionByContentIdL(
|
|
188 |
const TDesC& aConstenId,
|
|
189 |
TDRMProtectionInfo& aProtectionInfo )const;
|
|
190 |
|
|
191 |
private: // Data
|
|
192 |
|
|
193 |
CMcsSatHandler* iSatHandler; ///< Sat handler. Own.
|
|
194 |
|
|
195 |
CMenuEng& iEng; ///< Engine. Not own.
|
|
196 |
|
|
197 |
RApaLsSession iApaLsSession; ///< ApaLs session. Own.
|
|
198 |
|
|
199 |
RWidgetRegistryClientSession iWidgetSession; ///< Widget session. Own.
|
|
200 |
|
|
201 |
RWsSession iWsSession; ///< Ws session. Own.
|
|
202 |
|
|
203 |
RPointerArray<CMenuSrvAppAttributes> iAppAttributes; ///< App array. Own.
|
|
204 |
|
|
205 |
};
|
|
206 |
|
|
207 |
/**********************************************
|
|
208 |
* Static utility functions.
|
|
209 |
*/
|
|
210 |
NONSHARABLE_CLASS( MenuSrvUtil )
|
|
211 |
{
|
|
212 |
|
|
213 |
public:
|
|
214 |
|
|
215 |
/**
|
|
216 |
* Converts given uid to string.
|
|
217 |
* @param aUid app uid.
|
|
218 |
* @param aResult descriptor with result.
|
|
219 |
* @param aLegacy legacy format.
|
|
220 |
* @param aRadix radix.
|
|
221 |
* @return error code.
|
|
222 |
*/
|
|
223 |
static void UidToStringL( TUint aUid,
|
|
224 |
TDes& aResult,
|
|
225 |
TBool aLegacy,
|
|
226 |
TRadix aRadix );
|
|
227 |
};
|
|
228 |
|
|
229 |
#endif // __MENUSRVENGUTILS_H__
|