OSDN Git Service

merge from donut
[android-x86/development.git] / tools / sdkmanager / libs / sdkuilib / src / com / android / sdkuilib / internal / repository / ISettingsPage.java
1 /*\r
2  * Copyright (C) 2009 The Android Open Source Project\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 package com.android.sdkuilib.internal.repository;\r
18 \r
19 import java.net.URL;\r
20 import java.util.Properties;\r
21 \r
22 /**\r
23  * Interface that a settings page must implement.\r
24  */\r
25 public interface ISettingsPage {\r
26 \r
27     /**\r
28      * Java system setting picked up by {@link URL} for http proxy port.\r
29      * Type: String.\r
30      */\r
31     public static final String KEY_HTTP_PROXY_PORT = "http.proxyPort";           //$NON-NLS-1$\r
32     /**\r
33      * Java system setting picked up by {@link URL} for http proxy host.\r
34      * Type: String.\r
35      */\r
36     public static final String KEY_HTTP_PROXY_HOST = "http.proxyHost";           //$NON-NLS-1$\r
37     /**\r
38      * Setting to force using http:// instead of https:// connections.\r
39      * Type: Boolean.\r
40      * Default: False.\r
41      */\r
42     public static final String KEY_FORCE_HTTP = "sdkman.force.http";             //$NON-NLS-1$\r
43     /**\r
44      * Setting to display only packages that are new or updates.\r
45      * Type: Boolean.\r
46      * Default: True.\r
47      */\r
48     public static final String KEY_SHOW_UPDATE_ONLY = "sdkman.show.update.only"; //$NON-NLS-1$\r
49     /**\r
50      * Setting to ask for permission before restarting ADB.\r
51      * Type: Boolean.\r
52      * Default: True.\r
53      */\r
54     public static final String KEY_ASK_ADB_RESTART = "sdkman.ask.adb.restart";   //$NON-NLS-1$\r
55 \r
56     /** Loads settings from the given {@link Properties} container and update the page UI. */\r
57     public abstract void loadSettings(Properties in_settings);\r
58 \r
59     /** Called by the application to retrieve settings from the UI and store them in\r
60      * the given {@link Properties} container. */\r
61     public abstract void retrieveSettings(Properties out_settings);\r
62 \r
63     /**\r
64      * Called by the application to give a callback that the page should invoke when\r
65      * settings have changed.\r
66      */\r
67     public abstract void setOnSettingsChanged(SettingsChangedCallback settingsChangedCallback);\r
68 \r
69     /**\r
70      * Callback used to notify the application that settings have changed and need to be\r
71      * applied.\r
72      */\r
73     public interface SettingsChangedCallback {\r
74         /**\r
75          * Invoked by the settings page when settings have changed and need to be\r
76          * applied. The application will call {@link ISettingsPage#retrieveSettings(Properties)}\r
77          * and apply the new settings.\r
78          */\r
79         public abstract void onSettingsChanged(ISettingsPage page);\r
80     }\r
81 }\r