/
CocoaRestClientAppDelegate.h
168 lines (142 loc) · 5.43 KB
/
CocoaRestClientAppDelegate.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//
// CocoaRestClientAppDelegate.h
// CocoaRestClient
//
// Created by mmattozzi on 1/5/10.
// Copyright 2012 Michael Mattozzi. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import "ExportRequestsController.h"
#import "CRCDrawerView.h"
#import "TabbingTableView.h"
#import "PreferencesController.h"
#import "HighlightedTextView.h"
extern NSString* const FOLLOW_REDIRECTS;
extern NSString* const RESPONSE_TIMEOUT;
@class CRCRequest;
@class CRCDrawerView;
@interface CocoaRestClientAppDelegate : NSObject {
NSWindow *window;
NSComboBox *urlBox;
NSButton *submitButton;
NSTextView *requestText;
NSTextView *responseText;
WebView *responseWebView;
NSTextView *requestHeadersSentText;
NSTabViewItem *headersTab;
NSTextView *responseTextHeaders;
NSPopUpButton *methodButton;
TabbingTableView *headersTableView;
TabbingTableView *filesTableView;
TabbingTableView *paramsTableView;
HighlightedTextView *responseView;
HighlightedTextView *requestView;
NSTextField *username;
NSTextField *password;
NSMutableData *receivedData;
NSString *contentType;
NSString *charset;
NSMutableArray *headersTable;
NSMutableArray *filesTable;
NSMutableArray *paramsTable;
NSDrawer *savedRequestsDrawer;
NSMutableArray *savedRequestsArray;
NSOutlineView *savedOutlineView;
NSPanel *saveRequestSheet;
NSTextField *saveRequestTextField;
NSPanel *timeoutSheet;
NSTextField *timeoutField;
ExportRequestsController *exportRequestsController;
BOOL allowSelfSignedCerts;
NSURLRequest *currentRequest;
NSButton *plusParam;
NSButton *minusParam;
BOOL rawRequestInput;
NSTabView *tabView;
NSTabViewItem *reqHeadersTab;
NSDate *startDate;
NSTextField *status;
NSProgressIndicator *progressIndicator;
CRCDrawerView *drawerView;
PreferencesController *preferencesController;
@private
CRCRequest *lastRequest;
@private
NSSet *requestMethodsWithBody;
}
@property (nonatomic, readonly) NSMutableArray *headersTable;
@property (nonatomic, readonly) NSMutableArray *filesTable;
@property (nonatomic, readonly) NSMutableArray *paramsTable;
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSComboBox *urlBox;
@property (assign) IBOutlet NSButton *submitButton;
@property (assign) IBOutlet NSTextView *responseText;
@property (assign) IBOutlet WebView *responseWebView;
@property (assign) IBOutlet HighlightedTextView *responseView;
@property (assign) IBOutlet HighlightedTextView *requestView;
@property (assign) IBOutlet NSTextView *responseTextHeaders;
@property (assign) IBOutlet NSPopUpButton *methodButton;
@property (assign) IBOutlet NSTextView *requestText;
@property (assign) IBOutlet TabbingTableView *headersTableView;
@property (assign) IBOutlet TabbingTableView *filesTableView;
@property (assign) IBOutlet TabbingTableView *paramsTableView;
@property (assign) IBOutlet NSTextField *username;
@property (assign) IBOutlet NSTextField *password;
@property (assign) IBOutlet NSOutlineView *savedOutlineView;
@property (assign) IBOutlet NSPanel *saveRequestSheet;
@property (assign) IBOutlet NSTextField *saveRequestTextField;
@property (assign) IBOutlet NSDrawer *savedRequestsDrawer;
@property (assign) IBOutlet NSTabViewItem *headersTab;
@property (assign) IBOutlet NSPanel *timeoutSheet;
@property (assign) IBOutlet NSTextField *timeoutField;
@property (assign) IBOutlet NSButton *plusParam;
@property (assign) IBOutlet NSButton *minusParam;
@property (assign) BOOL rawRequestInput;
@property (assign) IBOutlet NSTabView *tabView;
@property (assign) IBOutlet NSTabViewItem *reqHeadersTab;
@property (assign) IBOutlet NSTextField *status;
@property (assign) IBOutlet NSTextView *requestHeadersSentText;
@property (assign) IBOutlet NSProgressIndicator *progressIndicator;
@property (assign) IBOutlet CRCDrawerView *drawerView;
@property (retain) PreferencesController *preferencesController;
- (IBAction) runSubmit:(id)sender;
- (IBAction) doubleClickedHeaderRow:(id)sender;
- (IBAction) plusHeaderRow:(id)sender;
- (IBAction) minusHeaderRow:(id)sender;
- (IBAction) clearAuth:(id)sender;
- (IBAction) outlineClick:(id)sender;
- (IBAction) saveRequest:(id) sender;
- (IBAction) overwriteRequest:(id) sender;
- (IBAction) doneSaveRequest:(id) sender;
- (void) loadSavedRequest:(NSDictionary *) request;
- (IBAction) deleteSavedRequest:(id) sender;
- (NSString *) pathForDataFile;
- (void) loadDataFromDisk;
- (void) saveDataToDisk;
- (void) applicationWillTerminate: (NSNotification *)note;
- (IBAction) openTimeoutDialog:(id) sender;
- (IBAction) closeTimoutDialog:(id) sender;
- (IBAction) doubleClickedFileRow:(id)sender;
- (IBAction) plusFileRow:(id)sender;
- (IBAction) minusFileRow:(id)sender;
- (IBAction) doubleClickedParamsRow:(id)sender;
- (IBAction) plusParamsRow:(id)sender;
- (IBAction) minusParamsRow:(id)sender;
- (IBAction) contentTypeMenuItemSelected:(id)sender;
- (IBAction) handleOpenWindow:(id)sender;
- (BOOL)validateMenuItem:(NSMenuItem *)item;
- (IBAction) helpInfo:(id)sender;
- (IBAction) licenseInfo:(id)sender;
- (IBAction) reloadLastRequest:(id)sender;
- (IBAction) allowSelfSignedCerts:(id)sender;
- (IBAction) importRequests:(id)sender;
- (IBAction) exportRequests:(id)sender;
- (void) importRequestsFromArray:(NSArray *)requests;
- (void) invalidFileAlert;
- (IBAction)deleteRow:(id)sender;
- (IBAction)showPreferences:(id)sender;
- (void)setRawRequestInput:(BOOL)value;
- (void) initHighlightedViews;
- (void) setHighlightSyntaxForMIME:(NSString*) mimeType;
@end