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

Side by Side Diff: ui/views/word_lookup_client.h

Issue 2164483006: [MacViews] Implemented text context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 3 years, 10 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
« no previous file with comments | « ui/views/controls/views_text_services_context_menu_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WORD_LOOKUP_CLIENT_H_ 5 #ifndef UI_VIEWS_WORD_LOOKUP_CLIENT_H_
6 #define UI_VIEWS_WORD_LOOKUP_CLIENT_H_ 6 #define UI_VIEWS_WORD_LOOKUP_CLIENT_H_
7 7
8 #include "ui/views/views_export.h" 8 #include "ui/views/views_export.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 struct DecoratedText; 11 struct DecoratedText;
12 class Point; 12 class Point;
13 } 13 }
14 14
15 namespace views { 15 namespace views {
16 16
17 // An interface implemented by a view which supports word lookups. 17 // An interface implemented by a view which supports word lookups.
18 class VIEWS_EXPORT WordLookupClient { 18 class VIEWS_EXPORT WordLookupClient {
19 public: 19 public:
20 // Retrieves the word displayed at the given |point| along with its styling 20 // Retrieves the word displayed at the given |point| along with its styling
21 // information. |point| is in the coordinate system of the view. If no word is 21 // information. |point| is in the coordinate system of the view. If no word is
22 // displayed at the point, returns a nearby word. |baseline_point| should 22 // displayed at the point, returns a nearby word. |baseline_point| should
23 // correspond to the baseline point of the leftmost glyph of the |word| in the 23 // correspond to the baseline point of the leftmost glyph of the word in the
24 // view's coordinates. Returns false, if no word can be retrieved. 24 // view's coordinates. Returns false, if no word can be retrieved.
25 virtual bool GetDecoratedWordAtPoint(const gfx::Point& point, 25 virtual bool GetDecoratedWordAndBaselineAtPoint(
26 gfx::DecoratedText* decorated_word, 26 const gfx::Point& point,
27 gfx::Point* baseline_point) = 0; 27 gfx::DecoratedText* decorated_word,
28 gfx::Point* baseline_point) = 0;
29
30 // Retrieves the text that is currently selected with its styling
31 // information. |baseline_point| should correspond to the baseline point of
32 // the leftmost glyph of the word in the view's coordinates. Returns
33 // false, if no text can be retrieved.
34 virtual bool GetDecoratedTextAndBaselineFromSelection(
35 gfx::DecoratedText* decorated_text,
36 gfx::Point* baseline_point) = 0;
28 37
29 protected: 38 protected:
30 virtual ~WordLookupClient() {} 39 virtual ~WordLookupClient() {}
31 }; 40 };
32 41
33 } // namespace views 42 } // namespace views
34 43
35 #endif // UI_VIEWS_WORD_LOOKUP_CLIENT_H_ 44 #endif // UI_VIEWS_WORD_LOOKUP_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/views/controls/views_text_services_context_menu_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698