Improve Gambit REPL (toolbar is semi transparent and the alpha can be set with set...
[gambit-c.git] / examples / iOS / ViewController.h
blobb2b1c34d923604eff1848fbcc8067f1490355a7c
1 //
2 // ViewController.h
3 //
4 // Created by Marc Feeley on 11-03-06.
5 // Copyright 2011-2012 Université de Montréal. All rights reserved.
6 //
8 #import <UIKit/UIKit.h>
9 #import <CoreLocation/CoreLocation.h>
12 // ViewController methods callable from Scheme.
14 void set_navigation(int n);
15 void show_cancelButton();
16 void hide_cancelButton();
17 void show_webView(int view);
18 void show_textView(int view);
19 void show_imageView(int view);
20 void set_textView_font(int view, NSString *name, int size);
21 void set_textView_content(int view, NSString *str);
22 NSString *get_textView_content(int view);
23 void add_output_to_textView(int view, NSString *str);
24 void add_input_to_textView(int view, NSString *str);
25 void set_webView_content(int view, NSString *str, NSString *base_url_path, BOOL enable_scaling, NSString *mime_type);
26 void set_webView_content_from_file(int view, NSString *path, NSString *base_url_path, BOOL enable_scaling, NSString *mime_type);
27 NSString *eval_js_in_webView(int view, NSString *script);
28 void open_URL(NSString *url);
29 void set_idle_timer(BOOL enable);
30 void set_toolbar_alpha(double alpha);
31 void segm_ctrl_set_title(int segment, NSString *title);
32 void segm_ctrl_insert(int segment, NSString *title);
33 void segm_ctrl_remove(int segment);
34 void segm_ctrl_remove_all();
35 void set_pref(NSString *key, NSString *value);
36 NSString *get_pref(NSString *key);
37 void set_pasteboard(NSString *value);
38 NSString *get_pasteboard();
39 NSString *get_documents_dir();
40 void popup_alert(NSString *title, NSString *msg, NSString *cancel_button, NSString *accept_button);
41 void setup_location_updates(double desired_accuracy, double distance_filter);
43 #define NB_WEBVIEWS 4
44 #define NB_TEXTVIEWS 2
45 #define NB_IMAGEVIEWS 2
47 @interface ViewController : UIViewController <UITextViewDelegate,UIWebViewDelegate,UIAlertViewDelegate,CLLocationManagerDelegate> {
49 UISegmentedControl *segmCtrl;
50 UIWebView *webViews[NB_WEBVIEWS];
51 UIWebView *webView0;
52 UIWebView *webView1;
53 UIWebView *webView2;
54 UIWebView *webView3;
55 UITextView *textViews[NB_TEXTVIEWS];
56 UITextView *textView0;
57 UITextView *textView1;
58 UIImageView *imageViews[NB_IMAGEVIEWS];
59 UIImageView *imageView0;
60 UIImageView *imageView1;
61 UIButton *cancelButton;
62 UIView *accessoryView;
63 UIToolbar *toolbar;
64 int keyboardSounds;
65 NSTimer *timer;
66 NSMutableArray *queuedActions;
67 CLLocationManager *locationManager;
70 @property (nonatomic, assign) IBOutlet UISegmentedControl *segmCtrl;
71 @property (nonatomic, assign) IBOutlet UIWebView *webView0;
72 @property (nonatomic, assign) IBOutlet UIWebView *webView1;
73 @property (nonatomic, assign) IBOutlet UIWebView *webView2;
74 @property (nonatomic, assign) IBOutlet UIWebView *webView3;
75 @property (nonatomic, retain) IBOutlet UITextView *textView0;
76 @property (nonatomic, retain) IBOutlet UITextView *textView1;
77 @property (nonatomic, retain) IBOutlet UIImageView *imageView0;
78 @property (nonatomic, retain) IBOutlet UIImageView *imageView1;
79 @property (nonatomic, assign) IBOutlet UIButton *cancelButton;
80 @property (nonatomic, assign) IBOutlet UIView *accessoryView;
81 @property (nonatomic, assign) IBOutlet UIToolbar *toolbar;
82 @property (assign) int keyboardSounds;
83 @property (assign) NSTimer *timer;
84 @property (assign) NSMutableArray *queuedActions;
85 @property (assign) CLLocationManager *locationManager;
87 - (void)queue_action:(void(^)())action;
88 - (void)send_event:(NSString*)name;
89 - (void)send_key:(NSString*)name;
90 - (void)heartbeat_tick;
91 - (void)schedule_next_heartbeat_tick:(double)interval;
93 - (void)app_become_active;
95 - (IBAction)navigation_changed:(id)sender;
97 - (IBAction)touch_up_cancel:(id)sender;
99 - (IBAction)touch_down:(id)sender;
100 - (IBAction)touch_up_F1:(id)sender;
101 - (IBAction)touch_up_F2:(id)sender;
102 - (IBAction)touch_up_F3:(id)sender;
103 - (IBAction)touch_up_F4:(id)sender;
104 - (IBAction)touch_up_F5:(id)sender;
105 - (IBAction)touch_up_F6:(id)sender;
106 - (IBAction)touch_up_F7:(id)sender;
107 - (IBAction)touch_up_F8:(id)sender;
108 - (IBAction)touch_up_F9:(id)sender;
109 - (IBAction)touch_up_F10:(id)sender;
110 - (IBAction)touch_up_F11:(id)sender;
111 - (IBAction)touch_up_F12:(id)sender;
112 - (IBAction)touch_up_F13:(id)sender;
113 - (IBAction)touch_up_SHARP:(id)sender;
114 - (IBAction)touch_up_DQUOTE:(id)sender;
115 - (IBAction)touch_up_QUOTE:(id)sender;
116 - (IBAction)touch_up_COMMA:(id)sender;
117 - (IBAction)touch_up_PLUS:(id)sender;
118 - (IBAction)touch_up_MINUS:(id)sender;
119 - (IBAction)touch_up_STAR:(id)sender;
120 - (IBAction)touch_up_SLASH:(id)sender;
121 - (IBAction)touch_up_LPAREN:(id)sender;
122 - (IBAction)touch_up_RPAREN:(id)sender;
124 @end