Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: ios/web_view/public/cwv_translation_controller_delegate.h

Issue 2839093002: Implemented new Translate API for purely Objective-C clients. (Closed)
Patch Set: merge Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « ios/web_view/public/cwv_translation_controller.h ('k') | ios/web_view/public/cwv_translation_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698