vvopensource
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
VVCrashReporter.h
1 
2 #import <Cocoa/Cocoa.h>
3 #import <SystemConfiguration/SystemConfiguration.h>
4 #include "AvailabilityMacros.h"
5 #import <SystemConfiguration/SCNetworkReachability.h>
6 #import <asl.h>
7 #import "VVCURLDL.h"
8 #import "MutLockArray.h"
9 
10 
11 
12 
14 
18 - (void) crashReporterCheckDone;
19 @end
20 
21 @protocol VVCrashReporterDelegate
22 - (void) crashReporterCheckDone:(BOOL)foundLogs; // "new"- 'f' designates whether crash reports were found or not
23 - (void) crashReporterWillSendLog:(NSString *)crashString;
24 @end
25 
26 
27 
29 
46 @interface VVCrashReporter : NSObject <VVCURLDLDelegate> {
47  NSString *domainToCheck;
48  NSString *uploadURL; // does NOT includes http://
49  NSString *developerEmail;
50  id delegate; // must respond to VVCrashReporterDelegate protocol
51  MutLockArray *crashLogArray;
52  NSMutableDictionary *systemProfilerDict;
53  NSString *consoleLog;
54  int jobSize; // used to update progress indicator/label
55  int jobCurrentIndex; // used to update progress indicator/label
56  int currentCrashLogTimeout; // countdown for timeout of sending/receiving data for a specific crash log
57  NSTimer *currentCrashLogTimer;
58 
59  IBOutlet NSWindow *window;
60  IBOutlet NSButton *replyButton;
61  IBOutlet NSView *emailFieldHolder;
62  IBOutlet NSTextField *emailField;
63  IBOutlet NSTextView *descriptionField;
64  IBOutlet NSTextField *submittingLabel; // non-editable. 'submitting', 'getting machine profile', etc.
65  IBOutlet NSProgressIndicator *progressIndicator; // indicates progress through all crash logs to be submitted
66  IBOutlet NSTextField *countdownLabel; // non-editable; countdown so user knows app hasn't hung
67 
68  NSNib *theNib;
69  NSArray *nibTopLevelObjects;
70 }
71 
72 + (NSString *) _stringForSystemProfilerDataType:(NSString *)t;
73 
75 - (void) check;
76 - (void) openCrashReporter;
77 - (IBAction) replyButtonClicked:(id)sender;
78 - (IBAction) doneClicked:(id)sender;
79 - (void) sendACrashLog;
80 - (void) closeCrashReporter;
81 
82 - (NSString *) _nibName;
83 - (BOOL) _assembleCrashLogs; // assembles the array of crash logs, returns a YES if logs were found and have to be sent in
84 - (NSString *) _consoleLogString;
85 - (NSMutableDictionary *) _systemProfilerDict;
86 
87 - (void) updateCrashLogTimeout:(NSTimer *)t;
88 
89 // VVCURLDLDelegate method- this class will be the delegate of multiple VVCURLDL instances
90 - (void) dlFinished:(id)h;
91 
93 - (void) setDomainToCheck:(NSString *)n;
94 - (NSString *) domainToCheck;
96 - (void) setDeveloperEmail:(NSString *)n;
97 - (NSString *) developerEmail;
99 - (void) setUploadURL:(NSString *)n;
100 - (NSString *) uploadURL;
101 
103 @property (assign,readwrite) id delegate;
104 @property (readonly) NSButton *replyButton;
105 
106 @end
The crash reporter's delegate must adhere to this protocol.
Definition: VVCrashReporter.h:17
id delegate
The crash reporter's delegate is notified when the check has completed.
Definition: VVCrashReporter.h:50
Simple class which automatically uploads crash logs and other relevant diagnostic information automat...
Definition: VVCrashReporter.h:46
Similar to NSMutableArray, but thread-safe. Internally, uses an NSMutableArray and a rwlock...
Definition: MutLockArray.h:20