1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_NOTIFICATION_HANDLER_H_
6 #define IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_NOTIFICATION_HANDLER_H_
7 
8 @protocol TranslateNotificationDelegate;
9 
10 // Types of translate notifications.
11 typedef NS_ENUM(NSInteger, TranslateNotificationType) {
12   // Notification that user chose 'sourceLanguage' to always be translated to
13   // 'targetLanguage'.
14   TranslateNotificationTypeAlwaysTranslate,
15   // Notification that it was automatically decided that 'sourceLanguage' to
16   // always be translated to 'targetLanguage'.
17   TranslateNotificationTypeAutoAlwaysTranslate,
18   // Notification that user chose 'sourceLanguage' not to be translated.
19   TranslateNotificationTypeNeverTranslate,
20   // Notification that it was automatically decided that 'sourceLanguage' not to
21   // be translated.
22   TranslateNotificationTypeAutoNeverTranslate,
23   // Notification that user chose the site not to be translated.
24   TranslateNotificationTypeNeverTranslateSite,
25   // Notification that the page could not be translated.
26   TranslateNotificationTypeError,
27 };
28 
29 // Protocol adopted by an object that displays translate notifications.
30 @protocol TranslateNotificationHandler
31 
32 // Tells the handler to display a notification of the given type and inform
33 // |delegate| of its dismissal (whether automatically or by the user) as well as
34 // its reversal by the user.
35 - (void)showTranslateNotificationWithDelegate:
36             (id<TranslateNotificationDelegate>)delegate
37                              notificationType:(TranslateNotificationType)type;
38 
39 // Tells the handler to stop displaying the notification, if any.
40 - (void)dismissNotification;
41 
42 @end
43 
44 #endif  // IOS_CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_NOTIFICATION_HANDLER_H_
45