-
Notifications
You must be signed in to change notification settings - Fork 5
/
PEController.h
executable file
·122 lines (95 loc) · 3.66 KB
/
PEController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// PEController.h
// PermanentEraser
//
// Created by Chad Armstrong on Mon Jun 02 2003.
// Copyright (c) 2003-2015 Edenwaith. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <DiscRecording/DiscRecording.h>
#import "PEFile.h"
#import "CTProgressBadge.h"
#import "NSProcessInfo+PECocoaBackports.h"
#import "STPrivilegedTask.h"
#include <unistd.h> // required to retrieve uid
#include <sys/param.h>
#include <sys/mount.h> // required for statfs
#include <sys/types.h>
// Next three libraries required for the checkPermissions method
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
@interface PEController : NSObject
{
NSTask *pEraser;
STPrivilegedTask *privilegedTask;
NSFileManager *fm;
NSMutableArray *trash_files;
NSFileHandle *handle;
NSTimer *timer;
BOOL filesWereDropped; // were files dropped on the icon?
BOOL firstTimeHere; // indicates first pass through the application
BOOL warnBeforeErasing; // pop up warning message before deleting files
BOOL suppressCannotEraseWarning; // whether to display warning when a file can't be erased
BOOL registeredForTerminate;
BOOL wasCanceled;
BOOL beepBeforeTerminating;
BOOL isCurrentlyErasingDisc; // flag to determine if an optical disc is being erased
int idx; // counter for number of files launched (formerly named 'i')
int num_files; // total number of files to erase -- might need to remove this...
int lastPercentageCD;
unsigned long long totalFilesSize;
float end_angle; // end angle for drawing the arc in the badge
NSString *uid; // User identification number
NSString *util_path;
NSMutableString *discErasingLevel;
NSMutableString *fileErasingLevel;
NSMutableDictionary *dict;
IBOutlet id theWindow;
IBOutlet NSTextField *erasingMsg;
IBOutlet NSTextField *fileSizeMsg;
IBOutlet NSImageView *fileIcon;
IBOutlet NSButton *cancelButton;
IBOutlet NSMenuItem *cancelMenuItem;
IBOutlet NSProgressIndicator *indicator;
NSColor *color;
NSImage *badgeImage;
NSImage *originalIcon;
CTProgressBadge *badge;
NSPipe *pipe;
NSThread *preparationThread;
NSUserDefaults *prefs;
}
- (void) appWillTerminateNotification: (NSNotification *)aNotification;
- (void) applicationDidFinishLaunching: (NSNotification *) aNotification;
- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames;
- (void) prepareFiles;
- (void) addFileToArray: (NSString *) filename;
- (unsigned long long) countNumberOfFiles: (NSString *) path;
- (void) checkInstalledPlugins;
- (void) addNewFiles : (NSTimer *) aTimer;
- (void) erase;
- (void) alertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo;
- (void) selectNextFile;
- (void) eraseDisc;
- (void) eraseNotification: (NSNotification*) notification;
- (void) runTask;
- (void) setupPrivilegedTaskWithFile: (PEFile *)currentFile;
- (void) setupTaskWithFile: (PEFile *)currentFile;
- (void) outputData: (NSFileHandle *) handle;
- (void) updateIndicator: (double) delta;
- (void) updateApplicationBadge;
- (NSString *) fileNameString;
- (BOOL) checkPermissions: (NSString *)path;
- (BOOL) isVolume: (NSString *) volumePath;
- (BOOL) isErasableDisc: (NSString *) volumePath;
- (NSString *) volumeType: (NSString *) volumePath;
- (NSString *) bsdDevNode: (NSString *) volumePath;
- (void) doneErasing: (NSNotification *)aNotification;
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) aBool;
- (void) shutdownPE;
- (IBAction) openPreferences: (id) sender;
- (void) preferencesClosed;
- (IBAction) goToProductPage : (id) sender;
- (IBAction) sendFeedback: (id) sender;
- (IBAction) cancelErasing: (id) sender;
@end