Line data Source code
1 0 : /* 2 : 3 : OOOXZManager.h 4 : 5 : Responsible for installing and uninstalling OXZs 6 : 7 : Oolite 8 : Copyright (C) 2004-2013 Giles C Williams and contributors 9 : 10 : This program is free software; you can redistribute it and/or 11 : modify it under the terms of the GNU General Public License 12 : as published by the Free Software Foundation; either version 2 13 : of the License, or (at your option) any later version. 14 : 15 : This program is distributed in the hope that it will be useful, 16 : but WITHOUT ANY WARRANTY; without even the implied warranty of 17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 : GNU General Public License for more details. 19 : 20 : You should have received a copy of the GNU General Public License 21 : along with this program; if not, write to the Free Software 22 : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 : MA 02110-1301, USA. 24 : 25 : */ 26 : 27 : #import "OOCocoa.h" 28 : #import "OOOpenGL.h" 29 : #import "NSFileManagerOOExtensions.h" 30 : #import "OOTypes.h" 31 : #import "GuiDisplayGen.h" 32 : 33 0 : typedef enum { 34 : OXZ_DOWNLOAD_NONE = 0, 35 : OXZ_DOWNLOAD_STARTED = 1, 36 : OXZ_DOWNLOAD_RECEIVING = 2, 37 : OXZ_DOWNLOAD_COMPLETE = 10, 38 : OXZ_DOWNLOAD_ERROR = 99 39 : } OXZDownloadStatus; 40 : 41 : 42 0 : typedef enum { 43 : OXZ_STATE_NODATA, 44 : OXZ_STATE_MAIN, 45 : OXZ_STATE_UPDATING, 46 : OXZ_STATE_PICK_INSTALL, 47 : OXZ_STATE_PICK_INSTALLED, 48 : OXZ_STATE_PICK_REMOVE, 49 : OXZ_STATE_INSTALLING, 50 : OXZ_STATE_DEPENDENCIES, 51 : OXZ_STATE_REMOVING, 52 : OXZ_STATE_TASKDONE, 53 : OXZ_STATE_RESTARTING, 54 : OXZ_STATE_SETFILTER, 55 : OXZ_STATE_EXTRACT, 56 : OXZ_STATE_EXTRACTDONE 57 : } OXZInterfaceState; 58 : 59 : 60 0 : @interface OOOXZManager : NSObject 61 : { 62 : @private 63 0 : NSArray *_oxzList; 64 0 : NSArray *_managedList; 65 0 : NSArray *_filteredList; 66 0 : NSString *_currentFilter; 67 : 68 0 : OXZInterfaceState _interfaceState; 69 0 : BOOL _interfaceShowingOXZDetail; 70 0 : BOOL _changesMade; 71 : 72 0 : NSURLConnection *_currentDownload; 73 0 : NSString *_currentDownloadName; 74 : 75 0 : OXZDownloadStatus _downloadStatus; 76 0 : NSUInteger _downloadProgress; 77 0 : NSUInteger _downloadExpected; 78 0 : NSFileHandle *_fileWriter; 79 0 : NSUInteger _item; 80 : 81 0 : BOOL _downloadAllDependencies; 82 : 83 0 : NSUInteger _offset; 84 : 85 0 : NSString *_progressStatus; 86 0 : NSMutableSet *_dependencyStack; 87 : } 88 : 89 0 : + (OOOXZManager *) sharedManager; 90 : 91 0 : - (NSString *) installPath; 92 : 93 0 : - (BOOL) updateManifests; 94 0 : - (BOOL) cancelUpdate; 95 : 96 0 : - (NSArray *) manifests; 97 0 : - (NSArray *) managedOXZs; 98 : 99 0 : - (void) gui; 100 0 : - (BOOL) isRestarting; 101 0 : - (BOOL) isAcceptingTextInput; 102 0 : - (BOOL) isAcceptingGUIInput; 103 : 104 0 : - (void) processSelection; 105 0 : - (void) processTextInput:(NSString *)input; 106 0 : - (void) refreshTextInput:(NSString *)input; 107 0 : - (void) processFilterKey; 108 0 : - (void) processShowInfoKey; 109 0 : - (void) processExtractKey; 110 0 : - (OOGUIRow) showInstallOptions; 111 0 : - (OOGUIRow) showRemoveOptions; 112 0 : - (void) showOptionsUpdate; 113 0 : - (void) showOptionsPrev; 114 0 : - (void) showOptionsNext; 115 0 : - (void) processOptionsPrev; 116 0 : - (void) processOptionsNext; 117 : 118 : @end