Adrien BĂ©raud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame^] | 1 | /** |
| 2 | * Copyright (C) 2004-2014 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 | */ |
| 22 | package cx.ring.model.account; |
| 23 | |
| 24 | import java.util.ArrayList; |
| 25 | import java.util.HashMap; |
| 26 | |
| 27 | public interface AccountDetail { |
| 28 | |
| 29 | public static final String TRUE_STR = "true"; |
| 30 | public static final String FALSE_STR = "false"; |
| 31 | |
| 32 | public static class PreferenceEntry { |
| 33 | public String mKey; |
| 34 | public boolean isTwoState; |
| 35 | public String mValue; |
| 36 | |
| 37 | public PreferenceEntry(String key) { |
| 38 | mKey = key; |
| 39 | isTwoState = false; |
| 40 | mValue = ""; |
| 41 | } |
| 42 | |
| 43 | public PreferenceEntry(String key, boolean twoState) { |
| 44 | mKey = key; |
| 45 | isTwoState = twoState; |
| 46 | mValue = ""; |
| 47 | } |
| 48 | |
| 49 | public boolean isChecked() { |
| 50 | return mValue.contentEquals("true"); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | public static final String TAG = "PreferenceHashMap"; |
| 55 | |
| 56 | public ArrayList<PreferenceEntry> getDetailValues(); |
| 57 | |
| 58 | public ArrayList<String> getValuesOnly(); |
| 59 | |
| 60 | public HashMap<String, String> getDetailsHashMap(); |
| 61 | |
| 62 | public String getDetailString(String key); |
| 63 | |
| 64 | public void setDetailString(String key, String newValue); |
| 65 | |
| 66 | } |