|
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 #include "javaapplicationsettings.h" |
|
18 |
|
19 JavaApplicationSettings::JavaApplicationSettings() |
|
20 { |
|
21 iId = 0; |
|
22 iName = ""; |
|
23 iCurrentValue = 0; |
|
24 iColumnName = L""; |
|
25 iTableName = ""; |
|
26 iFilterColumnName = L""; |
|
27 iFilterColumnValue = L""; |
|
28 } |
|
29 |
|
30 JavaApplicationSettings::JavaApplicationSettings(const QString& aName, const QStringList& aValues): |
|
31 iValues(aValues) |
|
32 { |
|
33 iName = aName; |
|
34 iId = 0; |
|
35 iCurrentValue = 0; |
|
36 iColumnName = L""; |
|
37 iTableName = ""; |
|
38 iFilterColumnName = L""; |
|
39 iFilterColumnValue = L""; |
|
40 } |
|
41 |
|
42 JavaApplicationSettings::JavaApplicationSettings(const QString& aName, const QStringList& aValues, const std::wstring& aColumnName, const std::string& aTableName, const std::vector<std::wstring>& aStorageValues): |
|
43 iValues(aValues) |
|
44 { |
|
45 iName = aName; |
|
46 iId = 0; |
|
47 iCurrentValue = 0; |
|
48 iColumnName = aColumnName; |
|
49 iTableName = aTableName; |
|
50 iStorageValues = aStorageValues; |
|
51 iFilterColumnName = L""; |
|
52 iFilterColumnValue = L""; |
|
53 } |
|
54 |
|
55 JavaApplicationSettings::JavaApplicationSettings(const QString& aName, const QStringList& aValues, const std::wstring& aColumnName, const std::string& aTableName, const std::vector<std::wstring>& aStorageValues, const std::wstring& aFilterColumnName, const std::wstring& aFilterColumnValue): |
|
56 iValues(aValues) |
|
57 { |
|
58 iName = aName; |
|
59 iId = 0; |
|
60 iCurrentValue = 0; |
|
61 iColumnName = aColumnName; |
|
62 iTableName = aTableName; |
|
63 iStorageValues = aStorageValues; |
|
64 iFilterColumnName = aFilterColumnName; |
|
65 iFilterColumnValue = aFilterColumnValue; |
|
66 } |
|
67 |
|
68 void JavaApplicationSettings::setCurrentValue(int aCurrentValue) |
|
69 { |
|
70 iCurrentValue = aCurrentValue; |
|
71 } |
|
72 |
|
73 int JavaApplicationSettings::getCurrentValue() |
|
74 { |
|
75 return iCurrentValue; |
|
76 } |
|
77 |
|
78 const QString& JavaApplicationSettings::getValue(int aValueIndex) |
|
79 { |
|
80 static const QString null; |
|
81 if (aValueIndex >= 0 && aValueIndex < iValues.size()) |
|
82 return iValues[aValueIndex]; |
|
83 return null; |
|
84 } |
|
85 |
|
86 int JavaApplicationSettings::getValue(const QString& aValue) |
|
87 { |
|
88 int value = -1; |
|
89 for (int i = 0; i < iValues.size(); i++) |
|
90 { |
|
91 if (iValues[i] == aValue) |
|
92 { |
|
93 return i; |
|
94 } |
|
95 } |
|
96 return value; |
|
97 } |
|
98 |
|
99 void JavaApplicationSettings::setId(HbDataFormModelItem * aId) |
|
100 { |
|
101 iId = aId; |
|
102 } |
|
103 |
|
104 const HbDataFormModelItem * JavaApplicationSettings::getId() |
|
105 { |
|
106 return iId; |
|
107 } |
|
108 |
|
109 const QString& JavaApplicationSettings::getName() const |
|
110 { |
|
111 return iName; |
|
112 } |
|
113 |
|
114 const QStringList& JavaApplicationSettings::getValues() const |
|
115 { |
|
116 return iValues; |
|
117 } |
|
118 |
|
119 const QList<JavaApplicationSettings*>& JavaApplicationSettings::getHighRiskList() const |
|
120 { |
|
121 return iHighRiskList; |
|
122 } |
|
123 |
|
124 void JavaApplicationSettings::setHighRiskList(const QList<JavaApplicationSettings*>& aHighRiskList) |
|
125 { |
|
126 iHighRiskList = aHighRiskList; |
|
127 } |
|
128 |
|
129 const QList<JavaApplicationSettings*>& JavaApplicationSettings::getMutuallyExclusiveList() const |
|
130 { |
|
131 return iMutuallyExclusiveList; |
|
132 } |
|
133 |
|
134 void JavaApplicationSettings::setMutuallyExclusiveList(const QList<JavaApplicationSettings*>& aMutuallyExclusiveList) |
|
135 { |
|
136 iMutuallyExclusiveList = aMutuallyExclusiveList; |
|
137 } |
|
138 |
|
139 const std::wstring& JavaApplicationSettings::getColumnName() |
|
140 { |
|
141 return iColumnName; |
|
142 } |
|
143 |
|
144 const std::string& JavaApplicationSettings::getTableName() |
|
145 { |
|
146 return iTableName; |
|
147 } |
|
148 |
|
149 const std::vector<std::wstring>& JavaApplicationSettings::getStorageValues() |
|
150 { |
|
151 return iStorageValues; |
|
152 } |
|
153 |
|
154 const std::wstring& JavaApplicationSettings::getFilterColumnName() |
|
155 { |
|
156 return iFilterColumnName; |
|
157 } |
|
158 |
|
159 const std::wstring& JavaApplicationSettings::getFilterColumnValue() |
|
160 { |
|
161 return iFilterColumnValue; |
|
162 } |