1 package org.dolphinemu.dolphinemu.features.settings.ui; 2 3 import androidx.fragment.app.FragmentActivity; 4 5 import org.dolphinemu.dolphinemu.features.settings.model.Settings; 6 import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem; 7 8 import java.util.ArrayList; 9 10 /** 11 * Abstraction for a screen showing a list of settings. Instances of 12 * this type of view will each display a layer of the setting hierarchy. 13 */ 14 public interface SettingsFragmentView 15 { 16 /** 17 * Called by the containing Activity to notify the Fragment that an 18 * asynchronous load operation completed. 19 * 20 * @param settings The (possibly null) result of the ini load operation. 21 */ onSettingsFileLoaded(Settings settings)22 void onSettingsFileLoaded(Settings settings); 23 24 /** 25 * Pass an ArrayList of settings to the View so that it can be displayed on screen. 26 * 27 * @param settingsList The settings to display 28 */ showSettingsList(ArrayList<SettingsItem> settingsList)29 void showSettingsList(ArrayList<SettingsItem> settingsList); 30 31 /** 32 * Called by the containing Activity when an asynchronous load operation fails. 33 * Instructs the Fragment to load the settings screen with defaults selected. 34 */ loadDefaultSettings()35 void loadDefaultSettings(); 36 37 /** 38 * @return The Fragment's containing activity. 39 */ getActivity()40 FragmentActivity getActivity(); 41 42 /** 43 * @return The Fragment's SettingsAdapter. 44 */ getAdapter()45 SettingsAdapter getAdapter(); 46 47 /** 48 * Tell the Fragment to tell the containing Activity to show a new 49 * Fragment containing a submenu of settings. 50 * 51 * @param menuKey Identifier for the settings group that should be shown. 52 */ loadSubMenu(MenuTag menuKey)53 void loadSubMenu(MenuTag menuKey); 54 55 /** 56 * Tell the Fragment to tell the containing activity to display a toast message. 57 * 58 * @param message Text to be shown in the Toast 59 */ showToastMessage(String message)60 void showToastMessage(String message); 61 62 /** 63 * @return The backing settings store. 64 */ getSettings()65 Settings getSettings(); 66 67 /** 68 * Have the fragment tell the containing Activity that a setting was modified. 69 */ onSettingChanged()70 void onSettingChanged(); 71 72 /** 73 * Have the fragment tell the containing Activity that a GCPad's setting was modified. 74 * 75 * @param menuTag Identifier for the GCPad that was modified. 76 * @param value New setting for the GCPad. 77 */ onGcPadSettingChanged(MenuTag menuTag, int value)78 void onGcPadSettingChanged(MenuTag menuTag, int value); 79 80 /** 81 * Have the fragment tell the containing Activity that a Wiimote's setting was modified. 82 * 83 * @param menuTag Identifier for Wiimote that was modified. 84 * @param value New setting for the Wiimote. 85 */ onWiimoteSettingChanged(MenuTag menuTag, int value)86 void onWiimoteSettingChanged(MenuTag menuTag, int value); 87 88 /** 89 * Have the fragment tell the containing Activity that an extension setting was modified. 90 * 91 * @param menuTag Identifier for the extension that was modified. 92 * @param value New setting for the extension. 93 */ onExtensionSettingChanged(MenuTag menuTag, int value)94 void onExtensionSettingChanged(MenuTag menuTag, int value); 95 } 96