Today's Menu  Portugal
journal and plan nutrition
Instance Methods | Properties | List of all members
U4WebControlsView Class Reference

#import <U4WebControlsView.h>

Inheritance diagram for U4WebControlsView:
Inheritance graph
[legend]
Collaboration diagram for U4WebControlsView:
Collaboration graph
[legend]

Instance Methods

(instancetype) - initWithFrame:andDelegate:
 
(void) - focusAvailable:
 
(void) - update:
 
(void) - navigationProvisional
 
(void) - navigationFinished
 
(void) - navigationScanComplete
 
(float) - heightRequirement [implementation]
 
(void) - appear: [implementation]
 
(void) - pageLoaded: [implementation]
 
(void) - update [implementation]
 
(void) - clickBackButton [implementation]
 
(void) - clickChecklistButton [implementation]
 
(void) - clickStirButton [implementation]
 
(void) - clickForwardButton [implementation]
 
(void) - clickEditCopyButton [implementation]
 

Properties

UIButton * backButton
 
UIButton * forwardButton
 
UIButton * stirButton
 
UIButton * chklButton
 
UIButton * editCopyButton
 
UILabel * pageLoadedLabel
 
NSNumber * navigationCondition
 

Detailed Description

Web Controls

This view contains back, forward, stir, and use-test-page buttons (pulled rankdir=LR;)

dot_inline_dotgraph_5.png

Definition at line 16 of file U4WebControlsView.h.

Method Documentation

◆ appear:()

- (void) appear: (CGRect)  bound
implementation

Definition at line 74 of file U4WebControlsView.m.

74  :(CGRect)bound
75 {
76  CGRect backButtonFrame = CGRectMake(12, -2, 48, 48);
77  _backButton = [[UIButton alloc] initWithFrame: backButtonFrame];
78  [_backButton addTarget:self action:@selector(clickBackButton) forControlEvents:UIControlEventTouchUpInside];
79  UIImage *backButtonImage = [UIImage imageNamed:@"backButton.png"];
80  [_backButton setImage:backButtonImage forState:UIControlStateNormal];
81 
82  CGRect chklButtonFrame = CGRectMake(bound.size.width/2 - 74, 0, 48, 48);
83  _chklButton = [[UIButton alloc] initWithFrame: chklButtonFrame];
84  [_chklButton addTarget:self action:@selector(clickChecklistButton) forControlEvents:UIControlEventTouchUpInside];
85  UIImage *chklButtonImage = [UIImage imageNamed:@"clipboardRound.png"];
86  [_chklButton setImage:chklButtonImage forState:UIControlStateNormal];
87 
88 
89  CGRect stirButtonFrame = CGRectMake(bound.size.width/2 - 24, 0, 48, 48);
90  _stirButton = [[UIButton alloc] initWithFrame: stirButtonFrame];
91  [_stirButton addTarget:self action:@selector(clickStirButton) forControlEvents:UIControlEventTouchUpInside];
92  UIImage *stirButtonImage = [UIImage imageNamed:@"stirringRound.png"];
93  [_stirButton setImage:stirButtonImage forState:UIControlStateNormal];
94  [_stirButton setHidden:YES];
95 
96  CGRect forwardButtonFrame = CGRectMake(bound.size.width - 56, -2, 48, 48);
97  _forwardButton = [[UIButton alloc] initWithFrame: forwardButtonFrame];
98  [_forwardButton addTarget:self action:@selector(clickForwardButton) forControlEvents:UIControlEventTouchUpInside];
99  UIImage *forwardButtonImage = [UIImage imageNamed:@"forwardButton.png"];
100  [_forwardButton setImage:forwardButtonImage forState:UIControlStateNormal];
101 
102  CGRect editCopyButtonFrame = CGRectMake(bound.size.width - 106, -2, 48, 48);
103  _editCopyButton = [[UIButton alloc] initWithFrame: editCopyButtonFrame];
104  [_editCopyButton addTarget:self action:@selector(clickEditCopyButton) forControlEvents:UIControlEventTouchUpInside];
105  UIImage *editCopyButtonImage = [UIImage imageNamed:@"clipboard2.png"];
106  [_editCopyButton setImage:editCopyButtonImage forState:UIControlStateNormal];
107 
108  CGRect pageLoadedLabelFrame = CGRectMake(2, 48, bound.size.width, 20);
109  _pageLoadedLabel = [[UILabel alloc] initWithFrame:pageLoadedLabelFrame];
110  [_pageLoadedLabel setTextColor:[UIColor blackColor]];
111  [_pageLoadedLabel setBackgroundColor:[UIColor yellowColor]];
112 
113  [self addSubview:_backButton];
114  [self addSubview:_chklButton];
115  [self addSubview:_stirButton];
116  [self addSubview:_forwardButton];
117  [self addSubview:_editCopyButton];
118  [self addSubview:_pageLoadedLabel];
119 }

◆ clickBackButton()

- (void) clickBackButton
implementation

Definition at line 168 of file U4WebControlsView.m.

169 {
170  [y3wvDelegate goBack];
171 }

