| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 #import <ChromeWebView/cwv_export.h> |
| 6 #import <Foundation/Foundation.h> |
| 7 |
| 8 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_DELEGATE_H |
| 9 #define IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_DELEGATE_H |
| 10 |
| 11 NS_ASSUME_NONNULL_BEGIN |
| 12 |
| 13 @class CWVTranslationController; |
| 14 @class CWVLanguageDetectionResult; |
| 15 @class CWVTranslationLanguage; |
| 16 |
| 17 // Updates delegate on translation progress. |
| 18 CWV_EXPORT |
| 19 @protocol CWVTranslationControllerDelegate<NSObject> |
| 20 |
| 21 @required |
| 22 // Called when language detection is completed. Contains information on the |
| 23 // detected language, the assumed target language for translation, as well as |
| 24 // all languages supported by this translation controller. |
| 25 // |error| will be nonnull if language detection failed. |
| 26 - (void)translationController:(CWVTranslationController*)controller |
| 27 didFinishLanguageDetectionWithResult:(CWVLanguageDetectionResult*)result |
| 28 error:(nullable NSError*)error; |
| 29 |
| 30 @optional |
| 31 // Called when a translation has started. |
| 32 - (void)translationController:(CWVTranslationController*)controller |
| 33 didStartTranslationFromLanguage:(CWVTranslationLanguage*)sourceLanguage |
| 34 toLanguage:(CWVTranslationLanguage*)targetLanguage; |
| 35 |
| 36 // Called when translation finishes. |error| will be nonnull if it failed. |
| 37 - (void)translationController:(CWVTranslationController*)controller |
| 38 didFinishTranslationFromLanguage:(CWVTranslationLanguage*)sourceLanguage |
| 39 toLanguage:(CWVTranslationLanguage*)targetLanguage |
| 40 error:(nullable NSError*)error; |
| 41 |
| 42 @end |
| 43 |
| 44 NS_ASSUME_NONNULL_END |
| 45 |
| 46 #endif // IOS_WEB_VIEW_PUBLIC_CWV_TRANSLATION_CONTROLLER_DELEGATE_H |
| OLD | NEW |