root/trunk/CPFPerianPrefPaneController.h

Revision 792, 3.3 kB (checked in by durin42, 6 months ago)

Initial version of an improved component management tab. I've done enough to
get the code Ken wrote working with our setup, but we need to add some smarts
so the components can compute their status (eg should upgrade, remove, etc).

Line 
1 /* CPFPerianPrefPaneController */
2
3 #import <Cocoa/Cocoa.h>
4 #import <PreferencePanes/NSPreferencePane.h>
5 #import <Security/Security.h>
6
7 #define ComponentInfoPlist @"ComponentInfo.plist"
8 #define ObsoletesKey @"obsoletes"
9 #define HumanReadableNameKey @"HumanReadableName"
10 #define PERIAN_NO_BUNDLE_ID_FORMAT @"org.perian.No.Bundle.ID.%@"
11
12 #define ComponentInfoDictionaryKey      @"Components"
13
14 #define BundleVersionKey @"CFBundleVersion"
15 #define BundleIdentifierKey @"CFBundleIdentifier"
16
17 #define ComponentNameKey @"Name"
18 #define ComponentArchiveNameKey @"ArchiveName"
19 #define ComponentTypeKey @"Type"
20
21 typedef enum
22 {
23         InstallStatusInstalledInWrongLocation = 0,
24         InstallStatusNotInstalled = 1,
25         InstallStatusOutdatedWithAnotherInWrongLocation = 2,
26         InstallStatusOutdated = 3,
27         InstallStatusInstalledInBothLocations = 4,
28         InstallStatusInstalled = 5
29 } InstallStatus;
30
31 InstallStatus inline currentInstallStatus(InstallStatus status)
32 {
33         return (status | 1);
34 }
35
36 BOOL inline isWrongLocationInstalled(InstallStatus status)
37 {
38         return ((status & 1) == 0);
39 }
40
41 InstallStatus inline setWrongLocationInstalled(InstallStatus status)
42 {
43         return (status & ~1);
44 }
45
46 typedef enum
47 {
48         ComponentTypeQuickTime,
49         ComponentTypeCoreAudio,
50         ComponentTypeFramework
51 } ComponentType;
52
53 @interface CPFPerianPrefPaneController : NSPreferencePane
54 {
55         //General Pane
56         IBOutlet NSButton                                       *button_install;
57         IBOutlet NSTextField                            *textField_installStatus;
58         IBOutlet NSProgressIndicator            *progress_install;
59        
60         IBOutlet NSTextField                            *textField_currentVersion;
61         IBOutlet NSButton                                       *button_updateCheck;
62         IBOutlet NSProgressIndicator            *progress_updateCheck;
63         IBOutlet NSButton                                       *button_autoUpdateCheck;
64        
65         //AC3 Settings in General Pane
66         IBOutlet NSPopUpButton                          *popup_ac3DynamicRangeType;
67         IBOutlet NSPopUpButton                          *popup_outputMode;
68        
69         IBOutlet NSWindow                                       *window_dynRangeSheet;
70     IBOutlet NSTextField                *textField_ac3DynamicRangeValue;
71     IBOutlet NSSlider                   *slider_ac3DynamicRangeSlider;
72        
73         IBOutlet NSButton                                       *button_loadExternalSubtitles;
74        
75         //About
76         IBOutlet NSTextView                                     *textView_about;
77         IBOutlet NSButton                                       *button_website;
78         IBOutlet NSButton                                       *button_donate;
79         IBOutlet NSButton                                       *button_forum;
80        
81         InstallStatus                                           installStatus; //This is only marked as installed if everything is installed
82         BOOL                                                            userInstalled;
83         AuthorizationRef                                        auth;
84         NSMutableString                                         *errorString;
85        
86         NSURL                                                           *perianForumURL;
87         NSURL                                                           *perianDonateURL;
88         NSURL                                                           *perianWebSiteURL;
89        
90         CFStringRef                                                     perianAppID;
91         CFStringRef                                                     a52AppID;
92        
93         float                                                           nextDynValue;
94 }
95 //General Pane
96 - (IBAction)installUninstall:(id)sender;
97 - (IBAction)updateCheck:(id)sender;
98 - (IBAction)setAutoUpdateCheck:(id)sender;
99 - (IBAction)setLoadExternalSubtitles:(id)sender;
100
101 //AC3 Settings
102 - (IBAction)setAC3DynamicRangePopup:(id)sender;
103 - (IBAction)set2ChannelModePopup:(id)sender;
104
105 - (IBAction)setAC3DynamicRangeValue:(id)sender;
106 - (IBAction)setAC3DynamicRangeSlider:(id)sender;
107 - (IBAction)cancelDynRangeSheet:(id)sender;
108 - (IBAction)saveDynRangeSheet:(id)sender;
109
110 //Component List
111 //- (NSString *)checkComponentStatusByBundleIdentifier:(NSString *)bundleID;
112
113 //About
114 - (IBAction)launchWebsite:(id)sender;
115 - (IBAction)launchDonate:(id)sender;
116 - (IBAction)launchForum:(id)sender;
117
118 @end
119
120 NSArray* GetComponentsInFolder(NSString* folder);
Note: See TracBrowser for help on using the browser.