blob: 194bc3d1b3d1746f25c0f20ceed2bb31b3ea3ea5 [file] [log] [blame]
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -04001/**
Alexandre Lisionc9c30b72013-11-18 16:27:26 -05002 * Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -04003 *
4 * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * If you own a pjsip commercial license you can also redistribute it
11 * and/or modify it under the terms of the GNU Lesser General Public License
12 * as an android library.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
Alexandre Lision064e1e02013-10-01 16:18:42 -040022package org.sflphone.account;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040023
Alexandre Savard68838112012-10-30 11:34:43 -040024import java.util.ArrayList;
Alexandre Savard833616f2012-10-30 16:02:30 -040025import java.util.HashMap;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040026
27public interface AccountDetail {
28
Alexandre Lisionc9c30b72013-11-18 16:27:26 -050029 public static final String TRUE_STR = "true";
30 public static final String FALSE_STR = "false";
31
alision5de91782013-07-10 10:47:30 -040032 public static class PreferenceEntry {
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040033 public String mKey;
34 public int mLabelId;
Alexandre Savard20d0de02012-10-16 14:05:44 -040035 public boolean isTwoState;
Alexandre Savard68838112012-10-30 11:34:43 -040036 public String mValue;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040037
alision5de91782013-07-10 10:47:30 -040038 public PreferenceEntry(String key, int labelId) {
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040039 mKey = key;
40 mLabelId = labelId;
Alexandre Savard20d0de02012-10-16 14:05:44 -040041 isTwoState = false;
Alexandre Savard68838112012-10-30 11:34:43 -040042 mValue = "";
alision5de91782013-07-10 10:47:30 -040043
Alexandre Savard20d0de02012-10-16 14:05:44 -040044 }
45
alision5de91782013-07-10 10:47:30 -040046 public PreferenceEntry(String key, int labelId, boolean twoState) {
Alexandre Savard20d0de02012-10-16 14:05:44 -040047 mKey = key;
48 mLabelId = labelId;
49 isTwoState = twoState;
Alexandre Savard68838112012-10-30 11:34:43 -040050 mValue = "";
51 }
52
alision5de91782013-07-10 10:47:30 -040053 public PreferenceEntry(String key, int labelId, boolean twoState, String value) {
Alexandre Savard68838112012-10-30 11:34:43 -040054 mKey = key;
55 mLabelId = labelId;
56 isTwoState = twoState;
57 mValue = value;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040058 }
alision5de91782013-07-10 10:47:30 -040059
60 public boolean isChecked() {
61 if (mValue.contentEquals("true"))
62 return true;
63 return false;
64 }
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040065 }
66
alisiond9e29442013-04-17 16:10:18 -040067 public static final String TAG = "PreferenceHashMap";
68
Alexandre Savard68838112012-10-30 11:34:43 -040069 public ArrayList<PreferenceEntry> getDetailValues();
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040070
Alexandre Savard68838112012-10-30 11:34:43 -040071 public ArrayList<String> getValuesOnly();
72
Alexandre Savard833616f2012-10-30 16:02:30 -040073 public HashMap<String, String> getDetailsHashMap();
74
Alexandre Savard68838112012-10-30 11:34:43 -040075 public String getDetailString(String key);
76
alision5de91782013-07-10 10:47:30 -040077 public void setDetailString(String key, String newValue);
Alexandre Savard833616f2012-10-30 16:02:30 -040078
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040079}