Bold360 and BoldChat Developer Center

BoldChatViewController.h

1 //
2 // Copyright (c) 2014 LogMeIn Inc. All rights reserved.
3 //
4 
5 #import <UIKit/UIKit.h>
6 #import "BoldChatAccountSettings.h"
8 #import "BCMessage.h"
9 #import "BoldChatSecureParamsProvision.h"
10 
12 
17 @protocol BoldChatViewControllerDelegate <NSObject>
18 
19 @optional
27 - (void)boldChatViewControllerChatSessionDidStart:(BoldChatViewController *)boldChatViewController visitorId:(NSString *)visitorId language:(NSString *)language;
28 
34 - (void)boldChatViewControllerChatSessionDidFinish:(BoldChatViewController *)boldChatViewController;
35 
41 - (void)boldChatViewControllerChatDidStart:(BoldChatViewController *)boldChatViewController;
42 
43 
49 - (void)boldChatViewControllerChatDidFinish:(BoldChatViewController *)boldChatViewController;
50 
57 - (void)boldChatViewController:(BoldChatViewController *)boldChatViewController chatMessageDidArrive:(BCMessage *)message;
58 
65 - (void)boldChatViewController:(BoldChatViewController *)boldChatViewController chatAutoMessageDidArrive:(BCMessage *)message;
66 
67 
74 - (void)boldChatViewController:(BoldChatViewController *)boldChatViewController operatorTyping:(BOOL)typing;
75 
83 - (void)boldChatViewController:(BoldChatViewController *)boldChatViewController didChangeLanguageTo:(NSString *)language branding:(NSDictionary *)branding;
84 
85 
92 - (void)boldChatViewController:(BoldChatViewController *)boldChatViewController didFailWithError:(NSError *)error;
93 @end
94 
101 @optional
107 - (void)boldChatViewControllerFormExternalActionPressed:(BoldChatViewController *)boldChatViewController;
108 
114 - (void)boldChatViewControllerChatExternalActionPressed:(BoldChatViewController *)boldChatViewController;
115 
121 - (void)boldChatViewControllerMainExternalActionPressed:(BoldChatViewController *)boldChatViewController;
122 
128 - (void)boldChatViewControllerErrorExternalActionPressed:(BoldChatViewController *)boldChatViewController;
129 
135 - (void)boldChatViewControllerEndExternalActionPressed:(BoldChatViewController *)boldChatViewController;
136 
137 
138 @end
139 
147 @interface BoldChatViewController : UIViewController
148 
153 @property(nonatomic, assign)id<BoldChatViewControllerDelegate> delegate;
154 
159 @property(nonatomic, assign)id<BoldChatViewControllerExternalActions> externalEvents;
160 
161 
166 @property(nonatomic, readonly)BoldChatAccountSettings *accountSettings;
167 
172 @property(nonatomic, readonly)BoldChatViewSettings *viewSettings;
173 
178 @property(nonatomic, readonly)NSString *language;
179 
184 @property(nonatomic, assign)BOOL handleKeyboardEvents;
185 
190 @property(nonatomic, assign)BOOL handlesApplicationLifecycle;
191 
196 @property(nonatomic, strong)IBOutlet UIView *loadingView;
197 
202 @property(nonatomic, strong)IBOutlet UIActivityIndicatorView *loadingActivityIndicator;
203 
208 @property(nonatomic, strong)IBOutlet UIView *errorView;
209 
214 @property(nonatomic, strong)IBOutlet UILabel *errorLabel;
215 
220 @property(nonatomic, strong)IBOutlet UIView *endView;
221 
226 @property(nonatomic, strong)IBOutlet UILabel *endLabel;
227 
232 @property(nonatomic, strong)IBOutlet UIView *chatHolderView;
233 
238 @property(nonatomic, strong)IBOutlet UIView *preChatHolderView;
239 
244 @property(nonatomic, strong)IBOutlet UIView *postChatHolderView;
245 
250 @property(nonatomic, strong)IBOutlet UIView *unavailableChatHolderView;
251 
257 @property(nonatomic, strong)UIButton *mainExternalActionButton;
258 
264 @property(nonatomic, strong)UIButton *endExternalActionButton;
265 
271 @property(nonatomic, strong)UIButton *errorExternalActionButton;
272 
273 
282 - (id)initWithAccountSettings:(BoldChatAccountSettings *)accountSettings viewSettings:(BoldChatViewSettings *)viewSettings language:(NSString *)language;
283 
291 - (void)configureWithAccountSettings:(BoldChatAccountSettings *)accountSettings viewSettings:(BoldChatViewSettings *)viewSettings language:(NSString *)language;
292 
293 
298 - (void)start;
299 
308 
313 - (void)stop;
314 
319 - (IBAction)submitFormOrEndChat;
320 
325 - (void)suspend;
326 
331 - (void)resume;
332 
337 - (void)sendMessageText:(NSString *)message;
338 
343 - (void)sendMessageTyping:(BOOL)typing;
344 
351 
358 
365 
371 @end
BOOL handlesApplicationLifecycle
If YES it handles the application going background and foreground events. Default: YES...
Definition: BoldChatViewController.h:190
NSString * language
The language of the chat.
Definition: BoldChatViewController.h:178
UIButton * mainExternalActionButton
The mainExternalAction button.
Definition: BoldChatViewController.h:257
void resignContainedFirstResponder()
Hides the keyboarded if it is presented by any of the view controller's subviews. ...
IBOutlet UIView * chatHolderView
The view that holds the chat view.
Definition: BoldChatViewController.h:232
IBOutlet UILabel * errorLabel
The error text label.
Definition: BoldChatViewController.h:214
IBOutlet UIView * endView
The end view shown when the chat session ended.
Definition: BoldChatViewController.h:220
id< BoldChatViewControllerDelegate > delegate
The delegate.
Definition: BoldChatViewController.h:153
IBAction submitFormOrEndChat()
Depending on the view state it submits the currently shown pre, post or unavailable chat...
IBOutlet UILabel * endLabel
The end text label.
Definition: BoldChatViewController.h:226
IBOutlet UIView * preChatHolderView
The view that holds the pre chat form.
Definition: BoldChatViewController.h:238
BOOL handleKeyboardEvents
If set the UI changes on keyboard showing/dismissal. Default: YES.
Definition: BoldChatViewController.h:184
Boldchat account related settings.
Definition: BoldChatAccountSettings.h:12
id< BoldChatSecureParamsProvision > startWithWaitingForSecureParams()
Starts the chatting with showing the loading view and waiting for secure parameters. If a secure chat is to be started, start it with calling this selector. It shows the loading view while continueWithSecureParams: is not called and the pre chat form or the chat did not arrive.
void resume()
Resume the chat. No need to call if handlesApplicationLifecycle is YES.
A single view controller that implements the whole process of chatting with an operator through BoldC...
Definition: BoldChatViewController.h:147
BoldChat view related settings.
Definition: BoldChatViewSettings.h:52
UIButton * errorExternalActionButton
The errorExternalAction button that can be added ti the error view.
Definition: BoldChatViewController.h:271
BoldChatAccountSettings * accountSettings
The BoldChat account related settings for the chat.
Definition: BoldChatViewController.h:166
UIButton * endExternalActionButton
The endExternalAction button that can be added ti the end view.
Definition: BoldChatViewController.h:264
void start()
Start the chat process. It starts with creating the chat. If the view controller is created and prese...
BoldChatViewSettings * viewSettings
The view customizations.
Definition: BoldChatViewController.h:172
IBAction mainExternalActionButtonPressed()
IBAction for mainExternalActionButton.
IBOutlet UIActivityIndicatorView * loadingActivityIndicator
The loading activity indicator view.
Definition: BoldChatViewController.h:202
IBAction errorExternalActionButtonPressed()
IBAction for errorExternalActionButton.
The delegate of the BoldChatViewController. Lifecycle events of the chat are called back on it...
Definition: BoldChatViewController.h:17
id< BoldChatViewControllerExternalActions > externalEvents
The external event callbacks.
Definition: BoldChatViewController.h:159
IBOutlet UIView * unavailableChatHolderView
The view that holds the unavailable chat form.
Definition: BoldChatViewController.h:250
void stop()
Stop and finish the chat. It can be called anytime.
Protocol for providing secure parameters for creating a chat session. If the BoldChatViewController ...
Definition: BoldChatSecureParamsProvision.h:14
IBOutlet UIView * errorView
The error view shown if there is an error.
Definition: BoldChatViewController.h:208
IBOutlet UIView * postChatHolderView
The view that holds the post chat form.
Definition: BoldChatViewController.h:244
The container class for all information about a specific chat message.
Definition: BCMessage.h:13
Customized callbacks of buttons on BoldChatViewController.
Definition: BoldChatViewController.h:100
void suspend()
Suspend the chat. No need to call if handlesApplicationLifecycle is YES.
IBAction endExternalActionButtonPressed()
IBAction for endExternalActionButton.
IBOutlet UIView * loadingView
The loading view shown as an overlay when there is an ongoing remote request.
Definition: BoldChatViewController.h:196