blob: 3678a0b6cb0d819e41c4f51d2110ca1135155db8 [file] [log] [blame]
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -04001/**
2 * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
3 *
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
alision5de91782013-07-10 10:47:30 -040029 public static class PreferenceEntry {
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040030 public String mKey;
31 public int mLabelId;
Alexandre Savard20d0de02012-10-16 14:05:44 -040032 public boolean isTwoState;
Alexandre Savard68838112012-10-30 11:34:43 -040033 public String mValue;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040034
alision5de91782013-07-10 10:47:30 -040035 public PreferenceEntry(String key, int labelId) {
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040036 mKey = key;
37 mLabelId = labelId;
Alexandre Savard20d0de02012-10-16 14:05:44 -040038 isTwoState = false;
Alexandre Savard68838112012-10-30 11:34:43 -040039 mValue = "";
alision5de91782013-07-10 10:47:30 -040040
Alexandre Savard20d0de02012-10-16 14:05:44 -040041 }
42
alision5de91782013-07-10 10:47:30 -040043 public PreferenceEntry(String key, int labelId, boolean twoState) {
Alexandre Savard20d0de02012-10-16 14:05:44 -040044 mKey = key;
45 mLabelId = labelId;
46 isTwoState = twoState;
Alexandre Savard68838112012-10-30 11:34:43 -040047 mValue = "";
48 }
49
alision5de91782013-07-10 10:47:30 -040050 public PreferenceEntry(String key, int labelId, boolean twoState, String value) {
Alexandre Savard68838112012-10-30 11:34:43 -040051 mKey = key;
52 mLabelId = labelId;
53 isTwoState = twoState;
54 mValue = value;
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040055 }
alision5de91782013-07-10 10:47:30 -040056
57 public boolean isChecked() {
58 if (mValue.contentEquals("true"))
59 return true;
60 return false;
61 }
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040062 }
63
alisiond9e29442013-04-17 16:10:18 -040064 public static final String TAG = "PreferenceHashMap";
65
Alexandre Savard68838112012-10-30 11:34:43 -040066 public ArrayList<PreferenceEntry> getDetailValues();
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040067
Alexandre Savard68838112012-10-30 11:34:43 -040068 public ArrayList<String> getValuesOnly();
69
Alexandre Savard833616f2012-10-30 16:02:30 -040070 public HashMap<String, String> getDetailsHashMap();
71
Alexandre Savard68838112012-10-30 11:34:43 -040072 public String getDetailString(String key);
73
alision5de91782013-07-10 10:47:30 -040074 public void setDetailString(String key, String newValue);
Alexandre Savard833616f2012-10-30 16:02:30 -040075
Alexandre Savardf7f9e0b2012-10-15 17:24:07 -040076}