|
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: Defines class for handling SNAP selection and read/write functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef APPMNGR2MIDLETSETTINGSHANDLER_H |
|
20 #define APPMNGR2MIDLETSETTINGSHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <vector> |
|
24 #include <string> |
|
25 #include <memory> |
|
26 |
|
27 #include "javastorage.h" |
|
28 #include "javauid.h" // Uid. |
|
29 #include "appmngr2midletsettingsutil.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 // CONSTANTS |
|
33 |
|
34 // CLASS DECLARATION |
|
35 class CAppMngr2MidletResourceHandler; |
|
36 |
|
37 /** |
|
38 * CAppMngr2MidletSettingsHandler |
|
39 * |
|
40 * CAppMngr2MidletSettingsHandler is used for getting/setting midlet suite settings |
|
41 * (access point, on screen keypad and permissions) |
|
42 * |
|
43 * @since S60 v9.2 |
|
44 * |
|
45 */ |
|
46 class CAppMngr2MidletSettingsHandler : public CBase |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CAppMngr2MidletSettingsHandler* NewL(const TDesC& aMidletSuiteName,TUid aMidletSuiteUid, CAppMngr2MidletResourceHandler& aResourceHandler); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CAppMngr2MidletSettingsHandler(); |
|
59 |
|
60 private: |
|
61 /** |
|
62 * C++ default constructor. |
|
63 */ |
|
64 CAppMngr2MidletSettingsHandler(CAppMngr2MidletResourceHandler& aResourceHandler); |
|
65 |
|
66 /** |
|
67 * By default Symbian 2nd phase constructor is private. |
|
68 */ |
|
69 void ConstructL(const TDesC& aMidletSuiteName,TUid aMidletSuiteUid); |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Gets destination network info. |
|
75 * @return Destination network name and id |
|
76 */ |
|
77 CAppMngr2SuiteSnapItem* GetSnapL(); |
|
78 |
|
79 /** |
|
80 * Set destination network to store. |
|
81 * @param aItem Includes destination network name and id |
|
82 */ |
|
83 void SetSnapL(const CAppMngr2SuiteSnapItem& aItem); |
|
84 |
|
85 /** |
|
86 * Gets on-screen keyboard custom attribute for the selected MIDlet |
|
87 * @return Value of the on-screen attribute (ON_SCREEN_KEYPAD_VALUE_NO, |
|
88 * ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS, or |
|
89 * ON_SCREEN_KEYPAD_VALUE_NAVIGATION) |
|
90 * @see appmngr2midletconstants.h |
|
91 */ |
|
92 const std::wstring GetOnScreenKeypadValueL(); |
|
93 |
|
94 /** |
|
95 * Sets on-screen keyboard custom attribute for the selected MIDlet |
|
96 * @param aValue Value of the on-screen attribute (ON_SCREEN_KEYPAD_VALUE_NO, |
|
97 * ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS, or |
|
98 * ON_SCREEN_KEYPAD_VALUE_NAVIGATION) |
|
99 * @return KErrNone or KErrNotFound |
|
100 * @see appmngr2midletconstants.h |
|
101 */ |
|
102 int SetOnScreenKeypadValueL(const std::wstring& aValue); |
|
103 |
|
104 /** |
|
105 * Checks if the on-screen keyboard custom attribute was defined by |
|
106 * the selected MIDlet JAD |
|
107 * |
|
108 * @return true if the MIdlet suite defines the on-screen keyboard |
|
109 * attribute, false otherwise |
|
110 */ |
|
111 bool OnScreenKeypadValuePreDefinedL(); |
|
112 |
|
113 /** |
|
114 * Gets security domain category |
|
115 * @return One of the values: |
|
116 * ApplicationInfo::MANUFACTURER_DOMAIN |
|
117 * ApplicationInfo::IDENTIFIED_THIRD_PARTY_DOMAIN |
|
118 * ApplicationInfo::OPERATOR_DOMAIN |
|
119 * ApplicationInfo::UNIDENTIFIED_THIRD_PARTY_DOMAIN |
|
120 */ |
|
121 const std::wstring GetSecurityDomainCategory(); |
|
122 |
|
123 /** |
|
124 * Gets security domain name |
|
125 */ |
|
126 const std::wstring GetSecurityDomainName(); |
|
127 |
|
128 /** |
|
129 * Gets security warnings mode value |
|
130 * @return One of the values (defined in securitystoragedatadefs.h): |
|
131 * SECURITY_WARNINGS_USER_DEFINED_MODE |
|
132 * SECURITY_WARNINGS_DEFAULT_MODE |
|
133 */ |
|
134 const std::wstring GetSecurityWarningsMode(); |
|
135 |
|
136 /** |
|
137 * Sets security warnings mode value |
|
138 * @param aSecurityWarningsMode One of the values (defined in securitystoragedatadefs.h): |
|
139 * SECURITY_WARNINGS_USER_DEFINED_MODE |
|
140 * SECURITY_WARNINGS_DEFAULT_MODE |
|
141 */ |
|
142 int SetSecurityWarningsMode(const std::wstring& aSecurityWarningsMode); |
|
143 |
|
144 /** |
|
145 * Retrieves all the security settings (function groups and their settings) |
|
146 */ |
|
147 void GetSecuritySettings(std::vector<MidletSuiteSecuritySettings>& aMidletSuiteSecuritySettings); |
|
148 |
|
149 /** |
|
150 * Stores the settings for a single function group |
|
151 * @param aSettingsName Identifier of the function group |
|
152 * @param aCurrentInteractionMode the settings for the function group |
|
153 */ |
|
154 int SetSecuritySettings(const std::wstring& aSettingsName, const std::wstring& aCurrentInteractionMode); |
|
155 |
|
156 /** |
|
157 * Sets the flag which indicates if the security prompt was shown in blanket mode |
|
158 * (this is related to the definition of blanket, as an interaction mode which guarantes a single prompt) |
|
159 * @param aSettingsName Identifier of the function group |
|
160 * @param aPromptFlag the flag which indicates if the |
|
161 * security prompt was shown in blanket mode |
|
162 */ |
|
163 int SetUserSecuritySettingsPromptFlag(const std::wstring& aSettingsName, bool aPromptFlag); |
|
164 |
|
165 private: |
|
166 |
|
167 void findColumn(const java::storage::JavaStorageApplicationEntry_t& aEntry, const std::wstring& aColName, std::wstring& aColValue); |
|
168 void findEntry(const java::storage::JavaStorageApplicationList_t&, const std::wstring&, std::wstring& eValue); |
|
169 |
|
170 private: |
|
171 |
|
172 std::auto_ptr<java::storage::JavaStorage> iStorage; |
|
173 HBufC* iMidletSuiteName; |
|
174 /** |
|
175 * MIDlet suite UID |
|
176 */ |
|
177 java::util::Uid iMidletSuiteUid; |
|
178 CAppMngr2MidletResourceHandler& iResourceHandler; |
|
179 }; |
|
180 |
|
181 #endif // APPMNGR2MIDLETSETTINGSHANDLER_H |
|
182 |
|
183 |
|
184 // End of file |