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 169 170 171 172 173 174 175 176 177
|
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
@class NetworkClass;
@interface CleanChatViewController : UIViewController <UITextFieldDelegate,UIWebViewDelegate, UIAlertViewDelegate, MFMailComposeViewControllerDelegate> {
NetworkClass *connection;
UIImageView *advancedButtonSeperator;
UIImageView *simpeButtonSeperator;
UIImageView *connectedImage;
UIImageView *backgroundImage;
UIImageView *sendBarImage;
UIImageView *webViewBack;
UIButton *buttonOne;
UIButton *buttonTwo;
UIButton *buttonThree;
UIButton *buttonFour;
UIButton *buttonFive;
UIButton *buttonSix;
UIButton *buttonSeven;
UIButton *buttonEight;
UIButton *buttonNine;
UIButton *buttonTen;
UIButton *buttonEleven;
UIButton *buttonTwelve;
UIButton *buttonThirteen;
UIButton *buttonFourteen;
UIWebView *webView;
UITextField *outField;
UITextField *serverIP;
NSString *username;
NSString *allText;
UILabel *localIP;
UILabel *message;
UIScrollView *scrollView;
NSThread *receiveThread;
NSThread *sendThread;
NSArray *blackList;
NSMutableDictionary *settings;
int idNum;
BOOL quit;
BOOL swap;
BOOL simpleMode;
BOOL isPortrait;
BOOL leftLandscape;
}
-(IBAction) startConnecting;
-(IBAction) connectToIP;
-(IBAction) serverIPPressed: (UITextField *) sender;
-(IBAction) serverIPDone: (UITextField *) sender;
-(IBAction) sendButton;
-(IBAction) backgroundTouched;
-(IBAction) clearButton;
-(IBAction) closeButton;
-(IBAction) changeModeToAdvanced;
-(IBAction) changeModeToSimple;
-(IBAction) simpleConnectButton;
-(IBAction) simpleDisconnectButton;
-(IBAction) displayAllOnWebView;
-(IBAction) helpButton;
-(IBAction) newButton;
-(IBAction) mailButton;
-(NSString*) getLocalIP;
//returns the local ipv4 address
-(NSString*) makeCommand: (NSString*) toMakeCommandFrom;
//returns a string using my protocol for commands
-(void) appendTextFieldWithOptions: (NSArray *)options;
//same as append from user only using an nsarray
-(void) receiveAndSetText;
//This is the main receiving thread
-(void) setViewMovedVertical:(BOOL)movedUp;
// when you select the bottom text field this moves the whole screen up
-(void) setViewMovedHorizontal: (BOOL)moved;
//same as above.
-(void) handleCommand: (NSString *) command;
//handles commands from the server format (char 2)[cmd](char 4)
-(void) addToWebTextView: (NSString *)toAdd;
//this actually adds and loads text to the webviews
-(void) changeWebTextView: (NSString *)toChangeTo;
//this changes all of the text in the webviews
-(void) addInput: (NSString *)input byUser: (NSString *)user;
//this changes the colors of the text and username
-(void) setAdvancedControlsHidden: (BOOL) toHide;
//sets the server client close and clear buttons to toHide
-(void) setSimpleControlsHidden: (BOOL) toHide;
//sets connect and new partner buttons to toHide
-(void) updateSimpleConnectDisconnectTo: (BOOL)connected;
// sets advanced to !simple controls and simple controls to connected
-(void) updateSimpleConnectDisconnectAuto;
// same as to connected but by checking the simple variable
-(void) updateBothWebViews;
//this loads both webviews automatically (to prevent glitch at startup
-(void) showConfirmAlert: (NSString *)newMessage withTag: (NSInteger)newTag;
//loads an alert with several options
-(void) setBlackList: (NSArray *)toSet;
//set banned words
-(void) didConnect: (BOOL) did;
//display a connect message, perhaps do other stuff in the future
-(NSArray *) getBlackList;
//returns banned words
-(void) readSettings;
//read all settings into the settings dictionary
-(void) saveSettings;
//save settings back to file
-(void) loadDefaultSettings;
//read all settings from the default file into the settings dictionary
-(BOOL) checkConnection;
//send 0 bytes. Just a quick method of testing connection
@property (nonatomic, retain) IBOutlet UITextField *outField;
@property (nonatomic, retain) IBOutlet UIImageView *connectedImage;
@property (nonatomic, retain) IBOutlet UIImageView *advancedButtonSeperator;
@property (nonatomic, retain) IBOutlet UIImageView *simpleButtonSeperator;
@property (nonatomic, retain) IBOutlet UIImageView *backgroundImage;
@property (nonatomic, retain) IBOutlet UIImageView *sendBarImage;
@property (nonatomic, retain) IBOutlet UIImageView *webViewBack;
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) IBOutlet UIButton *buttonOne;
@property (nonatomic, retain) IBOutlet UIButton *buttonTwo;
@property (nonatomic, retain) IBOutlet UIButton *buttonThree;
@property (nonatomic, retain) IBOutlet UIButton *buttonFour;
@property (nonatomic, retain) IBOutlet UIButton *buttonFive;
@property (nonatomic, retain) IBOutlet UIButton *buttonSix;
@property (nonatomic, retain) IBOutlet UIButton *buttonSeven;
@property (nonatomic, retain) IBOutlet UIButton *buttonEight;
@property (nonatomic, retain) IBOutlet UIButton *buttonNine;
@property (nonatomic, retain) IBOutlet UIButton *buttonTen;
@property (nonatomic, retain) IBOutlet UIButton *buttonEleven;
@property (nonatomic, retain) IBOutlet UIButton *buttonThirteen;
@property (nonatomic, retain) IBOutlet UIButton *buttonFourteen;
@property (nonatomic, retain) IBOutlet UIButton *buttonTwelve;
@property (nonatomic, retain) IBOutlet UILabel *localIP;
@property (nonatomic, retain) IBOutlet UILabel *message;
@property (retain) IBOutlet UITextField *serverIP;
@property (retain) IBOutlet UITextView *receiveText;
@property (retain) NSString *allText;
@end
|