26
|
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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef APPMNGR2MIDLETSETTINGSUTIL_H
|
|
20 |
#define APPMNGR2MIDLETSETTINGSUTIL_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <string>
|
|
25 |
#include <vector>
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
// CONSTANTS
|
|
29 |
const int INTERACTION_MODE_DENIED = 1;
|
|
30 |
const int INTERACTION_MODE_BLANKET = 2;
|
|
31 |
const int INTERACTION_MODE_SESSION = 4;
|
|
32 |
const int INTERACTION_MODE_ONESHOT = 8;
|
|
33 |
|
|
34 |
// interaction modes display indexes
|
|
35 |
const int DENIED_INTERACTION_MODE_DISPLAY_INDEX = 0;
|
|
36 |
const int ONESHOT_INTERACTION_MODE_DISPLAY_INDEX = 1;
|
|
37 |
const int SESSION_INTERACTION_MODE_DISPLAY_INDEX = 2;
|
|
38 |
const int BLANKET_INTERACTION_MODE_DISPLAY_INDEX = 3;
|
|
39 |
|
|
40 |
// on screen keypad values display indexes
|
|
41 |
const int ON_SCREEN_KEYPAD_VALUE_NO_DISPLAY_INDEX = 0;
|
|
42 |
const int ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS_DISPLAY_INDEX = 1;
|
|
43 |
const int ON_SCREEN_KEYPAD_VALUE_NAVIGATION_DISPLAY_INDEX = 2;
|
|
44 |
|
|
45 |
// security warnings values display indexes
|
|
46 |
const int SECURITY_WARNINGS_DEFAULT_MODE_DISPLAY_INDEX = 0;
|
|
47 |
const int SECURITY_WARNINGS_USER_DEFINED_MODE_DISPLAY_INDEX = 1;
|
|
48 |
|
|
49 |
// settings display indexes
|
|
50 |
const int ON_SCREEN_KEYPAD_SETTINGS_DISPLAY_INDEX = 0;
|
|
51 |
const int SECURITY_WARNINGS_SETTINGS_DISPLAY_INDEX = 1;
|
|
52 |
const int NET_ACCESS_SETTINGS_DISPLAY_INDEX = 2;
|
|
53 |
const int LOW_LEVEL_NET_ACCESS_SETTINGS_DISPLAY_INDEX = 3;
|
|
54 |
const int CALL_CONTROL_SETTINGS_DISPLAY_INDEX = 4;
|
|
55 |
const int MESSAGING_SETTINGS_DISPLAY_INDEX = 5;
|
|
56 |
const int RESTRICTED_MESSAGING_SETTINGS_DISPLAY_INDEX = 6;
|
|
57 |
const int APPLICATION_AUTO_INVOCATION_SETTINGS_DISPLAY_INDEX = 7;
|
|
58 |
const int LOCAL_CONNECTIVITY_SETTINGS_DISPLAY_INDEX = 8;
|
|
59 |
const int MULTIMEDIA_RECORDING_SETTINGS_DISPLAY_INDEX = 9;
|
|
60 |
const int READ_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 10;
|
|
61 |
const int WRITE_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 11;
|
|
62 |
const int LOCATION_SETTINGS_DISPLAY_INDEX = 12;
|
|
63 |
const int LANDMARK_SETTINGS_DISPLAY_INDEX = 13;
|
|
64 |
const int AUTHENTICATION_SETTINGS_DISPLAY_INDEX = 14;
|
|
65 |
const int SMART_CARD_COMMUNICATION_SETTINGS_DISPLAY_INDEX = 15;
|
|
66 |
const int BROADCAST_SETTINGS_DISPLAY_INDEX = 16;
|
|
67 |
const int NFC_WRITE_ACCESS_SETTINGS_DISPLAY_INDEX = 17;
|
|
68 |
const int URL_START_SETTINGS_DISPLAY_INDEX = 18;
|
|
69 |
const int LAST_SETTINGS_DISPLAY_INDEX = 19;
|
|
70 |
|
|
71 |
// CLASS DECLARATION
|
|
72 |
class MidletSuiteSecuritySettings: public CBase
|
|
73 |
{
|
|
74 |
public:
|
|
75 |
MidletSuiteSecuritySettings(const std::wstring& aSettingsName,
|
|
76 |
const std::wstring& aCurrentInteractionMode,
|
|
77 |
const std::wstring& aAllowedInteractionModes);
|
|
78 |
|
|
79 |
MidletSuiteSecuritySettings &operator=(const MidletSuiteSecuritySettings&);
|
|
80 |
|
|
81 |
MidletSuiteSecuritySettings(const MidletSuiteSecuritySettings&);
|
|
82 |
|
|
83 |
MidletSuiteSecuritySettings();
|
|
84 |
|
|
85 |
const std::wstring getName() const;
|
|
86 |
const std::wstring getCurrentInteractionMode() const;
|
|
87 |
const std::wstring getAllowedInteractionModes() const;
|
|
88 |
|
|
89 |
private:
|
|
90 |
std::wstring iSettingsName;
|
|
91 |
std::wstring iCurrentInteractionMode;
|
|
92 |
std::wstring iAllowedInteractionModes;
|
|
93 |
};
|
|
94 |
|
|
95 |
class LocalizedString: public CBase
|
|
96 |
{
|
|
97 |
public:
|
|
98 |
LocalizedString(const std::wstring& aId,
|
|
99 |
const std::wstring& aValue);
|
|
100 |
|
|
101 |
LocalizedString(const std::wstring& aId,
|
|
102 |
const std::wstring& aValue,
|
|
103 |
int aIndex);
|
|
104 |
|
|
105 |
LocalizedString(TUint aId,
|
|
106 |
const std::wstring& aValue);
|
|
107 |
|
|
108 |
LocalizedString &operator=(const LocalizedString&);
|
|
109 |
|
|
110 |
LocalizedString(const LocalizedString&);
|
|
111 |
|
|
112 |
LocalizedString();
|
|
113 |
|
|
114 |
const std::wstring& getId() const;
|
|
115 |
const std::wstring& getValue() const;
|
|
116 |
int getIndex() const;
|
|
117 |
|
|
118 |
private:
|
|
119 |
std::wstring iId;
|
|
120 |
std::wstring iValue;
|
|
121 |
int iIndex;
|
|
122 |
};
|
|
123 |
|
|
124 |
class ListItem: public CBase
|
|
125 |
{
|
|
126 |
public:
|
|
127 |
ListItem(const LocalizedString& aName,
|
|
128 |
const std::vector<LocalizedString>& aPossibleValues);
|
|
129 |
|
|
130 |
ListItem(const LocalizedString& aName,
|
|
131 |
const std::vector<LocalizedString>& aPossibleValues,
|
|
132 |
bool aEnabled);
|
|
133 |
|
|
134 |
ListItem(const LocalizedString& aName,
|
|
135 |
const std::vector<LocalizedString>& aPossibleValues,
|
|
136 |
bool aEnabled,
|
|
137 |
int aCurrentValueIndex);
|
|
138 |
|
|
139 |
ListItem(const LocalizedString& aName,
|
|
140 |
const std::vector<LocalizedString>& aPossibleValues,
|
|
141 |
bool aEnabled,
|
|
142 |
int aCurrentValueIndex,
|
|
143 |
int aIndex);
|
|
144 |
|
|
145 |
ListItem &operator=(const ListItem&);
|
|
146 |
|
|
147 |
ListItem(const ListItem&);
|
|
148 |
|
|
149 |
ListItem();
|
|
150 |
|
|
151 |
void setCurrentValue(int aSelectedValueIndex);
|
|
152 |
int getCurrentValue() const;
|
|
153 |
|
|
154 |
const LocalizedString& getName() const;
|
|
155 |
const std::vector<LocalizedString>& getValues() const;
|
|
156 |
const LocalizedString& getValue() const;
|
|
157 |
const LocalizedString& getValue(int aValueIndex) const;
|
|
158 |
bool getEnabled() const;
|
|
159 |
void setEnabled(bool aEnabled);
|
|
160 |
int getIndex() const;
|
|
161 |
|
|
162 |
private:
|
|
163 |
LocalizedString iName;
|
|
164 |
std::vector<LocalizedString> iPossibleValues;
|
|
165 |
int iCurrentValueIndex;
|
|
166 |
bool iEnabled;
|
|
167 |
int iIndex;
|
|
168 |
};
|
|
169 |
|
|
170 |
/**
|
|
171 |
* CAppMngr2SuiteSnapItem
|
|
172 |
*
|
|
173 |
*/
|
|
174 |
class CAppMngr2SuiteSnapItem: public CBase
|
|
175 |
{
|
|
176 |
public:
|
|
177 |
CAppMngr2SuiteSnapItem();
|
|
178 |
CAppMngr2SuiteSnapItem(const CAppMngr2SuiteSnapItem&);
|
|
179 |
|
|
180 |
TUint32 iId;
|
|
181 |
std::wstring iName;
|
|
182 |
};
|
|
183 |
|
|
184 |
// CLASS DECLARATION
|
|
185 |
|
|
186 |
class AppMngr2MidletSettingsUtil
|
|
187 |
{
|
|
188 |
public:
|
|
189 |
struct AscendingListItemSort
|
|
190 |
{
|
|
191 |
bool operator()(const ListItem& i1, const ListItem& i2)
|
|
192 |
{
|
|
193 |
return i1.getIndex() < i2.getIndex();
|
|
194 |
}
|
|
195 |
};
|
|
196 |
struct AscendingLocalizedStringSort
|
|
197 |
{
|
|
198 |
bool operator()(const LocalizedString& i1, const LocalizedString& i2)
|
|
199 |
{
|
|
200 |
return i1.getIndex() < i2.getIndex();
|
|
201 |
}
|
|
202 |
};
|
|
203 |
|
|
204 |
static const ListItem SettingsToListItem(MidletSuiteSecuritySettings aSettings, bool aSettingsEnabled);
|
|
205 |
static const MidletSuiteSecuritySettings ListItemToSettings(const ListItem& aListItem);
|
|
206 |
static const ListItem OnScreenKeypadToListItem(std::wstring aOnScreenKeypadValue, bool aOnScreenKeypadEnabled);
|
|
207 |
static const ListItem SnapToListItem(CAppMngr2SuiteSnapItem aSnap, bool aSnapEnabled);
|
|
208 |
static const ListItem SecurityWarningsModeToListItem(std::wstring aSecurityWarningsModeValue, bool aSecurityWarningsModeEnabled);
|
|
209 |
static TInt GetLocalizedSettingsName(std::wstring aSettingsName);
|
|
210 |
|
|
211 |
private:
|
|
212 |
static const std::wstring getLocalizedSettingsName(std::wstring aSettingsName);
|
|
213 |
static HBufC* getLocalizedSettingsNameLC(std::wstring aSettingsName);
|
|
214 |
static const std::wstring getLocalizedSettingsInteractionMode(int aInteractionMode);
|
|
215 |
static const std::wstring getLocalizedOnScreenKeypadValue(std::wstring aOnScreenKeypadValue);
|
|
216 |
static const std::wstring getLocalizedSecurityWarningsModeValue(std::wstring aSecurityWarningsModeValue);
|
|
217 |
static int getSettingsDisplayIndex(std::wstring aSettingsName);
|
|
218 |
static int findItem(std::vector<LocalizedString> aListItems, std::wstring aListItemId);
|
|
219 |
|
|
220 |
};
|
|
221 |
|
|
222 |
#endif // APPMNGR2MIDLETSETTINGSUTIL_H
|
|
223 |
|
|
224 |
|
|
225 |
// End of file
|