Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_WORD_LOOKUP_CLIENT_H_ | |
| 6 #define UI_VIEWS_WORD_LOOKUP_CLIENT_H_ | |
| 7 | |
| 8 #include "ui/views/views_export.h" | |
| 9 | |
| 10 namespace gfx { | |
| 11 struct DecoratedText; | |
| 12 class Point; | |
| 13 } // namespace gfx | |
|
tapted
2016/10/05 06:20:55
nit: comments aren't usually put at the end of nam
karandeepb
2016/10/06 01:07:05
Done.
| |
| 14 | |
| 15 namespace views { | |
| 16 | |
| 17 // An interface implemented by a view which supports word lookups. | |
| 18 class VIEWS_EXPORT WordLookupClient { | |
| 19 public: | |
| 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 | |
| 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 | |
| 24 // view's coordinates. Returns false, if no word can be retrieved. | |
| 25 virtual bool GetDecoratedWordAtPoint(const gfx::Point& point, | |
| 26 gfx::DecoratedText* decorated_word, | |
| 27 gfx::Point* baseline_point) = 0; | |
| 28 | |
| 29 protected: | |
| 30 ~WordLookupClient() {} | |
|
tapted
2016/10/05 06:20:55
declare virtual? (or can it be omitted whilst ther
sky
2016/10/05 16:15:36
Generally we declare the destructor in pure virtua
karandeepb
2016/10/06 01:07:05
Declared virtual. I think if we omit the destructo
karandeepb
2016/10/06 01:07:05
Done.
tapted
2016/10/06 02:03:19
Hypothetically, I think a future subclass we don't
karandeepb
2016/10/06 02:23:02
Makes sense, thanks!
| |
| 31 }; | |
| 32 | |
| 33 } // namespace views | |
| 34 | |
| 35 #endif // UI_VIEWS_WORD_LOOKUP_CLIENT_H_ | |
| OLD | NEW |