◆ clickChecklistButton()

- (void) clickChecklistButton
implementation

Definition at line 173 of file U4WebControlsView.m.

174 {
175  NSLog(@"U4WebViewController.clickChecklistButton");
176  NSBundle *mb = [NSBundle mainBundle];
177  NSURL *nsurl=[mb URLForResource:@"testHalibut" withExtension:@"html"];
178  NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
179  [y3wvDelegate loadRequest:nsrequest];
180 }

◆ clickEditCopyButton()

- (void) clickEditCopyButton
implementation

Definition at line 190 of file U4WebControlsView.m.

191 {
192  [y3wvDelegate goEditCopy];
193 }

◆ clickForwardButton()

- (void) clickForwardButton
implementation

Definition at line 186 of file U4WebControlsView.m.

187 {
188  [y3wvDelegate goForward];
189 }

◆ clickStirButton()

- (void) clickStirButton
implementation

Definition at line 181 of file U4WebControlsView.m.

182 {
183  NSLog(@"U4WebViewController.clickStirButton");
184  [y3wvDelegate stirJavascript];
185 }

◆ focusAvailable:()

- (void) focusAvailable: (BOOL)  flag

Definition at line 125 of file U4WebControlsView.m.

125  :(BOOL) flag
126 {
127  NSLog(@"U4WebControlsView.focusavailable: %@", flag?@"TRUE":@"FALSE");
128  [_stirButton setHidden:!flag];
129  [self setNeedsDisplay];
130 }

◆ heightRequirement()

- (float) heightRequirement
implementation

Definition at line 69 of file U4WebControlsView.m.

70 {
71  return 68.0;
72 }

◆ initWithFrame:andDelegate:()

- (instancetype) initWithFrame: (CGRect)  frame
andDelegate: (id<U4WebControlsDelegate>)  delegate 

Definition at line 60 of file U4WebControlsView.m.

60  :(CGRect)frame andDelegate:(id<U4WebControlsDelegate>)delegate
61 {
62  self = [super initWithFrame:frame];
63  if (self) {
65  }
66  return self;
67 }
id< U7ParamEditControlDelegate > delegate
id< U4WebControlsDelegate > y3wvDelegate

◆ navigationFinished()

- (void) navigationFinished

Definition at line 158 of file U4WebControlsView.m.

159 {
160  [self setBackgroundColor:[UIColor blueColor]];
161 }

◆ navigationProvisional()

- (void) navigationProvisional

Definition at line 154 of file U4WebControlsView.m.

155 {
156  [self setBackgroundColor:[UIColor yellowColor]];
157 }

◆ navigationScanComplete()

- (void) navigationScanComplete

Definition at line 162 of file U4WebControlsView.m.

163 {
164  [self setBackgroundColor:[UIColor greenColor]];
165 }

◆ pageLoaded:()

- (void) pageLoaded: (NSString *)  addressStr
implementation

Definition at line 121 of file U4WebControlsView.m.

121  :(NSString *) addressStr
122 {
123  [_pageLoadedLabel setText:addressStr];
124 }

◆ update()

- (void) update
implementation

Definition at line 132 of file U4WebControlsView.m.

133 {
134  NSLog(@"U4WebControlsView.update: NO-OP");
135 }

◆ update:()

- (void) update: (WKWebView *)  webViewHere

Definition at line 137 of file U4WebControlsView.m.

137  :(WKWebView *)webViewHere {
138 
139  if ([webViewHere canGoBack]) {
140  [_backButton setHidden:NO];
141  } else {
142  [_backButton setHidden:YES];
143  }
144 
145  if ([webViewHere canGoForward]) {
146  [_forwardButton setHidden:NO];
147  } else {
148  [_forwardButton setHidden:YES];
149  }
150  NSString *urlAddress = webViewHere.URL.description;
151  NSLog(@"U4WebControlsView.update: urlAddress: %@", urlAddress);
152  [_pageLoadedLabel setText:urlAddress];
153 }

Property Documentation

◆ backButton

- (UIButton*) backButton
readwritenonatomicstrong

Definition at line 18 of file U4WebControlsView.h.

◆ chklButton

- (UIButton*) chklButton
readwritenonatomicstrong

Definition at line 21 of file U4WebControlsView.h.

◆ editCopyButton

- (UIButton*) editCopyButton
readwritenonatomicstrong

Definition at line 22 of file U4WebControlsView.h.

◆ forwardButton

- (UIButton*) forwardButton
readwritenonatomicstrong

Definition at line 19 of file U4WebControlsView.h.

◆ navigationCondition

- (NSNumber*) navigationCondition
readwritenonatomicstrong

Definition at line 25 of file U4WebControlsView.h.

◆ pageLoadedLabel

- (UILabel*) pageLoadedLabel
readwritenonatomicstrong

Definition at line 24 of file U4WebControlsView.h.

◆ stirButton

- (UIButton*) stirButton
readwritenonatomicstrong

Definition at line 20 of file U4WebControlsView.h.


The documentation for this class was generated from the following files: