| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebValidationMessageClient_h | 31 #ifndef WebInbandTextTrack_h |
| 32 #define WebValidationMessageClient_h | 32 #define WebInbandTextTrack_h |
| 33 | |
| 34 #include "WebTextDirection.h" | |
| 35 | 33 |
| 36 namespace WebKit { | 34 namespace WebKit { |
| 37 | 35 |
| 38 class WebString; | 36 class WebString; |
| 39 struct WebRect; | 37 class WebInbandTextTrackClient; |
| 40 | 38 |
| 41 // Client interface to handle form validation message UI. | 39 class WebInbandTextTrack { |
| 42 class WebValidationMessageClient { | |
| 43 public: | 40 public: |
| 44 // Show a notification popup for the specified form vaidation messages | 41 enum Kind { |
| 45 // besides the anchor rectangle. An implementation of this function should | 42 KindSubtitles, |
| 46 // not hide the popup until hideValidationMessage call. | 43 KindCaptions, |
| 47 virtual void showValidationMessage(const WebRect& anchorInScreen, const WebS
tring& mainText, const WebString& supplementalText, WebTextDirection hint) { } | 44 KindDescriptions, |
| 45 KindChapters, |
| 46 KindMetadata, |
| 47 KindNone |
| 48 }; |
| 48 | 49 |
| 49 // Hide notifation popup for form validation messages. | 50 enum Mode { |
| 50 virtual void hideValidationMessage() { } | 51 ModeDisabled, |
| 52 ModeHidden, |
| 53 ModeShowing |
| 54 }; |
| 51 | 55 |
| 56 virtual ~WebInbandTextTrack() {} |
| 52 | 57 |
| 53 protected: | 58 virtual void setClient(WebInbandTextTrackClient*) = 0; |
| 54 virtual ~WebValidationMessageClient() { } | 59 virtual WebInbandTextTrackClient* client() = 0; |
| 60 |
| 61 virtual void setMode(Mode) = 0; |
| 62 virtual Mode mode() const = 0; |
| 63 |
| 64 virtual Kind kind() const = 0; |
| 65 virtual bool isClosedCaptions() const = 0; |
| 66 |
| 67 virtual WebString label() const = 0; |
| 68 virtual WebString language() const = 0; |
| 69 virtual bool isDefault() const = 0; |
| 70 |
| 71 virtual int textTrackIndex() const = 0; |
| 55 }; | 72 }; |
| 56 | 73 |
| 57 } // namespace WebKit | 74 } // namespace WebKit |
| 58 | 75 |
| 59 #endif | 76 #endif |
| OLD | NEW |