1 /* 2 * Created on Apr 16, 2004 3 * Created by Paul Gardner 4 * Copyright (C) Azureus Software, Inc, All Rights Reserved. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 */ 19 20 package org.gudy.azureus2.platform.win32.access; 21 22 import java.io.File; 23 import java.net.InetAddress; 24 import java.util.Map; 25 26 import org.gudy.azureus2.platform.PlatformManagerPingCallback; 27 28 /** 29 * @author parg 30 * 31 */ 32 33 34 public interface 35 AEWin32Access 36 { 37 public static final int HKEY_CLASSES_ROOT = 1; 38 public static final int HKEY_CURRENT_CONFIG = 2; 39 public static final int HKEY_LOCAL_MACHINE = 3; 40 public static final int HKEY_CURRENT_USER = 4; 41 42 public static final int SW_HIDE = 0; 43 public static final int SW_NORMAL = 1; 44 public static final int SW_SHOWNORMAL = 1; 45 public static final int SW_SHOWMINIMIZED = 2; 46 public static final int SW_SHOWMAXIMIZED = 3; 47 public static final int SW_MAXIMIZE = 3; 48 public static final int SW_SHOWNOACTIVATE = 4; 49 public static final int SW_SHOW = 5; 50 public static final int SW_MINIMIZE = 6; 51 public static final int SW_SHOWMINNOACTIVE = 7; 52 public static final int SW_SHOWNA = 8; 53 public static final int SW_RESTORE = 9; 54 public static final int SW_SHOWDEFAULT = 10; 55 public static final int SW_FORCEMINIMIZE = 11; 56 public static final int SW_MAX = 11; 57 58 public boolean isEnabled()59 isEnabled(); 60 61 public String getVersion()62 getVersion(); 63 64 public String readStringValue( int type, String subkey, String value_name )65 readStringValue( 66 int type, // HKEY type from above 67 String subkey, 68 String value_name ) 69 70 throws AEWin32AccessException; 71 72 public void writeStringValue( int type, String subkey, String value_name, String value_value )73 writeStringValue( 74 int type, // HKEY type from above 75 String subkey, 76 String value_name, 77 String value_value ) 78 79 throws AEWin32AccessException; 80 81 public int readWordValue( int type, String subkey, String value_name )82 readWordValue( 83 int type, // HKEY type from above 84 String subkey, 85 String value_name ) 86 87 throws AEWin32AccessException; 88 89 public void writeWordValue( int type, String subkey, String value_name, int value_value )90 writeWordValue( 91 int type, // HKEY type from above 92 String subkey, 93 String value_name, 94 int value_value ) 95 96 throws AEWin32AccessException; 97 98 99 public void deleteKey( int type, String subkey )100 deleteKey( 101 int type, 102 String subkey ) 103 104 throws AEWin32AccessException; 105 106 public void deleteKey( int type, String subkey, boolean recursuve )107 deleteKey( 108 int type, 109 String subkey, 110 boolean recursuve ) 111 112 throws AEWin32AccessException; 113 114 public void deleteValue( int type, String subkey, String value_name )115 deleteValue( 116 int type, 117 String subkey, 118 String value_name ) 119 120 throws AEWin32AccessException; 121 122 public String getUserAppData()123 getUserAppData() 124 125 throws AEWin32AccessException; 126 127 public String getProgramFilesDir()128 getProgramFilesDir() 129 130 throws AEWin32AccessException; 131 132 public String getApplicationInstallDir( String app_name )133 getApplicationInstallDir( 134 String app_name ) 135 136 throws AEWin32AccessException; 137 138 public void createProcess( String command_line, boolean inherit_handles )139 createProcess( 140 String command_line, 141 boolean inherit_handles ) 142 143 throws AEWin32AccessException; 144 145 public void moveToRecycleBin( String file_name )146 moveToRecycleBin( 147 String file_name ) 148 149 throws AEWin32AccessException; 150 151 public void copyFilePermissions( String from_file_name, String to_file_name )152 copyFilePermissions( 153 String from_file_name, 154 String to_file_name ) 155 156 throws AEWin32AccessException; 157 158 public boolean testNativeAvailability( String name )159 testNativeAvailability( 160 String name ) 161 162 throws AEWin32AccessException; 163 164 public void traceRoute( InetAddress source_address, InetAddress target_address, PlatformManagerPingCallback callback )165 traceRoute( 166 InetAddress source_address, 167 InetAddress target_address, 168 PlatformManagerPingCallback callback ) 169 170 throws AEWin32AccessException; 171 172 public void ping( InetAddress source_address, InetAddress target_address, PlatformManagerPingCallback callback )173 ping( 174 InetAddress source_address, 175 InetAddress target_address, 176 PlatformManagerPingCallback callback ) 177 178 throws AEWin32AccessException; 179 180 public void addListener( AEWin32AccessListener listener )181 addListener( 182 AEWin32AccessListener listener ); 183 184 public void removeListener( AEWin32AccessListener listener )185 removeListener( 186 AEWin32AccessListener listener ); 187 188 /** 189 * @return 190 * @throws AEWin32AccessException 191 */ getUserDocumentsDir()192 String getUserDocumentsDir() throws AEWin32AccessException; 193 194 /** 195 * @return 196 * @throws AEWin32AccessException 197 */ getUserMusicDir()198 String getUserMusicDir() throws AEWin32AccessException; 199 200 /** 201 * @return 202 * @throws AEWin32AccessException 203 */ getUserVideoDir()204 String getUserVideoDir() throws AEWin32AccessException; 205 206 /** 207 * @return 208 * @throws AEWin32AccessException 209 */ getCommonAppData()210 String getCommonAppData() throws AEWin32AccessException; 211 212 public int shellExecute( String operation, String file, String parameters, String directory, int SW_const)213 shellExecute( 214 String operation, 215 String file, 216 String parameters, 217 String directory, 218 int SW_const) 219 220 throws AEWin32AccessException; 221 222 public int shellExecuteAndWait( String file, String params )223 shellExecuteAndWait( 224 String file, 225 String params ) 226 227 throws AEWin32AccessException; 228 229 /** 230 * @return 231 * 232 * @since 4.1.0.5 233 */ 234 public Map<File, Map> getAllDrives()235 getAllDrives(); 236 isUSBDrive(Map driveInfo)237 public boolean isUSBDrive(Map driveInfo); 238 239 /** 240 * @return 241 * @throws AEWin32AccessException 242 * 243 * @since 4.5.0.3 244 */ getLocalAppData()245 String getLocalAppData() throws AEWin32AccessException; 246 247 /** 248 * @since 4713 249 * @param state 250 */ 251 252 public void setThreadExecutionState( int state )253 setThreadExecutionState( 254 int state ); 255 } 256